Fullstack Architecture Selection (Fullstack Architecture)
Applicable Scenarios
- New project technology stack selection
- Full-stack framework comparison
- Monorepo vs multi-repo decision
- Project initialization template
Core Principles
1. 选熟悉的 > 选最新的
2. 选生态大的 > 选性能最高的
3. 全栈框架 > 自己拼装
4. TypeScript 端到端 > 多语言
5. 部署简单 > 架构复杂
Full-stack Framework Quick Reference
| Framework |
Language |
Frontend |
Backend |
DB |
Deployment |
Suitable for |
| Next.js 15 |
TS |
React |
Server Actions / API Routes |
Prisma |
Vercel |
SaaS / Content |
| T3 Stack |
TS |
Next.js |
tRPC |
Prisma |
Vercel |
Ultimate type safety |
| Nuxt 3 |
TS |
Vue 3 |
Nitro |
Prisma / Drizzle |
Vercel / CF |
Domestic / Small and medium-sized |
| SvelteKit |
TS |
Svelte |
Endpoints |
Prisma |
Vercel / CF |
Performance |
| Remix |
TS |
React |
Loaders / Actions |
Prisma |
Fly.io |
Form-intensive |
| Rails 8 |
Ruby |
Hotwire |
Rails |
ActiveRecord |
Render / Fly |
Rapid MVP |
| Laravel 11 |
PHP |
Livewire / Inertia |
Laravel |
Eloquent |
Forge / Vapor |
PHP |
| Django |
Python |
HTMX / React |
Django |
Django ORM |
Railway |
AI / Data |
Selection Decision Tree
TypeScript 团队?
YES → 类型安全重要?
极致 → T3 Stack
一般 → Next.js / Nuxt
NO → Ruby → Rails / Python → Django / PHP → Laravel
SEO 重要?
YES → Next.js / Nuxt / SvelteKit(SSR)
NO → 任意
交付时间 < 1 周?
YES → Rails / Laravel / Django(约定多、脚手架快)
NO → Next.js / Nuxt / T3
团队 > 5 人?
YES → 考虑拆分 backend + frontend
NO → 全栈框架 OK
Monorepo vs Multi-repo
Monorepo(推荐小团队):
✅ 类型共享方便
✅ 一次 PR 改前后端
✅ 统一 CI
工具:pnpm workspaces + Turborepo
分仓(大团队):
✅ 独立部署
✅ 独立版本
✅ 团队边界清晰
工具:独立 repo + OpenAPI 契约
Project Initialization Template
Next.js + Prisma + Tailwind
npx create-next-app@latest my-app --typescript --tailwind --eslint --app --src-dir
cd my-app
pnpm add prisma @prisma/client
pnpm add -D @types/node
npx prisma init
T3 Stack
pnpm create t3-app@latest my-app
# 选:TypeScript + tRPC + Prisma + Tailwind + NextAuth
Nuxt 3
npx nuxi@latest init my-app
cd my-app
pnpm add @prisma/client
pnpm add -D prisma
Supporting Templates
templates/architecture-decision.md — Selection decision record + comparison table + rationale
Quality Self-Check
□ 选型有明确理由(不是"最火")
□ 团队熟悉度评估
□ 生态评估(Stars / 维护 / 文档)
□ 部署方案确定
□ TypeScript 端到端
□ 项目初始化完成
□ 基础配置(Lint / Format / Git hooks)
□ 第一天就部署
Common Pitfalls
- Assembling it yourself——Wasting time on glue code
- Choosing an unfamiliar framework——Learning cost > benefit
- Not using TypeScript——Integration hell
- Not using an ORM——Handwritten SQL is prone to injection
- Premature microservices——A one-person team doesn't need them
- Not evaluating deployment——You chose a framework that can't be deployed
Collaboration with Other Skills
下游:
e2e-feature-delivery → 用选定的栈实现
database-schema-impl → ORM 选型
deploy-preview → 部署平台