NÜAge Architecture
Built for 2 people, designed for millions
Monolith-first, AI-powered, PWA-ready
3 Pillars of NÜAge
PERSONAL
Biological Age, Food AI, Protocol, Timeline
RANKING
Global Leaderboard, Tiers, Badges, Gamification
COMMUNITY
NÜAge Social, Verified Posts, Protocol Sharing
Architecture Layers
📱 LAYER 1 — CLIENT (PWA)
Progressive Web App — ไม่ต้อง App Store
Mobile PWA
Install to Home Screen
Desktop Web
Same codebase
LINE LIFF (future)
In-app browser
↕
⚙️ LAYER 2 — APPLICATION SERVER
Express.js Monolith — ง่าย เร็ว แก้ไขได้ทันที
NÜAge Engine
Score + Protocol + Timeline
Food AI (Claude API)
Photo → Nutrition
Protocol Generator
Daily health plan
Ranking Computer
Leaderboard + Tiers
Social Feed
Posts + Verification
↕
🧠 LAYER 3 — AI LAYER
Claude API — ไม่ต้องสร้าง ML model เอง
Food Recognition
Photo → Ingredients
Nutrition Analysis
Calories + Macros
Protocol AI
Personalized plan
Bio Age Calculator
Multi-factor scoring
Community Moderation
Auto-verify + filter
↕
🗄️ LAYER 4 — DATA LAYER
MariaDB (Primary)
All transactional data
Redis (Cache — future)
Sessions + Rankings
S3/R2 (Photos — future)
Food photos + Avatars
↕
🌐 LAYER 5 — EXTERNAL APIs (FREE)
Open-Meteo
Weather data
OpenAQ
PM2.5 air quality
Nutritionix
Food database
WHO
Health reference data
↕
🏗️ LAYER 6 — INFRASTRUCTURE
Same stack as nuff-app — deploy.sh, PM2, Cloudflare
NUFServer 151
Ubuntu VPS
Cloudflare Tunnel
Zero-trust access
PM2 Cluster
Process management
Auto Backup
3 locations
🔧 Tech Stack
| Category | Choice | Why |
|---|---|---|
| Frontend | PWA (Vanilla JS) | No build step, instant deploy |
| Backend | Express.js (Node) | Same as nuff-app, proven |
| Database | MariaDB | Already running on server |
| AI | Claude API | Best reasoning, no ML infra needed |
| Auth | LINE Login + JWT | Thai users already have LINE |
| Photos | Cloudflare R2 | Cheap, fast, no egress fees |
| Deploy | deploy.sh + PM2 | Simple, reliable, tested |
| CDN | Cloudflare | Already configured |
🎯 Key Design Decisions
🟢 Monolith > Microservices — 2 คนไม่ต้อง K8s
🟢 Claude API > Custom ML — ไม่ต้อง train model เอง
🟢 PWA > Native App — ไม่ต้อง App Store approval
🟢 LINE Login > Email/Password — คนไทยมี LINE ทุกคน
🟢 Start Thailand > Go Global — ตลาด health-conscious กำลังโต