feat: projekte und suche im backend
Projekte pro Benutzer mit Name und Farbe, Clips optional einem Projekt zugeordnet. Löschen eines Projekts verschiebt seine Clips nach "ohne Projekt". Clip-Liste filtert nach Projekt und sucht Teiltexte in Titel und Inhalt, unabhängig von Groß-/Kleinschreibung (auch Umlaute). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
848cff35b3
commit
ff2860f7be
13 files changed
+711
-9
No files matched your search
+10
-1
@@ -9,7 +9,7 @@ from fastapi.concurrency import run_in_threadpool
|
||||
from fastapi.responses import FileResponse, JSONResponse
|
||||
|
||||
from app import __version__
|
||||
from app.api import admin, auth, clips, health, ws
|
||||
from app.api import admin, auth, clips, health, projects, ws
|
||||
from app.config import get_settings
|
||||
from app.db import _session_factory
|
||||
from app.middleware import (
|
||||
@@ -18,6 +18,7 @@ from app.middleware import (
|
||||
SecurityHeadersMiddleware,
|
||||
)
|
||||
from app.services.auth import delete_old_login_attempts
|
||||
from app.services.projects import ProjectNotFound
|
||||
from app.services.sessions import delete_expired_sessions
|
||||
from app.services.users import UserError, bootstrap_initial_admin
|
||||
|
||||
@@ -129,12 +130,20 @@ def create_app() -> FastAPI:
|
||||
app.include_router(auth.router, prefix="/api")
|
||||
app.include_router(admin.router, prefix="/api")
|
||||
app.include_router(clips.router, prefix="/api")
|
||||
app.include_router(projects.router, prefix="/api")
|
||||
app.include_router(ws.router, prefix="/api")
|
||||
|
||||
@app.exception_handler(UserError)
|
||||
def user_error_handler(_request: Request, exc: UserError) -> JSONResponse:
|
||||
return JSONResponse({"detail": str(exc)}, status_code=status.HTTP_400_BAD_REQUEST)
|
||||
|
||||
@app.exception_handler(ProjectNotFound)
|
||||
def project_not_found_handler(_request: Request, _exc: ProjectNotFound) -> JSONResponse:
|
||||
# Same answer for foreign and missing projects, so ids of other users are not revealed
|
||||
return JSONResponse(
|
||||
{"detail": "Projekt nicht gefunden."}, status_code=status.HTTP_404_NOT_FOUND
|
||||
)
|
||||
|
||||
_register_frontend(app, settings.static_dir)
|
||||
return app
|
||||
|
||||
|
||||
Reference in new issue
Block a user