NutriBox is a meal planning and delivery web application that allows users to personalize meal plans, schedule deliveries, and manage orders. This server handles authentication, meal providers, orders, and user management.
Client Site: Visit NutriBox
Server Site: Visit NutriBox Api
- User authentication and authorization (JWT-based)
- Role-based access control (Customer, Meal Provider)
- Meal providers can add, update, and manage meals
- Customers can browse meals, place orders, and manage their profiles
- Cloud-based image storage with Cloudinary
- Order tracking and management
- Node.js & Express.js - Backend framework
- MongoDB & Mongoose - Database & ODM
- TypeScript - Strongly typed JavaScript
- JWT - Authentication & Authorization
- Zod - Input validation
- Multer & Cloudinary - Image upload & storage
- ESLint & Prettier - Code linting & formatting
- dotenv - Environment variable management
POST /api/auth/login- User loginPOST /api/auth/refresh-token- Refresh JWT token
POST /api/user/register- Register a new userPATCH /api/user/profile-data- Update profile dataGET /api/user/my-data- Get user details
POST /api/orders- Place an order (Customer)GET /api/orders/:orderId- Get order details (Customer, Meal Provider)PATCH /api/orders/orderdetails/:orderId- Update order detailsGET /api/orders/myorder/alldata- Get customer ordersGET /api/orders/allorder/mealprovider- Get all orders for a meal provider
POST /api/meals/menu- Add a new meal (Meal Provider)GET /api/meals- Get all mealsGET /api/meals/mymeals- Get meal provider's mealsGET /api/meals/:mealId- Get meal detailsPATCH /api/meals/update/:mealId- Update meal details
POST /api/meal-provider- Register as a meal providerGET /api/meal-provider/mydata- Get meal provider's data
-
Clone the repository:
git clone https://github.com/subirdas29/car-stores-server cd nutribox-server -
Install dependencies:
npm install
-
Set up environment variables: Create a
.envfile in the root directory and add the required environment variables. -
Build and run the server:
npm run build npm start
For development:
npm run start:dev
Contributions are welcome! Feel free to open an issue or submit a pull request.
This project is licensed under the ISC License.