Initial commit - MIDAS App educação financeira para apostadores (FastAPI + Next.js)

This commit is contained in:
bigtux
2026-02-10 18:52:23 -03:00
commit 954ebccdd6
31 changed files with 1701 additions and 0 deletions

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

@@ -0,0 +1,33 @@
from contextlib import asynccontextmanager
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from app.database import init_db
from app.routers import auth, bets, bankroll, dashboard, alerts, achievements, lessons, reports
@asynccontextmanager
async def lifespan(app: FastAPI):
await init_db()
yield
app = FastAPI(title="MIDAS API", version="1.0.0", lifespan=lifespan)
app.add_middleware(
CORSMiddleware,
allow_origins=["http://localhost:3085", "http://magneto:3085", "*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
app.include_router(auth.router)
app.include_router(bets.router)
app.include_router(bankroll.router)
app.include_router(dashboard.router)
app.include_router(alerts.router)
app.include_router(achievements.router)
app.include_router(lessons.router)
app.include_router(reports.router)
@app.get("/api/health")
async def health():
return {"status": "ok", "app": "MIDAS"}