Add comprehensive backend features and mobile UI improvements
Backend: - Add 2FA authentication with TOTP support - Add API keys management system - Add audit logging for security events - Add file upload/management system - Add notifications system with preferences - Add session management - Add webhooks integration - Add analytics endpoints - Add export functionality - Add password policy enforcement - Add new database migrations for core tables Frontend: - Add module position system (top/bottom sidebar sections) - Add search and notifications module configuration tabs - Add mobile logo replacing hamburger menu - Center page title absolutely when no tabs present - Align sidebar footer toggles with navigation items - Add lighter icon color in dark theme for mobile - Add API keys management page - Add notifications page with context - Add admin analytics and audit logs pages 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,9 @@ from fastapi import FastAPI, Request
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from fastapi.responses import JSONResponse, FileResponse
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
from slowapi import Limiter, _rate_limit_exceeded_handler
|
||||
from slowapi.util import get_remote_address
|
||||
from slowapi.errors import RateLimitExceeded
|
||||
import logging
|
||||
import time
|
||||
|
||||
@@ -17,6 +20,12 @@ from app.api.v1 import router as api_v1_router
|
||||
from app.db.session import engine
|
||||
from app.db.base import Base
|
||||
|
||||
# Import all models so they're registered with Base.metadata before create_all
|
||||
from app.models import ( # noqa: F401
|
||||
User, Settings, AuditLog, APIKey, Notification,
|
||||
UserSession, Webhook, WebhookDelivery, StoredFile
|
||||
)
|
||||
|
||||
# Static files path
|
||||
STATIC_DIR = Path(__file__).parent.parent / "static"
|
||||
|
||||
@@ -29,6 +38,10 @@ logging.basicConfig(
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
# Rate limiter setup
|
||||
limiter = Limiter(key_func=get_remote_address, default_limits=["200/minute"])
|
||||
|
||||
|
||||
# Create FastAPI application
|
||||
app = FastAPI(
|
||||
title=settings.APP_NAME,
|
||||
@@ -39,6 +52,10 @@ app = FastAPI(
|
||||
openapi_url=f"{settings.API_V1_PREFIX}/openapi.json"
|
||||
)
|
||||
|
||||
# Add rate limiter to app state
|
||||
app.state.limiter = limiter
|
||||
app.add_exception_handler(RateLimitExceeded, _rate_limit_exceeded_handler)
|
||||
|
||||
|
||||
# CORS middleware
|
||||
app.add_middleware(
|
||||
|
||||
Reference in New Issue
Block a user