Self-hosted knowledge management for SMEs: a split-screen Markdown editor whose sections an LLM refines while you write, and RAG question answering over the documents that result. FastAPI + Postgres/pgvector on the back, SvelteKit on the front, everything OpenAI-compatible and self-hostable. Squashed into a single commit; the development history stays local. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CA43ZJda8Rbp2hKXNy8f6b
20 lines
673 B
Python
20 lines
673 B
Python
"""The templates API: the blueprints a document can be started from.
|
|
|
|
Reading is for everyone (the picker needs it), changing is admin-only, and the
|
|
two live on separate routers so the gate is structural rather than repeated per
|
|
endpoint. `catalog` is what ships with the product, `edit` what the customer
|
|
made of it.
|
|
|
|
**Route order matters.** The catalog's static paths are registered before
|
|
`/{template_id}`, or "catalog" would be parsed as a row id.
|
|
"""
|
|
|
|
from fastapi import APIRouter
|
|
|
|
from app.api.templates import browse, catalog, edit
|
|
|
|
router = APIRouter()
|
|
router.include_router(catalog.router)
|
|
router.include_router(edit.router)
|
|
router.include_router(browse.router)
|