- move templates into src/templates; renumber wiki pages; add app-components page - embed agentic build prompt as a copyable markdown block; add mermaid diagrams - build.py writes <name>/mcp; config static bundle -> standards/mcp - registry reads libraries.json as bytes (committed file was UTF-16LE); normalize to UTF-8 - Dockerfile: drop stale blog copy; per-repo <name>/mcp copies - drop nested standards/mcp/standards duplicate and empty root mcp/
2.3 KiB
2.3 KiB
Application Template
A minimal, runnable skeleton of the standardized architecture. It demonstrates
both axes of the blueprint (see standards):
- Resource axis — items and jobs, each a Claude-style generic CRUD slice
(model → document → repo → service → route), all driven from
openapi.yaml. - Pipeline axis — a background
worker.pythat polls pending jobs and runspipelines/item_sync.py, a deterministic async step chain.
Everything here is deliberately small so an agent can rewrite each file rather than delete unused code. The domain is a neutral "item", not an app noun.
Instantiate a new app
cp -r src/templates/app apps/<your-app>
cd apps/<your-app>
pyproject.toml— rename the package; keep the internal library pins.config.py— replace/add settings consumed by your domain.openapi.yaml— replace theItem/Jobresources with your resources.domain/— renameitemandjobslices to your aggregates.pipelines/item_sync.py— replace the demo steps with your pipeline.tests/— keep the two test files as the pattern for your own.
Run the API:
pip install -e ".[dev]"
uvicorn main:app --reload
Run the worker:
python worker.py
What to keep, what to replace
| Keep | Replace / rename |
|---|---|
config.py shape |
Settings fields |
init.py wiring pattern |
Resource names |
| openapi-first routing | Paths, schemas, operationIds |
| mongo-ops repo factory | Collections, doc models |
| generic CRUD adaptor | Nothing (reuse as-is) |
| worker poll + status loop | Job payloads, pipeline steps |
Where the internal libraries slot in
openapi_first.app.OpenAPIFirstApp— main.py, interfaces/openapi.pymongo_ops— infra/db/setup.py, infra/db/repos/mongo.py, domain/*/ports/db.pyhexa.build— domain/*/ports/service.pydagpipe— pipelines/ (wrap step chains in a DAG once they branch)
Confirm current endpoints and ownership with the standards registry MCP tool:
find_library("pipeline"), find_library("auth"), etc.