| Backend foundation | AI collaboration harness |
|---|---|
| Domain logic shared by HTTP APIs, background tasks, and an admin UI. Optional AI and infrastructure adapters let you start locally and add services as needed. | Repository rules, task-specific skills, hooks, and review procedures guide changes to that backend across Claude Code, Codex, and Antigravity. |
| Run it locally · See the architecture | Follow an API change · Read the shared workflow |
Why this blueprint
Use it when you need multiple business domains, API + worker + admin surfaces, or a shared development workflow for teammates using AI coding tools. The backend and harness are designed together: the harness references this repo's layering, contracts, and verification commands.
Budget time to learn the domain layout, dependency-injector containers, and plan/review workflow. A small single-purpose API may not need that structure; a project needing a bundled customer frontend needs a different starting point. The harness is repository-specific, not a standalone drop-in package.
You can develop without AI tools using the manual domain tutorial. For incremental adoption and trade-offs, see the adoption guide and selection guide.
Quickstart
Prerequisites: Python >=3.12.9, uv, Git, and
make. The demos also use curl and python3 on your PATH.
No Docker, PostgreSQL, cloud credentials, or AI coding tool required.
Terminal 1 — start the backend:
bashgit clone https://github.com/Mr-DooSun/fastapi-agent-blueprint.git cd fastapi-agent-blueprint make quickstart
This installs the quickstart dependencies, creates a SQLite database, and keeps
the server running on port 8001. Use a fresh checkout for evaluation:
quickstart syncs the admin extra and can remove other installed extras.
For development dependencies and commit hooks, use make setup when moving to
the development setup.
Terminal 2 — from the same repository directory:
bashmake demo # JWT auth, admin-realm login, user CRUD, refresh and logout make demo-rag # document upload, retrieval and an answer with citations
Keep terminal 1 running. Both demos check their API responses and report failure if a request does not succeed. The default RAG demo uses a keyword-based stub embedder and a templated stub answer agent; it demonstrates the pipeline without calling an external model.
- API docs — browse the API or download its OpenAPI spec.
- Admin UI — evaluation bootstrap login:
admin/admin. - Quickstart details · Full integration walkthrough.
These defaults are for local evaluation. Follow the development and deployment guides before using real data or exposing the service.

Backend foundation
| Capability | What it provides |
|---|---|
| Domain structure | Router → Service → Repository, with an optional UseCase for orchestration; automatic domain registration and reusable CRUD base classes. |
| API, worker, admin | FastAPI endpoints, Taskiq background tasks, and NiceGUI admin pages consuming domain services. |
| Optional infrastructure | SQL databases, DynamoDB, object storage, vector storage, and AI providers behind adapters and configuration. Start with SQLite + InMemory. |
| Operations | JWT/RBAC, structured logging, opt-in OpenTelemetry, AI usage accounting, and error notifications. |
Worked example: document QA
The docs domain composes document upload, chunking, embedding, retrieval, and
answers with citations. Its shared RAG pipeline can be reused by other domains
(ADR 040).
For real model calls, install the pydantic-ai extra, configure
EMBEDDING_PROVIDER + EMBEDDING_MODEL and LLM_PROVIDER + LLM_MODEL, and
supply the selected providers' credentials. See the
configuration reference for optional extras and settings;
the RAG walkthrough shows the flow.
HTTP, worker, and admin interfaces are implemented. The MCP server interface is planned, not part of the runnable backend today.
AI collaboration harness
The harness helps contributors work within the same backend conventions:
| Capability | What it provides |
|---|---|
| Shared rules | AGENTS.md and shared references define architecture, contracts, security constraints, and the development workflow. |
| Task-specific skills | Guides for domains, APIs, worker tasks, admin pages, migrations, testing, review, and documentation sync. |
| Workflow boundaries | Planning and execution are separate steps. Scope changes, missing verification, and completion checks have explicit handling. |
| Checks and review | Commit/CI checks inspect deterministic rules; reviews assess behavior, architectural fit, and documentation drift. |
Worked example: add an API to an existing domain
For a request such as “add a filtered list endpoint to the order domain,” the workflow is:
| Step | Contributor and agent actions |
|---|---|
| Frame and plan | Clarify the contract and affected layers with /plan-feature (Claude) or $plan-feature (Codex). Review the resulting execution packet. |
| Start execution | The contributor explicitly invokes /execute-plan or $execute-plan with that packet. The executor routes API implementation through the add-api skill. |
| Implement and verify | Reuse the existing layer patterns, add relevant tests, and run the packet's verification commands. Surface unplanned capability gaps before expanding the work. |
| Review and sync | Review the diff; reconcile affected documentation with sync-guidelines when needed. Record verification and any unresolved items before PR completion. |
This is an illustrative workflow, not a command that runs every step automatically. Human decisions remain part of the process.
What is enforced? Configured pre-commit/CI checks block detected violations such as prohibited imports, broken documentation links, or shared-file language policy failures. Workflow reminders are advisory in many cases. For example, the plan-to-execution gate blocks matching source edits in Claude, while Codex receives a Stop-time advisory. Tool adapters share policy but do not provide identical enforcement. See the operating model for current coverage and exceptions.
Domain scaffolding is another supported task:

Set up Claude Code or Codex · Antigravity harness · Shared rules · Manual development path
Architecture at a glance
Every domain separates Interface, Domain, Infrastructure, and optional Application code. Runtime CRUD follows Router → Service → Repository; dependency arrows below describe imports, not request execution order.
Request schemas can pass directly to services when fields match. Model-to-DTO conversion belongs in repositories. Detailed write/read flows and storage variants are in the architecture guide (SVG versions).
Learn more
Roadmap
See the full roadmap and issue tracker.
Contributing
See CONTRIBUTING.md for setup and the PR workflow. The examples and good first issues are entry points for new contributors.
License
MIT — free for commercial use, modification, and distribution.




