Initial commit: Wallet App - FastAPI backend with React frontend for personal finance tracking

This commit is contained in:
RemTools
2026-09-04 08:37:14 +00:00 Unverified
commit d7b52f24d2
39572 changed files with 1617122 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
"""FastAPI entry point. Deploy imports ``app.main:app`` — keep both names."""
import os
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from app.routes import api_router
from app.database import Base, engine
# Create database tables
Base.metadata.create_all(bind=engine)
app = FastAPI(title=os.getenv("APP_NAME", "app"))
# Allowed origins come from the environment so the deployed app and local dev
# use the same code path. "*" only when nothing is configured (dev default).
_origins = [o.strip() for o in os.getenv("CORS_ORIGINS", "*").split(",") if o.strip()]
app.add_middleware(
CORSMiddleware,
allow_origins=_origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
# The one place the /api prefix is applied. Route modules must not repeat it.
app.include_router(api_router, prefix="/api")