File size: 1,533 Bytes
d143e1a
 
 
 
 
 
 
 
 
 
 
 
b2a5955
d143e1a
 
 
 
 
 
 
 
b2a5955
d143e1a
 
 
 
 
b2a5955
d143e1a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
"""
MoodMate AI Engine — FastAPI
God Mode Architecture v2.0
"""

from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from .api.analysis import router as analysis_router
from .api.journal import router as journal_router
from .api.profile import router as profile_router
from .api.games import router as games_router
from .core.ratelimit import setup_ratelimit
from .core.config import settings

# ---------------- APP INITIALIZATION ----------------

app = FastAPI(
    title="MoodMate AI Engine",
    description="Deep Space Cybernetic Emotional Analytics Platform",
    version="2.1.0"
)
setup_ratelimit(app)

# ---------------- CORS CONFIGURATION ----------------

app.add_middleware(
    CORSMiddleware,
    allow_origins=settings.ALLOWED_ORIGINS,
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)

# ---------------- ROUTER INCLUSION ----------------

app.include_router(analysis_router, prefix="/api/v1")
app.include_router(journal_router, prefix="/api/v1/journal")
app.include_router(profile_router, prefix="/api/v1/profile")
app.include_router(games_router, prefix="/api/v1/games")
app.include_router(analysis_router) # Support legacy path

# ---------------- ROOT ENDPOINT ----------------

@app.get("/")
async def root():
    return {
        "message": "Welcome to MoodMate AI Engine",
        "docs": "/docs",
        "health": "/health"
    }

if __name__ == "__main__":
    import uvicorn
    uvicorn.run("app.main:app", host="0.0.0.0", port=8000, reload=True)