How deanco100/foobar-server-public works
Main Components
A. Client Layer (External)
• Web Client (React.js based on the build files in /public)
• Android Client (mentioned in README but not in this repo)
B. Server Layer (Node.js)
• API Gateway
• Routes (/routes)
• Login Routes
• Post Routes
• User Routes
• Middleware Layer
• Token Checker (Authentication)
• Bloom Filter Helper (Utils)
• Business Logic Layer
• Controllers
• User Controller
• Post Controller
• Services
• User Service
• Post Service
• Data Layer
• Models
• User Model
• Post Model
• MongoDB Database
Component Relationships
• Clients → API Gateway (REST APIs)
• API Gateway → Middleware → Controllers
• Controllers → Services
• Services → Models
• Models → MongoDB
Important Details
A. Authentication Flow:
• Token-based authentication flow
• TokenChecker middleware
• Login/register paths
B. Data Flow:
• Post creation/deletion/editing flow
• User management flow
• Friend request system
C. Special Features:
• Bloom Filter implementation (for optimization)
• Environment configuration handling
• Local/Test environment separation
Technical Specifications to Note
• Port: 8080 (from config)
• MongoDB Connection: localhost:27017/FooBar
• Environment Configurations (.env, .env.local, .env.test)