Onboarding: from zero to endpoint and docs
End-to-end onboarding path: start the project locally, add one endpoint through all layers, and publish matching documentation in the same workflow.
Goal and expected outcome
After this guide you should have:
- running API locally with a successful health call;
- a new endpoint implemented in router, schema, service, and repository layers;
- updated OpenAPI and internal HTML docs for the endpoint;
- a clean local quality gate before opening a PR.
Phase 1. Local setup and first successful call
-
Create environment and install dependencies:
Expected: command ends withmake venv && make installDependencies installed. -
Initialize local config:
Expected:make env-init.env created from env/example(if it already exists, continue with current file). -
Apply migrations:
Expected:make migrateMigrations applied. -
Start API:
Expected: Uvicorn running onmake run127.0.0.1:8000(or your.envhost/port). -
In a second terminal, verify first success:
Expected:curl -i http://127.0.0.1:8000/liveHTTP/1.1 200 OKand JSON status body.
Phase 2. Implement one endpoint across layers
Use this order so changes are reviewable and consistent with project layering.
- Create/update DB structures and migration if needed.
- Add request/response models in
app/schemas/. - Add repository data-access methods in
app/repositories/. - Add service logic and business checks in
app/services/. - Add router handler in
app/api/v1/with validation + response mapping. - Update OpenAPI examples where relevant (
app/openapi/examples/).
For a concrete beginner walkthrough, follow:
Add POST /api/v1/contract.
Phase 3. Document the endpoint and behavior
-
Update internal API hub/resource pages under
docs/internal/api/(resourceindex.htmland operation pages as needed). -
If you add or rename internal pages, update sidebar source
docs/assets/internal-sidebar.js. - Keep docs structure consistent with: internal service docs layout guide.
-
Sync generated fragments and docs artifacts:
make docs-fix
Phase 4. Quality gates and ready-to-review state
-
Run full local gate (mutating docs):
make verify -
Before push, run CI-like gate:
This includes docs drift check and baseline docs accessibility checks.make verify-ci - Confirm changed files include both code and docs for the new endpoint.
Page history
| Date | Change | Author |
|---|---|---|
| Added Page history section (repository baseline). | Ivan Boyarkin |