How golabisib/divar-reactjs- works
Main Components
A. Frontend Layer (React.js):
• Components (templates, modules)
• Services (auth, admin, main, user)
• Router
• State Management (React Query)
• Utils (cookies, numbers)
B. Backend Layer (Node.js):
• API Routes (auth, category, option, post, user)
• Controllers
• Services
• Models (MongoDB schemas)
• Common (guards, exceptions, utils)
• Config (mongoose, swagger)
C. Database Layer:
• MongoDB instance with collections:
• Users
• Posts
• Categories
• Options
D. External Services/Middleware:
• Authentication/Authorization
• File Upload (Multer)
• Exception Handlers
• Swagger Documentation
Connection Flow
• Frontend → Backend (REST API calls)
• Backend → Database (Mongoose ODM)
• Frontend ↔ Auth Service (JWT/Cookie-based auth)
• Backend ↔ File Storage (for uploads)
Specific Implementation Details
Technical aspects:
• React Query for API state management
• JWT/Cookie authentication flow
• File upload handling
• API documentation with Swagger
• MongoDB connection
• Error handling middleware
Component Relationships
Key interactions:
• User authentication flow
• Post creation/management
• Category management
• File upload process
• API request/response cycle
Additional Elements
• Environment configurations
• Public assets
• Build tools (Vite)
• Static file serving