from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
from app.routes import home, about, projects, contact
from app.config import get_settings
from app.database import init_db

app = FastAPI(title="Geekbrain Portfolio")

@app.on_event("startup")
async def startup_event():
    await init_db()

app.mount("/static", StaticFiles(directory="app/static"), name="static")

app.include_router(home.router)
app.include_router(about.router)
app.include_router(projects.router)
app.include_router(contact.router)

@app.get("/health")
async def health():
    return {"status": "ok"}
