How rahulreddyp/lettuce-eat-restaurant-application works
Main Components
• Client (Frontend):
• Built with React (create-react-app) using frameworks like React-Bootstrap and Material UI for the UI.
• Contains separate modules for routing, shared components (header, footer), pages (e.g., HomeScreen, Login, Signup, Menu, Cart, Admin, etc.), and API calls (organized inside the “apicalls” folder).
• Server (Backend):
• Developed in Node.js with Express, handling API endpoints via controllers and routes (e.g., user, menu, cart, payment, coupon, feedback, order, wishlist, etc.).
• Uses MongoDB (via Mongoose models) for data management.
• Integrates with AWS S3 for file uploads and retrieval (as seen in menu controllers).
• Database:
• External Services/Integrations:
• AWS S3 for storage.
• Heroku for deployment.
• Authentication using JWT tokens.
Relationship & Interactions
• The Client sends RESTful API calls (organized in the apicalls folder) to the Server.
• The Server routes these requests to the appropriate controllers which handle business logic, perform validation (using libraries like Yup and react-hook-form on the client side), and interact with the Database via Mongoose models.
• For file uploads (e.g., menu images), the Server integrates with AWS S3 (uploading and retrieving images) as part of the menu controllers.
• The admin portal (secured through JWT authentication with a dedicated login route) allows administrative management such as updating menus, user management, or coupon creation.
Architectural Patterns & Technologies
• MVC Pattern on the backend: The “models”, “controllers”, and “routes” directories clearly indicate an MVC approach.
• Separation of Concerns: Frontend and backend code are separated into the “client” and “server” directories; within the frontend, components, API calls, and asset directories are clearly split.
• RESTful API Design and JWT-based authentication as shown in the user and menu controllers.
• Integration with cloud services (AWS S3 for file storage and Heroku for deployment).