User Flow Diagram
Complete system flow from user request through edge security, application processing, backend services, and external integrations. Click any node for details.
User / Client
Cloudflare Edge
Application Server
API Routes
Notifications
Appwrite Backend
Caching
External Services
Cron Jobs
RBAC / Permissions
Planned (Future)
☁️
Internet / Edge Layer
User Browser
React 18 + SSR
HTTPS Request
Cloudflare DNS
Proxy / Nameservers
Cloudflare WAF
DDoS + Bot Management
Clean traffic
Cloudflare SSL/TLS
Full Strict mode
Cloudflare CDN
Static asset caching
Cache HIT → Serve to User
Cache MISS → Origin ↓
Cache MISS → Origin
🖥️
Application Server (Node.js)
Next.js 14 App Router
SSR + CSR
middleware.ts
Auth + Routing Guards
Authenticated

Hono API Router
35+ REST endpoints
Middleware Pipeline
Traffic Metering MW
Batched request counting
Session Middleware
Appwrite session validation
Identity Lifecycle Engine
15+ user states
Real-time WebSocket
Socket.IO Server
/api/socket path
⇄User rooms: user:{userId}⇄
User Browser
React 18 + SSR
Lifecycle → Route Modules
📡
API Route Modules
Auth API
/api/auth
Workspace API
/api/workspaces
Project API
/api/projects
Task API
/api/tasks
Sprint API
/api/sprints + /api/work-items
Billing API
/api/billing + /api/webhooks
Wallet API
/api/wallet
Notification API
/api/notifications
Organization API
/api/organizations
GitHub API
/api/github
Other APIs
20+ additional route groups
API → Backend
Event triggers
🏛️
Appwrite (Primary Backend)
Account Service
Auth provider
Users Service
Admin management
Databases Service
1 DB, 40+ Collections
Storage Service
3 Buckets
Messaging Service
SMTP email delivery
Realtime Service
WebSocket subscriptions
🔔
Notification System
NotificationDispatcher
Event-driven fan-out
DB Channel
Persistent storage
Socket.IO Channel
Real-time push
Email Channel
Branded HTML templates
Webhook Channel
External delivery
DB Channel → Appwrite DB (notifications collection)
Socket Channel → Socket.IO Server → User Browser
Email Channel → Appwrite SMTP
Webhook Channel → External HTTP
⚡
Redis / Caching Layer
Cloudflare CDN Cache
Edge-level static caching
In-Memory Caches
Currency, traffic, React Query
Next.js Cache
Server component cache
Redis (Planned)
Not yet implemented
Dashed = Planned / Not yet implemented
🌍
External Services
Razorpay
Payment Gateway
GitHub REST API
api.github.com
Google Gemini AI
LLM inference
Supabase (PostgreSQL)
GitHub Star Rewards ONLY
exchangerate-api.com
Live currency rates
Billing API→RazorpayCreate order / Verify payment
Razorpay→Billing APIWebhook POST /api/webhooks
GitHub API route→GitHub RESTRepo data fetch
GitHub API route→Google GeminiAI doc generation
Other APIs→SupabaseGitHub Star coupon lookup
Other APIs→Exchange APICurrency rates
⏰
Cron / Scheduled Jobs
Billing Cycle
/cron/billing/process-cycle
Grace Enforcement
/cron/billing/enforce-grace
Payment Reminders
/cron/billing/send-reminders
Storage Snapshots
Daily GB-month calc
Usage Alerts
Threshold evaluation
Billing Cycle, Grace, Storage, Alerts → Appwrite DB
Payment Reminders → Appwrite Messaging (SMTP)
🔐
Permission / RBAC System
Org-Level RBAC
OWNER → ADMIN → MEMBER
inherits
Workspace-Level RBAC
6 built-in + custom roles
inherits
Project-Level RBAC
Granular permissions
Session MW → Org RBAC → Workspace RBAC → Project RBAC — each layer narrows permissions
📦
Cloudflare R2 Storage (Planned)
Key Cross-Layer Connections
Traffic MW→Appwrite DB
CDN→Cloudflare Cache
Next.js→Next.js Cache
Hono→In-Memory Cache
In-Memory→Redis (Planned)
Appwrite Storage→R2 (Planned)