1.4 KiB
1.4 KiB
Development guide
Structure
cmd/driveowns process startup and CLI dispatch.internal/domaincontains dependency-free business rules.internal/applicationcoordinates use cases through interfaces.internal/adaptersimplements PostgreSQL, storage, and external-service ports.internal/transportmaps HTTP contracts to application calls.internal/workersexecutes persistent leased jobs.web/src/featuresowns frontend product features;web/src/sharedcontains reusable primitives.api/openapi.yaml, migrations, and sqlc queries are reviewed source contracts.
Canonical checks
Native:
go test ./cmd/... ./internal/...
npm --prefix web ci
npm --prefix web run check
Containerized:
docker compose run --rm verify
docker compose up --build
Contract workflow
Do not add an API handler before its OpenAPI operation exists. Do not write SQL directly in transport or application code; add a named sqlc query. Generated files are outputs and are never edited by hand. CI regenerates the PostgreSQL repository and rejects drift; the same check applies to the generated API client when it is introduced.
Architectural changes
Create an ADR before changing storage semantics, public API conventions, package boundaries, deployment topology, or approved dependencies. An ADR records context, decision, consequences, and superseded decisions.