This project is a Restaurant Management Application built with React.js for the frontend and Node.js for the backend. The application allows users to manage restaurants, create menus, and access customer panels. Supabase is integrated for storing images efficiently.
- Login Page: Users can log in using their credentials.
- Dashboard: Access a central panel for restaurant management.
- Create Restaurant: Add new restaurants with relevant details.
- Create Menu: Create and manage menu items.
- Customer Panel: Allows customers to view menus for specific restaurants.
- User Authentication: JWT-based authentication to secure API routes.
- Restaurant Management: APIs to add, view, and manage restaurants.
- Menu Management: APIs to create and retrieve menu items.
- Image Storage: Supabase integration for secure and scalable image storage.
- Middleware: Middleware to parse JSON and handle CORS.
- React.js
- React Router for navigation
- JWT Decode for decoding JSON Web Tokens
- JS Cookie for cookie management
- Node.js
- Express.js for server-side routing
- dotenv for environment variable management
- cors for handling Cross-Origin Resource Sharing
- Supabase for image storage
src/
├── pages/
│ ├── login.js
│ ├── Dashboard.js
│ ├── CreateRestaurant.js
│ ├── CreateMenu.js
│ └── CustomerPanel.js
├── App.css
├── App.js
└── index.js
backend/
├── routes/
│ ├── userRoutes.js
│ ├── menuItemRoutes.js
│ └── restaurantRoutes.js
├── app.js
├── .env
└── package.json
- Node.js and npm installed
- MongoDB database set up and running
- Supabase account and project created
- Clone the repository.
- Navigate to the
frontendfolder. - Install dependencies:
npm install
- Start the development server:
npm start
- Navigate to the
backendfolder. - Install dependencies:
npm install
- Create a
.envfile with the following variables:PORT=5000 MONGO_URI=<your_mongodb_connection_string> JWT_SECRET=<your_jwt_secret> SUPABASE_URL=<your_supabase_url> SUPABASE_KEY=<your_supabase_key>
- Start the server:
npm run dev
The backend uses the following environment variables:
PORT: Port number for the serverMONGO_URI: MongoDB connection stringJWT_SECRET: Secret key for signing JWTsSUPABASE_URL: URL of your Supabase projectSUPABASE_KEY: API key for accessing Supabase
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v2/login | User login |
| POST | /api/v2/signup | User registration |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v2/restaurants | Create a new restaurant |
| GET | /api/v2/restaurants | Get all restaurants |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v2/menu-items | Add a new menu item |
| GET | /api/v2/menu-items | Get all menu items |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v2/upload-image | Upload an image to Supabase |
| GET | /api/v2/images | Retrieve stored images |
- Start the Backend: Ensure the backend server is running on
http://localhost:5000. - Start the Frontend: The frontend will be available on
http://localhost:3000. - Login: Use the login page to authenticate.
- Dashboard: Navigate to the dashboard to manage restaurants and menus.
reactreact-router-domjwt-decodejs-cookie
expressdotenvcorsmongoosejsonwebtokensupabase
- Fork the repository.
- Create a new branch for your feature/fix.
- Commit your changes.
- Push the branch and create a pull request.
This project is licensed under the MIT License.
Special thanks to all contributors and the open-source community for their amazing tools and libraries.