refactor: split main.py into modules (config, database, models, utils, auth, runtime, maintenance)

main.py was ~3000 lines with models, routes, Docker ops, maintenance all mixed.
Split into 7 focused modules:
- config.py: env vars and constants
- database.py: SQLAlchemy engine, SessionLocal, Base, get_db
- models.py: ORM models and enums
- utils.py: logging, formatting, icon handling, misc helpers
- auth.py: password hashing, cookies, CSRF, user dependency
- runtime.py: all Docker operations, pool management, session lifecycle
- maintenance.py: cleanup loop, schema bootstrap, startup logic
- main.py: FastAPI app, middleware, all route handlers only
This commit is contained in:
2026-05-01 09:40:06 +00:00
parent 9bd38ed6db
commit c8c77048c7
9 changed files with 1822 additions and 1700 deletions
+1131
View File
File diff suppressed because it is too large Load Diff