How merabetmalih/smartcity_backend_rmcs works
Main Architectural Components
a) External Layer:
• Client Applications (Mobile/Web)
• Payment Gateway (Stripe integration, evident from stripe.js)
• File Storage System (for images in public directory)
b) Application Layer:
• API Gateway/Routes Layer
• Authentication/Authorization Layer
• Controllers Layer
• Services Layer
• Data Access Layer (Models)
Key Components
a) Entry Points:
• HTTP REST API endpoints (grouped by functionality):
• Auth routes
• Cart routes
• Category routes
• Order routes
• Product routes
• Search routes
• Store routes
• User routes
• Offer routes
b) Middleware Layer:
• Token Verification
• Data Validation
• Email Handler
c) Business Logic Layer:
• Service Layer Components
• Utility Functions (checkOffer, checkProVarin)
d) Data Models:
• User
• Store
• Product
• Category
• Cart
• Order
• Bill
• Payment
• FlashDeal
• Offer
External Clients/Systems
• ↓
API Gateway (Routes)
• ↓
Middleware Layer
• ↓
Controllers Layer
• ↓
Services Layer
• ↓
Models Layer
• ↓
Database
Important Relationships to Highlight
Key interactions:
• Authentication flow
• Payment processing flow
• Order processing pipeline
• Product and category management
• Cart and order relationship
• Store and product relationship
Additional Elements
Supporting components:
• Environment configuration (.env files)
• Docker container boundaries (Dockerfile presence)
• Public assets management
• External service integrations (Stripe)
Specific Implementation Details
Architectural patterns:
• MVC pattern implementation
• Service-oriented architecture
• Repository pattern for data access
• Middleware chain pattern
• Event-driven components (if any)
Version/environment management indicators
Remember to:
• Use consistent symbols throughout
• Notes for any non-obvious relationships
• Both synchronous and asynchronous flows
• Scalability points
• Security boundaries