A full-stack restaurant management system built with React, Node.js, Express, and PostgreSQL.
- Frontend: Digital Diner on Netlify
- Backend: Digital Diner API on Render
- User authentication (login/signup)
- Menu management
- Order placement and tracking
- Order history
- Admin dashboard
- Real-time order status updates
- React.js
- Redux Toolkit for state management
- Material-UI for UI components
- Axios for API calls
- Node.js
- Express.js
- PostgreSQL for order management
- MongoDB for menu items
- JWT for authentication
- Flexibility: Menu items have varying attributes and structures
- Schema Evolution: Easy to add new fields without migrations
- Performance: Better for read-heavy operations
- Document Structure: Natural fit for menu items with nested data
- Scalability: Horizontal scaling for growing menu items
- Development Speed: Faster iteration during development
- Data Integrity: Strong consistency and ACID compliance
- Relationships: Better for handling order relationships
- Transactions: Support for complex order operations
- Query Performance: Efficient for order history and filtering
- Data Validation: Built-in constraints and validations
- Reporting: Better support for complex queries and analytics
- Node.js (v14 or higher)
- PostgreSQL
- MongoDB
- npm or yarn
- Clone the repository:
git clone https://github.com/Angad-2002/DigitalDiner.git
cd DigitalDiner/backend- Install dependencies:
npm install- Create a
.envfile in the backend directory:
PORT=5000
MONGODB_URI=your_mongodb_uri
POSTGRES_URI=your_postgres_uri
JWT_SECRET=your_jwt_secret- Set up databases:
# For MongoDB
mongosh
use digital_diner
# For PostgreSQL
psql
CREATE DATABASE digital_diner;- Start the backend server:
npm run dev- Navigate to the frontend directory:
cd ../frontend- Install dependencies:
npm install- Create a
.envfile:
VITE_API_URL=http://localhost:5000- Start the development server:
npm run devPOST /api/auth/login- User loginPOST /api/users/signup- User registrationPOST /api/auth/logout- User logout
GET /api/menu- Get all menu itemsGET /api/menu/:id- Get menu item by IDPOST /api/menu- Create menu item (admin only)PUT /api/menu/:id- Update menu item (admin only)DELETE /api/menu/:id- Delete menu item (admin only)GET /api/menu/categories- Get all menu categories
GET /api/orders- Get all orders (admin only)GET /api/orders/phone/:phoneNumber- Get orders by phone numberPOST /api/orders- Create new orderPATCH /api/orders/:id/status- Update order status (admin only)POST /api/orders/:id/cancel- Cancel orderGET /api/orders/:id- Get order details
GET /api/admin/dashboard- Get admin dashboard dataGET /api/admin/orders- Get all orders with detailsGET /api/admin/menu-items- Get all menu items with detailsGET /api/admin/stats- Get restaurant statistics
- Users will provide valid phone numbers for order tracking
- Menu items will have consistent attributes
- Order statuses follow a predefined workflow
- Admin users will manage menu items responsibly
- Users have stable internet connection
- Mobile numbers are unique per user
- Menu items are available unless explicitly marked as unavailable
- Database Integration: Managing two different databases (MongoDB and PostgreSQL)
- State Management: Handling complex order states in Redux
- Authentication: Implementing secure JWT-based authentication
- CORS Configuration: Setting up proper CORS for frontend-backend communication
- Deployment: Configuring environment variables for different environments
- Real-time Updates: Implementing order status updates
- Error Handling: Managing errors across different services
- Data Migration: Moving from MongoDB to PostgreSQL for orders
This project utilized AI tools for:
- Code suggestions and optimizations
- Debugging assistance
- Documentation generation
- Code review and improvements
All code has been thoroughly reviewed and understood before implementation.
MIT License - feel free to use this project as a template for your own restaurant management system.
For any questions or suggestions, please open an issue in the repository.