NestJS vs FastAPI — when to pick which
| Factor | NestJS + Next.js | FastAPI + Next.js | |---|---|---| | Team skills | TypeScript full-stack | Python ML/data teams | | API style | Decorators, modules, DI | Async-first, Pydantic native | | OpenAPI | Generated via Nest swagger | Native FastAPI OpenAPI | | Enterprise buyers | Common in EU/US B2B | Common in AI/ML SaaS | | Archiet genome source | Identical blueprint | Identical blueprint |
What both stacks include
- JWT auth in httpOnly cookies (not localStorage)
- Multi-tenant
workspace_id/organization_idfilters on data access - CRUD + search endpoints per entity in PRD
- Next.js frontend with shadcn — auth, settings, onboarding, forgot-password
docker-compose.yml(API + Postgres + Redis when needed)openapi.yamlat repo root- ADRs documenting ORM, auth, and deployment choices
Side-by-side output shape
| Artifact | NestJS ZIP | FastAPI ZIP |
|---|---|---|
| Entry | src/main.ts | app/main.py |
| Models | TypeORM / Prisma entities | SQLAlchemy models |
| Migrations | Stack-native | Alembic revisions |
| Tests | Jest e2e scaffolds | pytest + httpx |
| Frontend | frontend/ Next.js | frontend/ Next.js (same manifest) |
CTA
One PRD. NestJS or FastAPI — your call. archiet.com/stacks/nestjs · archiet.com/stacks/fastapi · Register free
FAQ
Can I generate both and diff them?
Yes. Same blueprint, two generation jobs — useful for stack selection workshops.
Does NestJS output include guards and pipes?
Yes — auth guards, validation pipes, and module boundaries per entity domain.
FastAPI async — is sync code mixed in?
Templates follow async route handlers where the stack emitter targets async I/O patterns.