|
| 1 | +# Why This Tech Stack? |
| 2 | + |
| 3 | +[English](./WHY.md) | [한국어](./WHY.ko.md) |
| 4 | + |
| 5 | +This document explains the reasoning behind each technology choice in this fullstack starter template. |
| 6 | + |
| 7 | +## Frontend |
| 8 | + |
| 9 | +### Next.js 16 + React 19 |
| 10 | + |
| 11 | +- **Server Components**: Reduces client-side JavaScript bundle, improves initial load time |
| 12 | +- **App Router**: File-based routing with layouts, loading states, and error boundaries built-in |
| 13 | +- **Turbopack**: Faster dev server and builds compared to Webpack |
| 14 | +- **React 19**: Improved performance with concurrent features, Actions, and `use()` hook |
| 15 | + |
| 16 | +### TailwindCSS v4 |
| 17 | + |
| 18 | +- **Zero runtime**: All styles compiled at build time |
| 19 | +- **Lightning CSS**: 100x faster than PostCSS-based v3 |
| 20 | +- **CSS-first config**: Native CSS syntax instead of JavaScript config |
| 21 | +- **Smaller bundles**: Automatic unused style removal |
| 22 | + |
| 23 | +### shadcn/ui |
| 24 | + |
| 25 | +- **Copy-paste components**: No npm dependency, full ownership of code |
| 26 | +- **Radix primitives**: Accessible by default (ARIA, keyboard navigation) |
| 27 | +- **Tailwind-native**: Consistent with project styling approach |
| 28 | +- **Customizable**: Easy to modify without fighting a design system |
| 29 | + |
| 30 | +### TanStack Query |
| 31 | + |
| 32 | +- **Automatic caching**: Deduplication, background refetching, stale-while-revalidate |
| 33 | +- **DevTools**: Built-in query inspector for debugging |
| 34 | +- **Framework agnostic**: Same mental model works in React Native if needed |
| 35 | +- **Optimistic updates**: First-class support for responsive UIs |
| 36 | + |
| 37 | +### Jotai |
| 38 | + |
| 39 | +- **Atomic state**: No boilerplate, just atoms and derived atoms |
| 40 | +- **TypeScript-first**: Excellent type inference |
| 41 | +- **Lightweight**: ~3KB, no providers required for basic usage |
| 42 | +- **Suspense-ready**: Works seamlessly with React concurrent features |
| 43 | + |
| 44 | +## Backend |
| 45 | + |
| 46 | +### FastAPI |
| 47 | + |
| 48 | +- **AI/ML ecosystem**: Direct access to Python's AI libraries (LangChain, Transformers, etc.) |
| 49 | +- **Async-first**: Built on Starlette with native async/await support |
| 50 | +- **Auto-generated docs**: OpenAPI (Swagger) and ReDoc out of the box |
| 51 | +- **Pydantic validation**: Request/response validation with type hints |
| 52 | +- **Scalability**: Easy horizontal scaling with stateless design |
| 53 | + |
| 54 | +### SQLAlchemy (async) |
| 55 | + |
| 56 | +- **ORM flexibility**: Can write raw SQL when needed, ORM when convenient |
| 57 | +- **Async support**: Native asyncio with asyncpg driver |
| 58 | +- **Migration-friendly**: Alembic integration for schema versioning |
| 59 | +- **Mature ecosystem**: Battle-tested in production for decades |
| 60 | + |
| 61 | +### PostgreSQL 16 |
| 62 | + |
| 63 | +- **ACID compliance**: Data integrity guaranteed |
| 64 | +- **JSON support**: JSONB for flexible semi-structured data |
| 65 | +- **Vector extension**: pgvector for AI embeddings and similarity search |
| 66 | +- **Performance**: Advanced query planner, parallel queries, partitioning |
| 67 | +- **Extensions**: PostGIS, full-text search built-in |
| 68 | + |
| 69 | +### Redis 7 |
| 70 | + |
| 71 | +- **Sub-millisecond latency**: In-memory data structure store |
| 72 | +- **Versatile**: Cache, session store, pub/sub, rate limiting |
| 73 | +- **Persistence options**: RDB snapshots or AOF for durability |
| 74 | +- **Cluster support**: Horizontal scaling when needed |
| 75 | + |
| 76 | +## Mobile |
| 77 | + |
| 78 | +### Flutter 3.38 |
| 79 | + |
| 80 | +- **Korea eGovFrame v5**: Selected as the official mobile framework by Korea e-Government Standard Framework |
| 81 | +- **Flexible versioning**: Easy to pin and upgrade Flutter/Dart versions per project |
| 82 | +- **Hot reload**: Sub-second UI iteration during development |
| 83 | +- **Native performance**: Compiled to ARM, no JavaScript bridge |
| 84 | + |
| 85 | +### Riverpod 3 |
| 86 | + |
| 87 | +- **Compile-safe**: Dependencies checked at compile time |
| 88 | +- **Testable**: Easy to mock and test in isolation |
| 89 | +- **No context required**: Access state from anywhere without BuildContext |
| 90 | +- **Code generation**: Reduces boilerplate with riverpod_generator |
| 91 | + |
| 92 | +### go_router 17 |
| 93 | + |
| 94 | +- **Declarative routing**: URL-based navigation like web |
| 95 | +- **Deep linking**: Works out of the box for iOS/Android |
| 96 | +- **Type-safe**: Code-generated route parameters |
| 97 | +- **Nested navigation**: Shell routes for bottom nav, tabs |
| 98 | + |
| 99 | +### Forui |
| 100 | + |
| 101 | +- **shadcn/ui for Flutter**: Consistent design language with web (shadcn/ui) |
| 102 | +- **Customizable**: Themeable components with Tailwind-like token system |
| 103 | +- **Accessible**: ARIA-equivalent semantics for mobile |
| 104 | +- **Lightweight**: No heavy dependencies, just widgets |
| 105 | + |
| 106 | +### Firebase Crashlytics |
| 107 | + |
| 108 | +- **Real-time crash reporting**: Immediate visibility into production issues |
| 109 | +- **Breadcrumbs**: User actions leading to crash |
| 110 | +- **Stack deobfuscation**: Readable stack traces for Flutter |
| 111 | +- **Free tier**: Generous limits for most apps |
| 112 | + |
| 113 | +### Fastlane |
| 114 | + |
| 115 | +- **Automated releases**: One command to build, sign, and deploy |
| 116 | +- **Cross-platform**: iOS and Android with same workflow |
| 117 | +- **CI integration**: Works seamlessly with GitHub Actions |
| 118 | +- **Metadata management**: Screenshots, descriptions, changelogs |
| 119 | + |
| 120 | +## Infrastructure |
| 121 | + |
| 122 | +### Terraform |
| 123 | + |
| 124 | +- **Infrastructure as Code**: Version-controlled, reviewable infra changes |
| 125 | +- **Declarative**: Describe desired state, let Terraform handle the rest |
| 126 | +- **State management**: Track what's deployed, plan before apply |
| 127 | +- **Modules**: Reusable, shareable infrastructure components |
| 128 | + |
| 129 | +### GCP (Cloud Run, Cloud SQL, Cloud Storage) |
| 130 | + |
| 131 | +- **Generous free tier**: $300 credit for new accounts, always-free tier for many services |
| 132 | +- **Serverless containers**: No server management, scales to zero |
| 133 | +- **Pay-per-use**: Only charged when handling requests |
| 134 | +- **Managed database**: Automated backups, HA, maintenance |
| 135 | +- **Global CDN**: Cloud CDN for static assets and API caching |
| 136 | + |
| 137 | +### GitHub Actions + Workload Identity Federation |
| 138 | + |
| 139 | +- **Keyless deployment**: No service account keys to manage or rotate |
| 140 | +- **Native GitHub integration**: Triggered on push, PR, scheduled |
| 141 | +- **Matrix builds**: Parallel testing across versions/platforms |
| 142 | +- **Marketplace**: Thousands of community actions |
| 143 | + |
| 144 | +## Developer Experience |
| 145 | + |
| 146 | +### Rust-based Toolchain |
| 147 | + |
| 148 | +We prioritize **speed** across the entire development workflow by choosing Rust-based tools: |
| 149 | + |
| 150 | +- **Biome**: Linter + formatter in one tool, 100x faster than ESLint + Prettier |
| 151 | +- **uv**: Python package manager, 10-100x faster than pip/poetry |
| 152 | +- **Turbopack**: Next.js bundler, faster than Webpack |
| 153 | +- **Lightning CSS**: TailwindCSS v4 compiler, 100x faster than PostCSS |
| 154 | + |
| 155 | +### mise |
| 156 | + |
| 157 | +- **Polyglot monorepo support**: Node, Python, Flutter, Terraform — different ecosystems, one tool |
| 158 | +- **Project-local versions**: `.mise.toml` ensures team consistency across all runtimes |
| 159 | +- **Task runner**: Replace Makefile, npm scripts, shell scripts with unified `mise` commands |
| 160 | +- **Written in Rust**: Instant tool switching, no startup overhead |
| 161 | + |
| 162 | +### Polyglot Monorepo |
| 163 | + |
| 164 | +- **Single repository**: Web (TypeScript), API (Python), Mobile (Dart), Infra (HCL) in one place |
| 165 | +- **Bounded contexts**: Each language ecosystem is scoped to its directory, preventing cross-contamination |
| 166 | +- **Atomic changes**: Frontend + backend changes in single PR |
| 167 | +- **Unified tooling**: Same `mise` commands across all apps |
| 168 | + |
| 169 | +## Trade-offs |
| 170 | + |
| 171 | +| Choice | Trade-off | Why We Accept It | |
| 172 | +|--------|-----------|------------------| |
| 173 | +| Next.js over Remix/SvelteKit | Larger bundle, more complexity | Ecosystem, React 19 compatibility | |
| 174 | +| FastAPI over Node.js | Two runtimes (Node + Python) | Python AI/ML ecosystem, scalability | |
| 175 | +| Flutter over React Native | Larger app size, custom rendering | Korea eGovFrame v5, flexible versioning | |
| 176 | + |
| 177 | +## Summary |
| 178 | + |
| 179 | +This stack optimizes for: |
| 180 | + |
| 181 | +1. **Developer velocity**: Hot reload, type safety, auto-generated clients |
| 182 | +2. **Production readiness**: Managed services, serverless scaling, CI/CD |
| 183 | +3. **Team scalability**: Clear boundaries, shared tooling, documentation |
| 184 | +4. **Long-term maintainability**: Proven technologies, active communities |
0 commit comments