How pavilionryz/rms-in works
Project type and purpose
• RestoMaster is a full-stack MERN (MongoDB, Express.js, React.js, Node.js) restaurant management system.
• It provides modules for authentication, order & cart management, menu & inventory tracking, staff & reservation management, payments, and analytics.
File structure
• Backend/
• Follows an MVC-style layout:
– models/ (Mongoose schemas)
– controllers/ (business logic per resource)
– routes/ (Express routers)
• middleware/ for auth, error handling
• utils/ for error handlers and user verification
• config/database.js for MongoDB connection
• server.js bootstraps Express
• seed.js populates initial data
• Frontend/
• React app built with Vite
• components/ organized into Auth, Layout, Pages, Loading, Redux, Storage
• Redux slices manage state for each domain (orders, cart, auth, etc.)
• setupInterceptors.jsx handles Axios interceptors (attach JWT, handle 401)
• ProtectedRoute wraps routes based on role/permission
• Storage/firebase.js for any Firebase interactions (e.g., OTP)
README for additional insights
• Uses JWT for authentication, Bcrypt for password hashing
• Tailwind CSS, Ant Design, Framer Motion on the front end
• Deployed on Vercel (frontend) and Render (backend)
• External services: MongoDB Atlas, SMTP email service, optional Firebase
a. Main components
• Client UI (browser/mobile)
• Frontend React app
• Redux Store
• HTTP Layer (Axios + Interceptors)
• Backend Node/Express API
• Controllers & Middlewares
• MongoDB database
• External services (SMTP email, Firebase Auth)
b. Relationships & interactions
1. User flows:
• User ⇒ React UI ⇒ Redux actions ⇒ Axios requests ⇒ Express routes ⇒ Controllers ⇒ Mongoose model ⇒ MongoDB
• Controllers may call utils (errorHandler, verifyUser) and middleware for auth & error catching
2. Auth flow:
• Login/Register ⇒ Controller ⇒ issue JWT ⇒ sent in response ⇒ stored in Redux ⇒ Axios interceptor attaches JWT to subsequent requests
3. Real-time / updates:
• Inventory/order changes saved in MongoDB ⇒ front end polls or re-fetches via Axios
4. External integrations:
• Email notifications via SMTP (configured in .env)
• OTP / password reset via Firebase
c. Architectural patterns
• MVC on backend
• Flux/Redux on frontend
• Role-based access control enforced in middleware & ProtectedRoute
• Modularization: separate slices/modules per domain
d. Key technologies
• Frontend: React, Redux, Tailwind CSS, Ant Design, Framer Motion, Axios
• Backend: Node.js, Express.js, Mongoose/MongoDB, JWT, Bcrypt
• External: MongoDB Atlas, SMTP email, Firebase, Vercel, Render