The MongoDB admin interface that's actually magical to use.
โ Other MongoDB admin tools:
- Require tons of boilerplate code
- Manual template setup, routing, serialization
- Framework-locked or ORM-dependent
- Complex configuration
โ Monglo:
- 10 lines of code - that's it!
- Library handles EVERYTHING automatically
- Works with FastAPI, Flask, Django
- Auto-detects collections, schemas, relationships
- Production-ready UI included
pip install monglo motor fastapi # or flask, or djangofrom fastapi import FastAPI
from motor.motor_asyncio import AsyncIOMotorClient
from monglo import MongloEngine
from monglo.ui_helpers.fastapi import create_ui_router
# 1. Connect to MongoDB
client = AsyncIOMotorClient("mongodb://localhost:27017")
# 2. Create FastAPI app
app = FastAPI()
# 3. Initialize Monglo
engine = MongloEngine(database=client.mydb, auto_discover=True)
@app.on_event("startup")
async def startup():
await engine.initialize()
app.include_router(create_ui_router(engine))
# That's it! ๐Run it:
uvicorn app:app --reloadVisit: http://localhost:8000/admin
You now have a full-featured admin interface with:
- โ Collection browsing
- โ Document viewing/editing
- โ Search and filtering
- โ Relationship navigation
- โ Auto-detected schemas
- โ Professional UI
# Just initialize - Monglo does the rest
engine = MongloEngine(database=db, auto_discover=True)
await engine.initialize()
# Automatically discovers:
# - All collections
# - Field types and schemas
# - Relationships (user_id โ users collection)
# - Indexes# Your MongoDB document:
{
"user_id": ObjectId("..."), # โ Automatically links to users collection
"tags": [ObjectId("...")], # โ Automatically links to tags collection
"category": "electronics"
}
# Monglo automatically:
# - Detects these relationships
# - Creates clickable navigation
# - Resolves related documents
# - Shows relationship graphsTable View - Browse and filter thousands of documents
- Sortable columns
- Advanced filtering
- Global search
- Bulk operations
- Export (CSV, JSON)
Document View - Inspect and edit individual documents
- Full JSON tree structure
- Relationship navigation
- Field validation
- Nested document support
- Modern, responsive design
- Dark/light modes
- Customizable branding
- Mobile-friendly
- Professional aesthetics
from monglo.ui_helpers.fastapi import create_ui_router
app.include_router(create_ui_router(engine))from monglo.ui_helpers.flask import create_ui_blueprint
app.register_blueprint(create_ui_blueprint(engine))# In urls.py
from monglo.ui_helpers.django import create_ui_urlpatterns
urlpatterns = [
*create_ui_urlpatterns(engine, prefix="admin"),
]Everything works out of the box, but you can customize:
create_ui_router(
engine,
title="My Admin Panel",
logo="https://example.com/logo.png",
brand_color="#ff6b6b"
)from monglo import CollectionConfig, TableViewConfig
await engine.register_collection(
"products",
config=CollectionConfig(
list_fields=["name", "price", "stock"],
search_fields=["name", "description"],
table_view=TableViewConfig(
per_page=50,
default_sort=[("created_at", -1)]
)
)
)from monglo.auth import SimpleAuthProvider
engine = MongloEngine(
database=db,
auth_provider=SimpleAuthProvider(users={
"admin": {
"password_hash": SimpleAuthProvider.hash_password("admin123"),
"role": "admin"
}
})
)Check out examples/ for complete working examples with FastAPI (Flask and Django support coming in future versions):
- basic_example - Minimal FastAPI setup (10 lines)
- advanced_example - Full-featured FastAPI app with relationships
- advanced_auth_example - Authentication and authorization demo
# Clone the repo
git clone https://github.com/me-umar/monglo.git
cd monglo
# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate
# Install development dependencies
pip install -e ".[dev]"pytest tests/ --cov=monglo --cov-report=htmlruff check monglo/
black monglo/ tests/
mypy monglo/ --strictcd examples/fastapi_example/basic_example
python app.pyContributions are welcome! See CONTRIBUTING.md for guidelines.
MIT ยฉ 2025
If Monglo saves you time, give it a star! โญ
Built with:
Before Monglo: 380 lines of boilerplate (templates, routing, serialization, filters...)
After Monglo: 10 lines. Everything just works. โจ