How hamzamagdy0/online-sabroso-restaurant-website works
Project type and purpose
• This is a full-stack restaurant management web application (“Sabroso Restaurant Website”) whose primary goals are:
• Customer-facing menu browsing and reservations
• User authentication and profile management
• Admin dashboard for menu and reservation management
• Real-time order tracking (via REST APIs).
File structure
• Top-level files and folders:
• app.js: entry point where Express is configured.
• controllers/: business logic grouped by domain (admin, user).
• routes/: HTTP endpoints grouped by resource (auth, menu, reservations, users).
• models/: Mongoose schemas for menu, reservations, users.
• views/: EJS templates for all UI screens.
• public/: static assets (CSS, JS, images).
• .env: environment variables (MongoDB URI, JWT secret, port).
• Pattern: An MVC-style separation—routes → controllers → models ←→ database, with views rendering server-side HTML.
README for additional insights
• Architecture hints: Node.js + Express backend, MongoDB via Mongoose, EJS templating, JWT for authentication, CSS/JS static assets, Nodemon for development.
• API endpoint list clarifies how clients interact with the backend.
Detail and component separation
• Don’t hesitate to break large blocks into smaller ones: for example, split “routes” into authRoute, menuRoute, reservationsRoute, usersRoute.