Skip to content

Latest commit

 

History

History
119 lines (91 loc) · 4.13 KB

File metadata and controls

119 lines (91 loc) · 4.13 KB
HyperAdmin Logo

HyperAdmin

A modern, Pydantic-native admin interface for FastAPI, powered by HTMX.

CI Codecov PyPI PyPI - Python Version License


HyperAdmin is a framework for building administrative interfaces on top of FastAPI applications. It leverages the power of Pydantic for data validation and HTMX for creating dynamic, modern user interfaces with minimal JavaScript. It is designed to be highly extensible and easy to use, allowing developers to quickly create rich, data-driven admin panels.

HyperAdmin Screenshot

✨ Key Features

  • Pydantic-Native: Define your admin interfaces directly from your Pydantic models.
  • FastAPI Integration: Mounts seamlessly into any FastAPI application.
  • HTMX-Powered: Delivers a rich, interactive user experience without writing complex JavaScript.
  • SQLModel & SQLAlchemy Support: Works out-of-the-box with popular database libraries.
  • Automatic CRUD: Generates list, detail, create, and update views from your data models.
  • Extensible: Easily customize views, templates, and actions to fit your needs.

📚 Documentation

For a full guide on how to install, configure, and use HyperAdmin, please see the official documentation.

🚀 Getting Started

Installation

pip install hyperadmin

Example Usage

from fastapi import FastAPI
from hyperadmin.admin import Admin
from hyperadmin.views import ModelView
from sqlmodel import SQLModel, Field

# 1. Define your data model
class Product(SQLModel, table=True):
    id: int = Field(default=None, primary_key=True)
    name: str
    price: float

# 2. Create a FastAPI app
app = FastAPI()

# 3. Create an admin instance and register your model
admin = Admin()
admin.register_model(ModelView(Product))

# 4. Mount the admin to your app
admin.mount_to(app)

This will automatically create a full CRUD interface for your Product model at /admin.

🤝 Contributing

Contributions are welcome! Please see the Contributing Guide for more details on how to get started.

Development Environment

This project uses uv for dependency management and poe for task automation.

  1. Clone the repository:

    git clone https://github.com/yevheniidehtiar/hyper-admin.git
    cd hyper-admin
  2. Create and sync the virtual environment:

    uv sync --python 3.10 --all-extras
  3. Activate the virtual environment:

    source .venv/bin/activate
  4. Install pre-commit hooks:

    pre-commit install

Now you're ready to start developing! Run poe to see a list of available tasks.

📄 License

This project is licensed under the MIT License. See the LICENSE file for details.