Fairlx System Architecture
Comprehensive interactive architecture diagrams for the Fairlx project management platform — covering every API route, database collection, service integration, and data flow across 200+ endpoints and 60+ collections.
Cloud Architecture
Interactive infrastructure topology — 7-tier layout from Client through Edge, Compute, Middleware, Backend Services, and External Services. Click any node for detailed endpoint lists and architecture specs.
Sequence Diagrams
Step-by-step message flows between all system actors — covering auth (registration → 2FA → session), file uploads, Razorpay payments, task CRUD, real-time notifications, and org member onboarding.
Entity-Relationship Diagram
All 60+ Appwrite collections organized by domain — Core PM, Spaces & Workflows, RBAC, Billing/Wallet, Notifications, Custom Fields, GitHub Integration, Usage Metering, Organizations, and Programs. Every foreign key and relationship shown.
System Flowcharts
Detailed decision flows with branching logic — Authentication Lifecycle (7 states, 5 methods), Task Creation (workflow validation + RBAC), Billing State Machine (ACTIVE→DUE→SUSPENDED), 4-layer RBAC resolution, Notification dispatch, File upload pipeline.
BPMN Process Diagrams
Business process swimlane diagrams showing cross-actor responsibilities — Task Lifecycle (5 lanes), Billing & Invoice Cycle (4 lanes with cron triggers), Sprint Management, and Organization Member Onboarding (5 lanes).
User Flow Diagram
Interactive end-to-end system flow — from user browser through Cloudflare edge, Next.js application server, 35+ API route modules, Appwrite backend, notification dispatch, cron jobs, RBAC layers, and 7 external service integrations. Click any node for details.
Deep Dive Analysis (MD)
1142-line exhaustive Markdown document covering every API route (35 groups, ~200 endpoints), all 60+ collections with purposes, middleware pipeline, auth system, billing, RBAC, usage metering, cron jobs, and data flow diagrams.
Technology Stack
React 18, TailwindCSS, shadcn/ui components. Server-side rendering with App Router. Custom server.ts wrapping for Socket.IO WebSocket support.

All 200+ API routes registered at /api/[[...route]]. Zod validation via @hono/zod-validator. Session + billing + traffic metering middleware stack.
Primary backend: 60+ collections, 3 storage buckets, email/password + OAuth + 2FA auth, SMTP messaging, Realtime subscriptions. Session + Admin client patterns.
Wallet-only prepaid model (no subscriptions). USD→INR conversion. HMAC-SHA256 signature verification. Webhook handler with idempotency. Daily ₹5L limit.
Custom HTTP server wrapping Next.js. User-scoped rooms (user:{userId}). Internal /socket-push endpoint with secret auth. notification:new events.
Workflow AI (suggest statuses, transitions, generate, analyze). GitHub code documentation generation (max 50 files). Codebase Q&A. Project doc AI summarization.
PostgreSQL for GitHub Star rewards coupon system. Service role key (server-only). Tables: coupons, audit_logs, user_suspensions. Rate-limited redemption.
Repository linking to projects. File tree fetching, commit history. Code documentation generation pipeline. GitHubAPI class with optional personal access token.
Architecture Highlights
Workspace (6 built-in + custom roles) → Organization (department-based + per-user grants) → Project (project roles + team permissions) → Space (public/private + member roles).
Traffic (batched 60s, API request bytes/duration), Storage (per-file +/- bytes), Compute (50+ weighted job types). Monthly invoice generation with wallet deduction.
23 event types dispatched in parallel to 3 channels: Socket.IO WebSocket push, Appwrite SMTP email, Database notification records. Plus project webhooks with HMAC signing.
Wallet-based prepaid billing. Monthly cron invoice generation. 14-day grace period with day 1/7/13 reminders. CAS-based deduction. Automatic reactivation on payment.