Initial commit

This commit is contained in:
wanghep
2026-03-20 21:47:30 +08:00
commit 2eab960303
83 changed files with 51694 additions and 0 deletions

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

@ -0,0 +1,38 @@
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from app.api.routes import router
from app.core.bootstrap import bootstrap_data
from app.services.sync_scheduler import sync_scheduler
def create_app() -> FastAPI:
app = FastAPI(
title="Southbound Capital Monitor",
version="0.1.0",
description="南向资金监控平台 API",
)
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
bootstrap_data()
@app.on_event("startup")
def startup_sync_scheduler() -> None:
sync_scheduler.start()
@app.on_event("shutdown")
def shutdown_sync_scheduler() -> None:
sync_scheduler.stop()
app.include_router(router, prefix="/api")
return app
app = create_app()