A comprehensive backend system for a food delivery service, built using Node.js, Express.js, MySQL, and with integrated authentication (via Passport.js) for Google and Facebook. This system provides key features such as user management, product management, invoice generation, role-based access control (RBAC), and more, designed to support a food delivery platform.
- User Registration: Allows users to register via email/password.
- Login: Users can log in with email/password or through Google/Facebook OAuth.
- Session Management: Uses express-session and stores sessions using session-file-store.
- JWT Authentication: Token-based authentication for certain APIs.
- Admin Control: Admins can view, add, edit, and delete user accounts.
- Role Management: Admins can manage user roles (e.g., Admin, User, etc.).
- Role Assignment: Users are assigned roles to access specific resources.
Admins can manage product categories, including adding, editing, and deleting categories.
Admins can manage products by adding, editing, and deleting items in the catalog. Product image uploads for visual representation.
Admins can manage discount schemes, including creating, editing, and deleting discounts.
Users can view and edit their profile information, including updating address details.
The user dashboard displays key information, like user data and relevant navigation links.
Admins can generate and manage invoices, linked to user transactions.
Admins can edit global application settings.
Handles checkout and payment processing. Generates invoices after successful payment.
RESTful API endpoints for key actions like authentication, products, categories, and more. JWT is required for certain routes, ensuring secure data access.
Ensure you have the following installed:
-
Clone the repository:
git clone https://github.com/DhruvGajera9022/Food-Delivery-Backend-System.git cd Food-Delivery-Backend-System
-
Install dependencies:
npm install
-
Set up the environment variables.
-
For create Database in MySql:
npx sequelize-cli db:migrate
-
Run the Server:
npm start
-
Access Swagger Documentation:
http://localhost:3000/api-docs
- Authentication Endpoints:
/api/login
- Login via email/password/api/register
- Register new users
- Profile & Address Endpoints:
/api/me
: View user's all details/api/editProfile
: Edit user's profile/api/address
: Get user's addresses/api/address
: Edit user's address/api/delete/address/:id
: Delete user's address
- Product & Category Endpoints:
/api/category
: Get all categories/api/products
: Get all products
- Discount Management:
/api/discount
: Get all discounts
- Invoice Management:
/api/invoices
: Get all invoices/api/invoices
: Generate new invoice
- Payment Endpoints:
/api/checkout
: Process a payment