How haji-suleman/food-delivery works
Main Components
• Frontend: This is under the "frontend" directory. It is built using HTML, CSS, and JavaScript (React with Vite) and handles user interactions such as browsing food items, managing the cart, and placing orders.
• Admin Panel: Found in the "admin" directory, this React-based dashboard enables administrators to manage food items, orders, and user accounts.
• Backend/API Server: The "backend" folder contains an Express.js application with clearly defined directories for routes, controllers, models, middleware, and configuration files. This server handles authentication (using JWT), order processing, communication with the database (MongoDB), and facilitates payment integration.
• External Services: These include payment gateways (e.g., Stripe or PayPal) and mailing systems (NodeMailer as seen under backend/Mail), which interact with the backend.
Relationships and Interactions
• Both the frontend and the admin panel communicate with the backend by making HTTP requests (e.g., REST API calls).
• The backend routes client requests through controllers and middleware (including authentication and mailing) to the respective business logic.
• The backend interacts with the MongoDB database for persisting and retrieving data.
• Payment processing services and mailing services should be shown as external systems that the backend communicates with through specific modules or services.
Architectural Patterns and Design Principles
• Separation of Concerns: Clearly separate the presentation layer (frontend and admin) from the business logic layer (backend).
• Security: Include a representation of the authentication flow (JWT) and any validation middlewares.
Technologies and Frameworks
• Frontend and Admin: React (using Vite), HTML, CSS, JavaScript.
• Backend: Node.js, Express.js.
• Database: MongoDB.
• Authentication: JWT.
• External Payment Service: Stripe/PayPal (as per README).
• Mailing: NodeMailer (under backend/Mail).