This commit is contained in:
Marek Lenczewski
2026-04-07 16:13:16 +02:00
parent 52c4e5f33d
commit 8f15f51bce
32 changed files with 212 additions and 196 deletions

0
backend/base/__init__.py Normal file
View File

36
backend/base/app.py Normal file
View File

@@ -0,0 +1,36 @@
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from api.profile_controller import router as profiles_router
from api.video_controller import router as videos_router
from database.database import SessionLocal, create_tables
from model.profile import Profile
from notify.notify_clients import register_websocket
app = FastAPI()
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_methods=["*"],
allow_headers=["*"],
)
app.include_router(videos_router)
app.include_router(profiles_router)
register_websocket(app)
@app.on_event("startup")
def startup():
create_tables()
db = SessionLocal()
if db.query(Profile).count() == 0:
db.add(Profile(name="Standard"))
db.commit()
db.close()
@app.get("/")
def root():
return {"status": "running"}