How stradi/bforum works
Main Components
A. Frontend Layer (Next.js Application):
• Client-side Components (/apps/frontend/src/components)
• App Routes (/apps/frontend/src/app)
• API Integration Layer (/apps/frontend/src/lib/api)
• Authentication System
• Admin Interface (/apps/frontend/src/app/admin)
B. Backend Layer (Node.js/Bun Application):
• API Controllers (/apps/backend/src/modules)
• Database Layer (/apps/backend/src/database)
• Authentication Service
• Middleware Stack (/apps/backend/src/middlewares)
C. Database Layer:
• SQL Database (indicated by Drizzle ORM usage)
• Schema Components:
• Accounts
• Groups
• Permissions
• Nodes
• Threads
• Replies
┌─ Client Layer ─────────────────────┐
• ┌─ Next.js Frontend ────────────┐ │
• Public Routes │ │
• Protected Routes │ │
• Admin Dashboard │ │
• Authentication UI │ │
• ┘ │
• ┬──────────────────┘
┌──────────────▼──────────────────┐
• ┌─ API Layer ─────────────────┐ │
• Auth Middleware │ │
• API Routes │ │
• Request Validation │ │
• ┬─────────────┘ │
• ┌─────────────▼─────────────┐ │
• Module Controllers │ │
• Accounts │ │
• Groups │ │
• Nodes │ │
• Threads │ │
• Replies │ │
• ┬─────────────┘ │
• ┼───────────────┘
┌───────────────▼───────────────┐
• ┌─ Database Layer ──────────┐ │
• Drizzle ORM │ │
• SQL Database │ │
• Migrations │ │
• ┘ │
• ┘
Important Relationships to Highlight
• Authentication flow between frontend and backend
• Data flow from client through API to database
• Admin dashboard interactions with backend services
• Middleware chain in the backend
• Permission system integration across layers
Additional Elements
Specific architectural patterns:
• Module-based architecture in backend
• Route grouping in frontend
• Middleware pipeline
• Authentication boundaries
• API client abstraction layer
Technical Details to Note
• Next.js frontend with app router
• Backend API with modular structure
• Drizzle ORM for database operations
• JWT authentication (based on types)
• Role-based access control (Groups and Permissions)