This is the initial push of the outline of the life dashboard

This commit is contained in:
YOUNG
2026-03-09 12:52:48 -05:00
parent bf1e4e754f
commit 7596a5f382
47 changed files with 6522 additions and 3 deletions

28
backend/app/main.py Normal file
View File

@@ -0,0 +1,28 @@
from pathlib import Path
from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
from starlette.responses import FileResponse
from app.routers import auth, finance, weight, workout
app = FastAPI(title="Life Dashboard API")
# API routers
app.include_router(auth.router)
app.include_router(weight.router)
app.include_router(workout.router)
app.include_router(finance.router)
# Serve React SPA static files
STATIC_DIR = Path(__file__).resolve().parent.parent / "static"
if STATIC_DIR.exists():
app.mount("/assets", StaticFiles(directory=STATIC_DIR / "assets"), name="assets")
@app.get("/{full_path:path}")
async def serve_spa(full_path: str):
file_path = STATIC_DIR / full_path
if file_path.is_file():
return FileResponse(file_path)
return FileResponse(STATIC_DIR / "index.html")