- Reorganize project into monorepo structure - backend/app/ - New FastAPI backend (modular with src/) - backend/legacy/ - Legacy database modules (relational & vector) - frontend/ - React text editor application - Add launcher.py for easy full-stack startup - Complete documentation in README.md - Quick start guide - API endpoints reference - Development setup - Troubleshooting - Refactor main.py to 35 lines (app configuration only) - Update .gitignore for full-stack project - Add CHANGELOG.md with version history (v0.1.0-v0.1.1) Structure is now clean and ready for team collaboration.
36 lines
815 B
Python
36 lines
815 B
Python
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
from src.config import ALLOWED_ORIGINS
|
|
from src.database import init_db
|
|
from src.routers import init, login, status
|
|
|
|
app = FastAPI(
|
|
title="Archivium Local Backend",
|
|
description="Local archive encryption and authentication system",
|
|
version="0.1.0",
|
|
)
|
|
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=ALLOWED_ORIGINS,
|
|
allow_credentials=True,
|
|
allow_methods=["POST", "GET"],
|
|
allow_headers=["Content-Type"],
|
|
)
|
|
|
|
app.include_router(init.router)
|
|
app.include_router(login.router)
|
|
app.include_router(status.router)
|
|
|
|
|
|
@app.on_event("startup")
|
|
def startup():
|
|
"""Initialize database on startup."""
|
|
init_db()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
import uvicorn
|
|
uvicorn.run(app, host="127.0.0.1", port=8000)
|