- Project Overview
- Features
- Technologies Used
- Setup Instructions
- Database Schema
- API Documentation
- Error Handling and Validation
- Project Structure
- Conclusion
- License
This is a full-stack restaurant management system that allows customers to make food orders to partner restaurants. It's implemented using React.js for the frontend, Node.js for the backend, and MySQL as the database. The app allows restaurant admins to manage restaurant menus, orders, and reports through a RESTful APIs. It supports features like JWT-based authentication, user management, order placement, reporting, and more.
- User Authentication: Users can sign up, log in, and log out using JWT-based authentication.
- Restaurant Management: Restaurant admins can manage restaurant menu items.
- Order Management: Users can place orders, view order history, and track order status.
- User Management: Admins can manage Restaurants, view Restaurant details, and manage users.
- Reporting: Restaurant admins can view order reports, sales reports, and other analytics.
- React.js: User interface development.
- Shadcn: For UI components.
- Tailwind CSS: For styling.
- Auth0: For user authentication.
- Redux Toolkit: For state management.
- Axios: For making API requests.
- React Router: For navigation and route protection.
- Node.js: Backend framework.
- Express.js: Used for building the RESTful API.
- Sequelize: ORM for interacting with the MySQL database.
- JWT: JSON Web Token for user authentication.
- AJV: For request body validation.
- Node.js (v14+)
- MySQL (v8+) / Docker desktop
- Git
- Auth0 application setup - Configure Auth0
- Clone the repository:
git clone https://github.com/odhithSen/snackaroo.git
You can either use a local MySQL database or start the configured mysql Docker image using docker compose. Here are the steps to set up a MySQL database using Docker:
- Create a
.envfile in the root directory (Check .env.example) and add the following environment variables:MYSQL_ROOT_PASSWORD MYSQL_DATABASE MYSQL_USER MYSQL_PASSWORD
- Start the MySQL Docker container:
docker compose up
This project uses a mono-repository setup with a shared node_modules folder for the frontend and backend. To set up the mono-repository, follow these steps:
- Configure npm workspace:
npm install
-
Navigate to the
backenddirectory:cd backend -
Install the dependencies:
npm install
-
Create a
.envfile in the backend directory (Check .env.example) and add the following environment variables:PORT DB_HOST DB_USER DB_PASS DB_NAME DB_PORT AUTH0_AUDIENCE AUTH0_DOMAIN
-
Run database migrations and seed data
npx sequelize-cli db:migrate npx sequelize-cli db:seed:all
-
Start the server:
npm run dev
-
Navigate to the
frontenddirectory:cd ../frontend -
Install the dependencies:
npm install
-
Create a
.envfile in the frontend directory (Check .env.example) and add the following environment variables:REACT_APP_AUTH0_DOMAIN REACT_APP_AUTH0_CLIENT_ID REACT_APP_AUTH0_CALLBACK_URL REACT_APP_API_AUTH0_AUDIENCE REACT_APP_BACKEND_URL
-
Start the server:
npm start
Database diagrams and DB schema definitions can be found in the DB schema file.
Api documentation generated using Postman and can be accessed by API documentation file.
- AJV: Used for request body validation to ensure proper input.
/frontend
/public
/src
/assets
/components
/hooks
/models
/pages
/services
/slices
/utils
/.env
/backend
/config
/migrations
/seeders
/src
/controllers
/enums
/middlewares
/models
/routes
/services
/utils
/.env
/LICENSE.txt
/README.md
/docker-compose.yml
/.envThis project implements a full-featured restaurant management system with essential features for user authentication, menu management, order management, and reporting. It adheres to best practices in full-stack development, ensuring security, and performance.
Please review the license file for more information.