Admin panel for FastAPI applications with SQLAlchemy models
Project description
Overwatch - Admin Panel for FastAPI
Overwatch is a reusable, admin panel package for FastAPI applications that automatically generates CRUD interfaces for SQLAlchemy models. It provides an Admin experience with enhanced features including audit logging, permissions, and a modern TypeScript frontend.
✨ Features
- 🔧 Model Agnostic: Works with any SQLAlchemy model
- 🎨 Modern UI: TypeScript frontend with Modern components
- 🔐 Authentication: Secure JWT-based authentication system
- 👥 Role Management: Hierarchical roles with fine-grained permissions
- 📊 Audit Logging: Complete audit trail of all admin actions
- 🔍 Search & Filter: Advanced search and filtering capabilities
- 📄 Pagination: Efficient pagination for large datasets
- 🚀 Performance: Async operations and optimized queries
🚀 Quick Start
Installation
pip install overwatch-admin
Basic Usage
from fastapi import FastAPI
from sqlalchemy import Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from overwatch import OverwatchAdmin, OverwatchConfig
# Create FastAPI app
app = FastAPI()
# Define your models
Base = declarative_base()
class User(Base):
__tablename__ = "users"
id = Column(Integer, primary_key=True)
username = Column(String(50), unique=True)
email = Column(String(100))
# Initialize Overwatch admin
admin = OverwatchAdmin(
app=app,
db_session=get_db_session, # Your database session dependency
models=[User], # Your SQLAlchemy models
admin_title="My Admin Panel"
)
# Configure model display
admin.configure_model(
User,
list_fields=["id", "username", "email"],
search_fields=["username", "email"],
)
app.run()
📋 Requirements
- Python 3.11+
- FastAPI 0.104+
- SQLAlchemy 2.0+
- Async database driver (asyncpg, aiosqlite, etc.)
⚙️ Configuration
Overwatch can be configured through environment variables or direct configuration:
from overwatch import OverwatchConfig
from overwatch.core.config import SecurityConfig
config = OverwatchConfig(
admin_title="My Admin Panel",
security=SecurityConfig(
secret_key="your-secret-key",
access_token_expire_minutes=30,
password_min_length=8,
),
per_page=25,
enable_audit_log=True,
enable_dashboard=True,
cors_origins=["http://localhost:3000"],
)
Environment Variables
OVERWATCH_ADMIN_TITLE="My Admin Panel"
OVERWATCH_SECURITY__SECRET_KEY="your-secret-key"
OVERWATCH_SECURITY__ACCESS_TOKEN_EXPIRE_MINUTES=30
OVERWATCH_PER_PAGE=25
OVERWATCH_ENABLE_AUDIT_LOG=true
🔐 Authentication & Authorization
Built-in Authentication
Overwatch comes with a complete authentication system separate from your application's user system:
# Create admin user
admin = await admin.create_admin(
username="superadmin",
password="secure-password",
email="admin@example.com",
role="super_admin"
)
Roles & Permissions
- Super Admin: Full access to all resources
- Admin: Standard CRUD operations
- Read Only: View-only access
🔧 Advanced Usage
Custom Database
Overwatch can use a separate database:
config = OverwatchConfig(
database={
"url": "postgresql+asyncpg://overwatch:password@localhost/overwatch_db",
"echo": False
}
)
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- FastAPI - The web framework that makes Overwatch possible
- SQLAlchemy - Powerful ORM for database operations
- Pydantic - Data validation and settings management
📞 Support
- 📖 Documentation
- 🐛 Issue Tracker
Overwatch - Making admin panels in FastAPI simple and beautiful. 🚀
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file overwatch_admin-0.1.18.tar.gz.
File metadata
- Download URL: overwatch_admin-0.1.18.tar.gz
- Upload date:
- Size: 63.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9cc0b19f1e341f38724ba14585f62bf1872b56fa3aed4ff55f4c6aa88ea138fb
|
|
| MD5 |
6984e3933591fc88e307998cf88d9c59
|
|
| BLAKE2b-256 |
7b3825ea8ee3e153c8d3da46a4412f16d83af7b143771bd97429860f51dc17f8
|
Provenance
The following attestation bundles were made for overwatch_admin-0.1.18.tar.gz:
Publisher:
release.yml on u3n-ai/overwatch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
overwatch_admin-0.1.18.tar.gz -
Subject digest:
9cc0b19f1e341f38724ba14585f62bf1872b56fa3aed4ff55f4c6aa88ea138fb - Sigstore transparency entry: 894954527
- Sigstore integration time:
-
Permalink:
u3n-ai/overwatch@18c4fee32561d2c6f7d45fa98ab8f42240069bff -
Branch / Tag:
refs/heads/main - Owner: https://github.com/u3n-ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@18c4fee32561d2c6f7d45fa98ab8f42240069bff -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file overwatch_admin-0.1.18-py3-none-any.whl.
File metadata
- Download URL: overwatch_admin-0.1.18-py3-none-any.whl
- Upload date:
- Size: 63.9 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
235a3c01cb90d0b9b9a287e1c3de1a590ff8d6b5159349159c30bb80152bdbde
|
|
| MD5 |
b51d77d496b92cb0fd4360e1140666be
|
|
| BLAKE2b-256 |
559c55554b1663a74318978cd6d098dacc5e2ef5a1741cda6ac9bec614eea4b4
|
Provenance
The following attestation bundles were made for overwatch_admin-0.1.18-py3-none-any.whl:
Publisher:
release.yml on u3n-ai/overwatch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
overwatch_admin-0.1.18-py3-none-any.whl -
Subject digest:
235a3c01cb90d0b9b9a287e1c3de1a590ff8d6b5159349159c30bb80152bdbde - Sigstore transparency entry: 894954532
- Sigstore integration time:
-
Permalink:
u3n-ai/overwatch@18c4fee32561d2c6f7d45fa98ab8f42240069bff -
Branch / Tag:
refs/heads/main - Owner: https://github.com/u3n-ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@18c4fee32561d2c6f7d45fa98ab8f42240069bff -
Trigger Event:
workflow_dispatch
-
Statement type: