A Docs-as-Code AI writing workspace with a React/Tiptap frontend and a FastAPI backend fully migrated onto the fastapi-fullstack / full-stack-ai-agent-template structure.
Current repository structure:
frontend: active React + Tiptap workspacedesktop: planned Electron shellbackend: active Python backend generated from the template and adapted to this productnginx/docker-compose*.yml/Makefile: template-aligned operational assets
The current product surface implements:
- three-panel writing workspace
- right-side AI chat panel with enter-to-send, multi-turn history, and streaming assistant output
- selection-aware AI rewrite flow with status streaming, diff preview, and accept/reject
- mock document store with multiple Markdown drafts
- manual version snapshots, history diff, and restore
- Markdown export preview from the current editor state
- FastAPI rewrite backend at
/api/v1/ai/rewrite/* - workspace-aware agent chat over
/api/v1/ws/agentwithRead,Write,Glob,Grep, andWebSearchtools
The next active product track continues hardening the right sidebar agentic chat surface with:
- enter-to-send chat input
- multi-turn conversation state
- streaming assistant message updates
- no-selection task execution over the current workspace
- agent tools such as
Read,Write,Glob,Grep, andWebSearch
npm install
npm run devCreate a local .env first:
cp .env.example .envnpm run dev runs the frontend only.
Required environment variables:
OPENAI_API_KEYOPENAI_MODEL(default:gpt-4o-mini)OPENAI_BASE_URL(default:https://api.openai.com/v1)
Optional local backend variables:
POSTGRES_HOST,POSTGRES_PORT,POSTGRES_USER,POSTGRES_PASSWORD,POSTGRES_DBSECRET_KEYCORS_ORIGINSLOG_LEVEL,LOG_DIR,LOG_MAX_BYTES,LOG_BACKUP_COUNT
For a clean machine, bring the project up in this order:
- Install Node.js,
uv, and Docker. - Install dependencies with
npm installandmake install. - Create a local env file with
cp .env.example .env. - Set
OPENAI_API_KEY,OPENAI_MODEL, andOPENAI_BASE_URLin.env. - Start PostgreSQL with
make docker-db. - Run migrations with
make db-upgrade. - Start the app with
make run.
Important local database notes:
- The project Docker PostgreSQL is exposed on host port
5433, not5432. .env.exampleis aligned to5433for localmake run.- If you already run PostgreSQL directly on your machine, either keep this project's Docker DB on
5433or change.envto point at your existing instance. backend/.env.exampleremains5432because the backend container talks to thedbcontainer over the internal Docker network.
Recommended smoke checks after startup:
make db-current- Open
http://localhost:5173 - Send one message in the right-side AI Chat
- If something fails, inspect
logs/latest/app.logandlogs/latest/error.log
npm run buildmake install
make runUseful commands:
npm run devmake run-backendmake testmake routesuv run --project backend docgent_backend --version
Backend logs are written to logs/ at the repository root by default. Each backend start creates a fresh logs/runs/<timestamp-pid>/ directory with app.log and error.log, and logs/latest points to the newest run so the current session can be inspected directly from the workspace.
- Chinese README: docs/README_CN.md
- Docs hub: docs/product-specs/index.md
- Design docs: docs/design-docs/index.md
- Active execution plans: docs/PLANS.md