Backend Stack Selection
Purpose
Choose the backend framework — Express or NestJS — for the API's real requirements, with a justified recommendation. Feeds ../../stack-recommendation (backend area) and the matching foundation skill. Requires user approval before implementation (Gate 2).
When to Use
- At the start of any backend project, or when adding a backend service.
- When re-evaluating an existing backend's framework for a migration.
- Not after the framework is approved and unchanged.
Inputs
- Requirement baseline (
../../requirements-analysis) and selected applications (../../application-selection).
- Existing backend findings (
existing-backend-audit) if any.
- Domain count, team size, async/realtime needs, expected lifespan and growth.
Discovery Questions
- How many distinct domains/modules will the API have, now and in a year?
- How many developers will work on it concurrently?
- Are queues, WebSockets, scheduled jobs, or microservices in scope?
- Is fast initial delivery or long-term structural consistency the priority?
- Does the team already know one framework well?
Responsibilities
- Evaluate Express: small/medium APIs, lightweight architecture, fast delivery, limited module count, freedom to shape structure (paired with
backend-api-architecture so it stays layered).
- Evaluate NestJS: large modular systems, multiple developers, dependency injection, first-class queues/WebSockets/scheduling, many domains, strong conventions that keep teams consistent.
- Recommend one framework with justification and the trade-offs of the other.
- Hand off to
express-foundation or nestjs-foundation.
Required Workflow
- Gather domain count, team size, async/realtime needs, delivery constraints.
- Score both frameworks against those requirements — not against preference.
- Recommend one, with trade-offs and the conditions that would flip the choice.
- Record the recommendation for Gate 2 approval.
- Hand off to the matching foundation skill.
Decision Rules
- No universal default. Evaluate the requirements; either framework can be the right answer.
- Lean Express when: few modules, small team, straightforward CRUD/API surface, speed of delivery dominates, and heavyweight structure would be overhead.
- Lean NestJS when: many domains/modules, multiple developers needing shared conventions, dependency injection aids testability, or queues/WebSockets/scheduling are core (its ecosystem covers them coherently).
- Team familiarity is a legitimate tiebreaker — not a trump card over structural mismatch.
- Express + discipline can serve growing systems; NestJS on a 3-endpoint service is ceremony. Match weight to load.
Rules
- Recommend, don't pre-select; the user approves at Gate 2.
- No dependency installation or scaffolding here.
- Justify against actual requirements; record what would change the answer.
Anti-Patterns
- Defaulting to either framework "because we always use it."
- Choosing NestJS for a tiny API to be "future-proof" with no growth evidence.
- Choosing Express for a many-domain, many-developer system and reinventing DI/module conventions ad hoc.
- Deciding before domain count and team shape are known.
Validation Checklist
Definition of Done
A recorded, justified Express-vs-NestJS recommendation tied to the API's real requirements, with trade-offs noted and approval pending — ready to hand to the matching foundation skill.
Related Skills
../../stack-recommendation, ../../application-selection, express-foundation, nestjs-foundation, existing-backend-audit, backend-api-architecture, queues, realtime-communication.
Related Knowledge
../../../knowledge/ (team constraints, existing services, growth expectations).
Related References
../../../references/backend/ (framework comparison notes, when populated).
Context Loading Guidance
- Requires: requirement baseline, selected apps, domain/team/async summary.
- Does not require: the full backend skill set, app source, unrelated references.
- May load:
existing-backend-audit (existing service), one foundation skill after the decision.
- Stop when: the framework recommendation is recorded for Gate 2.
Token Efficiency Guidance
Decide from the requirements summary. Keep the recommendation to the decisive factors (domains, team, async needs); link references rather than pasting framework docs.
1---2name: backend-stack-selection3description: Use to decide between Express and NestJS (or flag another fit) for a backend API, with justification. Evaluates Express (small/medium APIs, lightweight architecture, fast delivery, limited modules) against NestJS (large modular systems, multiple developers, dependency injection, queues, WebSockets, many domains, strong conventions). No universal default.4---56# Backend Stack Selection78## Purpose910Choose the backend framework — **Express** or **NestJS** — for the API's real requirements, with a justified recommendation. Feeds `../../stack-recommendation` (backend area) and the matching foundation skill. Requires user approval before implementation (Gate 2).1112## When to Use1314- At the start of any backend project, or when adding a backend service.15- When re-evaluating an existing backend's framework for a migration.16- **Not** after the framework is approved and unchanged.1718## Inputs1920- Requirement baseline (`../../requirements-analysis`) and selected applications (`../../application-selection`).21- Existing backend findings (`existing-backend-audit`) if any.22- Domain count, team size, async/realtime needs, expected lifespan and growth.2324## Discovery Questions2526- How many distinct domains/modules will the API have, now and in a year?27- How many developers will work on it concurrently?28- Are queues, WebSockets, scheduled jobs, or microservices in scope?29- Is fast initial delivery or long-term structural consistency the priority?30- Does the team already know one framework well?3132## Responsibilities3334- Evaluate **Express**: small/medium APIs, lightweight architecture, fast delivery, limited module count, freedom to shape structure (paired with `backend-api-architecture` so it stays layered).35- Evaluate **NestJS**: large modular systems, multiple developers, dependency injection, first-class queues/WebSockets/scheduling, many domains, strong conventions that keep teams consistent.36- Recommend one framework with justification and the trade-offs of the other.37- Hand off to `express-foundation` or `nestjs-foundation`.3839## Required Workflow40411. Gather domain count, team size, async/realtime needs, delivery constraints.422. Score both frameworks against those requirements — not against preference.433. Recommend one, with trade-offs and the conditions that would flip the choice.444. Record the recommendation for Gate 2 approval.455. Hand off to the matching foundation skill.4647## Decision Rules4849- **No universal default.** Evaluate the requirements; either framework can be the right answer.50- Lean **Express** when: few modules, small team, straightforward CRUD/API surface, speed of delivery dominates, and heavyweight structure would be overhead.51- Lean **NestJS** when: many domains/modules, multiple developers needing shared conventions, dependency injection aids testability, or queues/WebSockets/scheduling are core (its ecosystem covers them coherently).52- Team familiarity is a legitimate tiebreaker — not a trump card over structural mismatch.53- Express + discipline can serve growing systems; NestJS on a 3-endpoint service is ceremony. Match weight to load.5455## Rules5657- Recommend, don't pre-select; the user approves at Gate 2.58- No dependency installation or scaffolding here.59- Justify against actual requirements; record what would change the answer.6061## Anti-Patterns6263- Defaulting to either framework "because we always use it."64- Choosing NestJS for a tiny API to be "future-proof" with no growth evidence.65- Choosing Express for a many-domain, many-developer system and reinventing DI/module conventions ad hoc.66- Deciding before domain count and team shape are known.6768## Validation Checklist6970- [ ] Domains, team size, async/realtime needs gathered.71- [ ] Express path evaluated (lightweight, fast delivery, limited modules).72- [ ] NestJS path evaluated (modularity, DI, queues, WebSockets, conventions).73- [ ] One framework recommended with justification + trade-offs.74- [ ] No universal default applied.75- [ ] Recorded for Gate 2.7677## Definition of Done7879A recorded, justified Express-vs-NestJS recommendation tied to the API's real requirements, with trade-offs noted and approval pending — ready to hand to the matching foundation skill.8081## Related Skills8283`../../stack-recommendation`, `../../application-selection`, `express-foundation`, `nestjs-foundation`, `existing-backend-audit`, `backend-api-architecture`, `queues`, `realtime-communication`.8485## Related Knowledge8687`../../../knowledge/` (team constraints, existing services, growth expectations).8889## Related References9091`../../../references/backend/` (framework comparison notes, when populated).9293## Context Loading Guidance9495- **Requires:** requirement baseline, selected apps, domain/team/async summary.96- **Does not require:** the full backend skill set, app source, unrelated references.97- **May load:** `existing-backend-audit` (existing service), one foundation skill after the decision.98- **Stop when:** the framework recommendation is recorded for Gate 2.99100## Token Efficiency Guidance101102Decide from the requirements summary. Keep the recommendation to the decisive factors (domains, team, async needs); link references rather than pasting framework docs.