Skip to main content

Architecture styles

The backend uses a modular monolith with a separately deployed frontend. Feature-oriented modules keep domain and application logic close to the use cases they support, while the API remains one release artifact.

Alternatives and rationale​

StyleBenefitCost or riskFit for this project
Layered monolithSimple startup and deploymentFeature responsibilities can spread across broad technical layersFeasible, with discipline needed around feature ownership
Modular monolithOne deployable with feature boundaries and testable use casesBoundaries still need review; a shared process and database couple failures and releasesSelected for the requirements-planning MVP
MicroservicesIndependent scaling and releasesNetwork failures, distributed data, deployment coordination, and higher operating overheadDeferred until a demonstrated need justifies the cost

The selection prioritizes a small operational footprint and inspectable code over independent service deployment. The original decision is ADR-001; its early schedule estimate was later revised in the roadmap.

Module responsibilities​

ResponsibilityImplementation location
Identity, sessions, and verificationAuth and user features
Workspace membership and boundariesWorkspace feature, request context, and scoped repositories
Client and project lifecycleClient and project features
Candidate generation and provider configurationRefinement and AI configuration features
Approved requirements and Markdown outputStory and backlog features
Client-facing reviewPublic access-code route and minimized project response

These are cooperating modules inside one API process, not separate services. Access control is enforced across route policies and workspace-scoped use cases/repositories rather than by a separately deployed authorization service.

Dependency direction​

Arrows describe code dependencies. Runtime calls reach databases and external providers through the wired adapters.

This structure makes domain rules and application orchestration testable without a live provider or production database. It remains a design discipline to review, not proof that every file perfectly respects the intended boundaries.

Trade-offs​

  • One backend release changes all modules together; there is no independent module rollout.
  • A shared PostgreSQL database simplifies transactions but requires careful workspace scoping.
  • Synchronous provider calls keep the workflow simple but expose refinement to provider latency and failures.
  • The deployed single host has neither failover nor autoscaling. Modular code does not provide operational availability.

Evolution strategy​

Optimize measured bottlenecks before adding services. Extraction should be considered only when sustained throughput, fault isolation, independent release cadence, or a real ownership boundary warrants it.

A future service extraction would require an explicit data-ownership and failure-handling decision. No distributed queue, requirements microservice, or export service is committed by the current roadmap.