Files
css-test/app/core/app_factory.py
T
paul d50c1c5bba feat: Initialize FastAPI application with Azure authentication and transaction management
- Added .env.example for environment variable configuration.
- Created app initialization files and core settings management.
- Implemented API routers for reporting and transaction endpoints.
- Developed transaction management service with CRUD operations.
- Integrated Azure OAuth for user authentication.
- Designed dashboard view with transaction filtering and display.
- Added Swagger UI documentation with custom dark theme.
- Created static and template files for frontend styling and layout.
2026-05-10 22:17:30 +12:00

41 lines
1.3 KiB
Python

from pathlib import Path
from fastapi import FastAPI
from starlette.middleware.sessions import SessionMiddleware
from fastapi.staticfiles import StaticFiles
from app.api.reporting import router as reporting_router
from app.api.transactions import router as transactions_router
from app.core.settings import get_settings
from app.views.auth import router as auth_router
from app.views.dashboard import router as dashboard_router
from app.views.docs import router as docs_router
def create_app() -> FastAPI:
settings = get_settings()
app = FastAPI(
title="Recon Ranger",
description="Financial crime reconciliation API — patrol your data landscape for inconsistencies.",
version="0.1.0",
docs_url=None,
)
app.add_middleware(
SessionMiddleware,
secret_key=settings.session_secret_key,
same_site="lax",
https_only=False,
)
project_root = Path(__file__).resolve().parents[2]
static_dir = project_root / "data" / "static"
app.mount("/static", StaticFiles(directory=str(static_dir)), name="static")
app.include_router(transactions_router)
app.include_router(reporting_router)
app.include_router(auth_router)
app.include_router(dashboard_router)
app.include_router(docs_router)
return app