|
| 1 | +# Architecture Combination Guide |
| 2 | + |
| 3 | +The core advantage of HaloLight lies in **complete frontend-backend decoupling**, supporting any combination. This document helps you choose the most suitable tech stack combination. |
| 4 | + |
| 5 | +## 🎯 Quick Decision Flowchart |
| 6 | + |
| 7 | +```mermaid |
| 8 | +graph TD |
| 9 | + A[Start Selection] --> B{Team Size?} |
| 10 | + B -->|Small <5| C{SEO Required?} |
| 11 | + B -->|Medium 5-20| D{Tech Preference?} |
| 12 | + B -->|Large >20| E[Angular + Spring Boot] |
| 13 | +
|
| 14 | + C -->|Yes| F[Nuxt + FastAPI] |
| 15 | + C -->|No| G[Vue + FastAPI] |
| 16 | +
|
| 17 | + D -->|Node.js| H[Next.js + NestJS] |
| 18 | + D -->|Python| I[Vue + FastAPI] |
| 19 | + D -->|Java| J[Angular + Spring Boot] |
| 20 | + D -->|Go| K[SvelteKit + Go Fiber] |
| 21 | +``` |
| 22 | + |
| 23 | +## 📊 Combination Evaluation Matrix |
| 24 | + |
| 25 | +Rating mainstream combinations across dimensions (max ⭐⭐⭐⭐⭐): |
| 26 | + |
| 27 | +### Next.js + NestJS |
| 28 | + |
| 29 | +| Dimension | Rating | Description | |
| 30 | +|-----------|--------|-------------| |
| 31 | +| Development Efficiency | ⭐⭐⭐⭐⭐ | TypeScript full-stack unification, type sharing | |
| 32 | +| Performance | ⭐⭐⭐⭐ | SSR + edge caching optimization | |
| 33 | +| Learning Curve | ⭐⭐⭐ | Need to understand React and NestJS architecture | |
| 34 | +| Ecosystem Maturity | ⭐⭐⭐⭐⭐ | npm ecosystem extremely rich | |
| 35 | +| Deployment | ⭐⭐⭐⭐ | Vercel + Railway/Fly.io one-click deploy | |
| 36 | +| **Overall** | **⭐⭐⭐⭐** | First choice for multi-tenant SaaS, enterprise backends | |
| 37 | + |
| 38 | +### Vue + FastAPI |
| 39 | + |
| 40 | +| Dimension | Rating | Description | |
| 41 | +|-----------|--------|-------------| |
| 42 | +| Development Efficiency | ⭐⭐⭐⭐⭐ | Vue smooth learning curve, FastAPI fast dev | |
| 43 | +| Performance | ⭐⭐⭐⭐ | Vue 3 compilation optimized, Python async efficient | |
| 44 | +| Learning Curve | ⭐⭐⭐⭐⭐ | Both relatively easy to pick up | |
| 45 | +| Data Processing | ⭐⭐⭐⭐⭐ | Python data science ecosystem unbeatable | |
| 46 | +| Deployment | ⭐⭐⭐⭐ | Frontend CDN, backend containerized | |
| 47 | +| **Overall** | **⭐⭐⭐⭐⭐** | First choice for data/AI-driven apps | |
| 48 | + |
| 49 | +### Angular + Spring Boot |
| 50 | + |
| 51 | +| Dimension | Rating | Description | |
| 52 | +|-----------|--------|-------------| |
| 53 | +| Development Efficiency | ⭐⭐⭐ | Rigorous architecture, high initial investment | |
| 54 | +| Performance | ⭐⭐⭐⭐ | Enterprise optimization mature | |
| 55 | +| Learning Curve | ⭐⭐ | Both have some complexity | |
| 56 | +| Enterprise Maturity | ⭐⭐⭐⭐⭐ | Large enterprise first choice | |
| 57 | +| Long-term Maintenance | ⭐⭐⭐⭐⭐ | Clear architecture, highly maintainable | |
| 58 | +| **Overall** | **⭐⭐⭐⭐** | Best for large enterprises, long-term projects | |
| 59 | + |
| 60 | +### SvelteKit + Go Fiber |
| 61 | + |
| 62 | +| Dimension | Rating | Description | |
| 63 | +|-----------|--------|-------------| |
| 64 | +| Development Efficiency | ⭐⭐⭐⭐ | Concise code, great dev experience | |
| 65 | +| Performance | ⭐⭐⭐⭐⭐ | Both are performance benchmarks | |
| 66 | +| Learning Curve | ⭐⭐⭐ | Svelte unique syntax, need to learn Go | |
| 67 | +| Resource Usage | ⭐⭐⭐⭐⭐ | Extremely low memory and CPU usage | |
| 68 | +| Deployment | ⭐⭐⭐⭐⭐ | Tiny container images, edge deployment ready | |
| 69 | +| **Overall** | **⭐⭐⭐⭐⭐** | Best for high-performance real-time apps | |
| 70 | + |
| 71 | +## 🎨 Combination Matrix |
| 72 | + |
| 73 | +Below shows all possible frontend-backend combinations. Each cell represents a viable tech stack pairing. |
| 74 | + |
| 75 | +### Frontend Frameworks (Horizontal) × Backend APIs (Vertical) |
| 76 | + |
| 77 | +| Frontend \ Backend | NestJS | Node.js | FastAPI | Spring Boot | Go | PHP | Bun | tRPC BFF | |
| 78 | +|--------------------|--------|---------|---------|-------------|----|----|-----|----------| |
| 79 | +| **Next.js** | ⭐ Best | ✅ | ✅ | ✅ | ✅ | ✅ | ⭐ Best | ⭐ Best | |
| 80 | +| **Nuxt** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ⭐ Best | |
| 81 | +| **Vue** | ✅ | ✅ | ⭐ Best | ✅ | ✅ | ✅ | ✅ | ✅ | |
| 82 | +| **Angular** | ✅ | ✅ | ✅ | ⭐ Best | ⭐ Best | ✅ | ✅ | ✅ | |
| 83 | +| **SvelteKit** | ✅ | ✅ | ✅ | ✅ | ⭐ Best | ✅ | ✅ | ✅ | |
| 84 | +| **Astro** | ✅ | ✅ | ⭐ Best | ✅ | ✅ | ✅ | ✅ | ✅ | |
| 85 | +| **Solid.js** | ✅ | ✅ | ✅ | ✅ | ⭐ Best | ✅ | ⭐ Best | ✅ | |
| 86 | +| **Qwik** | ✅ | ✅ | ✅ | ✅ | ⭐ Best | ✅ | ⭐ Best | ✅ | |
| 87 | +| **Remix** | ⭐ Best | ⭐ Best | ✅ | ✅ | ✅ | ✅ | ⭐ Best | ⭐ Best | |
| 88 | +| **Preact** | ✅ | ✅ | ✅ | ✅ | ⭐ Best | ✅ | ⭐ Best | ✅ | |
| 89 | +| **Lit** | ✅ | ✅ | ✅ | ✅ | ✅ | ⭐ Best | ✅ | ✅ | |
| 90 | + |
| 91 | +**Legend**: |
| 92 | +- ⭐ Best: Significant advantages in specific scenarios |
| 93 | +- ✅ Available: Fully compatible, ready to use |
| 94 | + |
| 95 | +## 💡 Selection Recommendations |
| 96 | + |
| 97 | +### By Team Size |
| 98 | + |
| 99 | +#### Small Teams (< 5 people) |
| 100 | +- **Vue + FastAPI** - Quick to learn, high efficiency |
| 101 | +- **Preact + Bun** - Lightweight, good performance |
| 102 | +- **Astro + Node.js** - Content-focused scenarios |
| 103 | + |
| 104 | +#### Medium Teams (5-20 people) |
| 105 | +- **Next.js + NestJS** - TypeScript unified stack |
| 106 | +- **Vue + Spring Boot** - Balance usability and enterprise features |
| 107 | +- **SvelteKit + FastAPI** - Balance performance and efficiency |
| 108 | + |
| 109 | +#### Large Teams (> 20 people) |
| 110 | +- **Angular + Spring Boot** - Architectural standards, maintainability |
| 111 | +- **Next.js + NestJS + tRPC BFF** - Micro-frontend + BFF architecture |
| 112 | +- **Any Frontend + GraphQL Gateway + Microservices** |
| 113 | + |
| 114 | +### By Tech Stack Preference |
| 115 | + |
| 116 | +#### TypeScript Full-Stack |
| 117 | +- Next.js / Nuxt / Remix + NestJS + tRPC BFF |
| 118 | +- Solid.js / Qwik + Bun + Hono |
| 119 | + |
| 120 | +#### Python Ecosystem |
| 121 | +- Vue / React / Astro + FastAPI |
| 122 | +- SvelteKit + FastAPI |
| 123 | + |
| 124 | +#### Java Ecosystem |
| 125 | +- Angular / Vue + Spring Boot |
| 126 | + |
| 127 | +#### Go Ecosystem |
| 128 | +- SvelteKit / Solid / Qwik + Go Fiber |
| 129 | + |
| 130 | +### By Deployment Environment |
| 131 | + |
| 132 | +#### Serverless / Edge-First |
| 133 | +- Next.js + NestJS (Vercel + Vercel Functions) |
| 134 | +- Nuxt + Bun (Cloudflare Workers) |
| 135 | +- Astro + Deno Deploy |
| 136 | + |
| 137 | +#### Traditional Servers |
| 138 | +- Any Frontend (Nginx static hosting) + Any Backend (PM2/Systemd) |
| 139 | + |
| 140 | +#### Containerized (Kubernetes) |
| 141 | +- Any Combination (Docker images + K8s Deployment) |
| 142 | + |
| 143 | +#### Hybrid Cloud |
| 144 | +- Frontend (CDN) + Backend (Private Cloud) + tRPC BFF (Edge nodes) |
| 145 | + |
| 146 | +## 🔧 Tech Stack Comparison |
| 147 | + |
| 148 | +### Frontend Framework Features |
| 149 | + |
| 150 | +| Feature | Next.js | Vue | Angular | SvelteKit | Solid | Qwik | |
| 151 | +|---------|---------|-----|---------|-----------|-------|------| |
| 152 | +| **Learning Curve** | Medium | Low | High | Low | Medium | Medium | |
| 153 | +| **TypeScript** | ⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐⭐ | |
| 154 | +| **SSR/SSG** | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐⭐⭐ | |
| 155 | +| **Performance** | ⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | |
| 156 | +| **Ecosystem** | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐ | |
| 157 | +| **Bundle Size** | Medium | Small | Large | Minimal | Minimal | Small | |
| 158 | + |
| 159 | +### Backend Tech Features |
| 160 | + |
| 161 | +| Feature | NestJS | FastAPI | Spring Boot | Go Fiber | |
| 162 | +|---------|--------|---------|-------------|----------| |
| 163 | +| **Dev Efficiency** | ⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐⭐ | |
| 164 | +| **Performance** | ⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐⭐⭐ | |
| 165 | +| **TypeScript** | ⭐⭐⭐⭐⭐ | - | - | - | |
| 166 | +| **Enterprise Maturity** | ⭐⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ | |
| 167 | +| **Data Science** | ⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐ | ⭐ | |
| 168 | +| **Resource Usage** | Medium | Small | Large | Minimal | |
| 169 | + |
| 170 | +## 🚀 Quick Setup |
| 171 | + |
| 172 | +After choosing your combination, follow these steps: |
| 173 | + |
| 174 | +### Step 1: Start Frontend |
| 175 | + |
| 176 | +```bash |
| 177 | +# Example with Vue |
| 178 | +git clone https://github.com/halolight/halolight-vue.git |
| 179 | +cd halolight-vue |
| 180 | +pnpm install |
| 181 | +pnpm dev |
| 182 | +``` |
| 183 | + |
| 184 | +### Step 2: Start Backend API |
| 185 | + |
| 186 | +```bash |
| 187 | +# Example with FastAPI |
| 188 | +git clone https://github.com/halolight/halolight-api-python.git |
| 189 | +cd halolight-api-python |
| 190 | +pip install -e ".[dev]" |
| 191 | +uvicorn app.main:app --reload |
| 192 | +``` |
| 193 | + |
| 194 | +### Step 3: Configure Frontend to Connect Backend |
| 195 | + |
| 196 | +```bash |
| 197 | +# Frontend project's .env.local |
| 198 | +VITE_API_URL=http://localhost:8000/api |
| 199 | +VITE_USE_MOCK=false # Disable Mock, use real API |
| 200 | +``` |
| 201 | + |
| 202 | +--- |
| 203 | + |
| 204 | +## 📚 Related Documentation |
| 205 | + |
| 206 | +- [Architecture Overview](/en/development/architecture) - Deep dive into frontend-backend separation design |
| 207 | +- [API Design Specification](/en/development/api-patterns) - Interface contract explanation |
| 208 | +- [Authentication System](/en/development/authentication) - Unified authentication mechanism |
| 209 | +- [Permission Management](/en/development/components#permission-control) - RBAC implementation |
0 commit comments