Files
ds-chat/backend/app/main.py
T
ksmithandClaude Sonnet 5 c79e96dd48 Phase 2: private rooms, room roles, and invites (backend only)
Adds room_invites table + migration, owner/admin/member role enforcement
(require_room_role), and endpoints for private room creation, room
management (update/delete/leave/transfer-ownership/change-role/remove-member),
and the invite lifecycle (create/list/accept/decline/revoke). Registration
stays invite-only via the CLI from Phase 1 — this is a separate, room-level
invite system for adding existing users to private rooms.

Frontend is untouched: the UI redesign is happening separately, so this phase
is backend + tests only (35 passing). Verified no regressions in the Phase 1
open-room/WebSocket flow via manual smoke test.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-13 20:22:15 -06:00

33 lines
849 B
Python

from fastapi import FastAPI
from starlette.middleware.sessions import SessionMiddleware
from app.config import settings
from app.routers import auth, health, invites, rooms
from app.ws.chat import router as ws_router
from app.ws.connection_manager import ConnectionManager
def create_app() -> FastAPI:
app = FastAPI(title="KeepItTalking")
app.add_middleware(
SessionMiddleware,
secret_key=settings.session_secret,
same_site="lax",
https_only=settings.session_https_only,
max_age=settings.session_max_age_seconds,
)
app.state.connection_manager = ConnectionManager()
app.include_router(health.router)
app.include_router(auth.router)
app.include_router(rooms.router)
app.include_router(invites.router)
app.include_router(ws_router)
return app
app = create_app()