This directory contains Architecture Decision Records (ADRs) for the StellarSwipe backend. An ADR documents a significant architectural decision, including the context, decision, and consequences.
An ADR is a lightweight decision-making record that:
- Captures the context and reasoning behind architectural decisions
- Is accessible to the team and future contributors
- Serves as documentation of why the system is built a certain way
- Remains relevant long after the decision is made
All ADRs follow the template in 0000-template.md. Use this structure:
- Status — Proposed | Accepted | Deprecated | Superseded
- Context — What problem are we solving?
- Decision — What approach did we choose?
- Consequences — What are the trade-offs?
- References — Related issues, discussions, or external resources
- Number ADRs sequentially:
0001.md,0002.md, etc. - Propose an ADR before or during implementation of significant architectural changes
- Do not document trivial implementation details; focus on decisions that affect system design, maintainability, or performance across multiple teams
An ADR is required when changes affect:
- Data layer: Database schema, ORM patterns, connection pooling strategies
- API layer: GraphQL schema design, REST endpoint versioning, error handling strategies
- External integrations: Stellar Horizon, Soroban RPC, third-party service abstractions
- Security: Authentication, authorization, secrets management, key rotation
- Performance: Caching strategies, N+1 prevention, query optimization, rate limiting
- Observability: Logging, tracing, metrics collection strategies
- Async processing: Job queues, event handlers, message-driven patterns
- System architecture: Module structure, service boundaries, dependency injection patterns
When a PR modifies architecturally-significant paths (see CI configuration below):
- Include an ADR: Create a new ADR or reference an existing one in the PR description
- If bypassing is necessary: Add the
adr-exemptionlabel with justification in the PR description - Review: ADRs are reviewed as part of code review to ensure clarity and correctness
The CI check enforces ADRs for changes to:
src/graphQL-API/
src/stellar/
src/auth/
src/common/error-classification/
src/database/
src/cache/
src/common/middleware/
Run locally to check:
# Check which paths require ADRs in this PR
npm run adr:check
# Create a new ADR
npm run adr:create "My Architecture Decision"- ADR 0001: DataLoader-Based N+1 Query Prevention — Explains why we batch database queries in GraphQL via DataLoaders
- Refer to existing ADRs for style and structure
If an ADR is superseded by a new decision:
- Update the superseded ADR's status to
Superseded by ADR-XXXX - Create a new ADR with status
Accepted - Link both ADRs to each other in the References section
ADRs are discussion artifacts. If clarity is needed during code review, ask in the PR comment thread rather than updating the ADR after merge. Minor clarifications can be updated via subsequent PRs.