This is the backend API for Reko Food Hub, a food ordering and menu application. Built with Node.js, Express, and MongoDB using Mongoose as the ODM.
- User authentication (JWT)
- Menu management (CRUD)
- Order handling
- Food item categories
- RESTful API structure
- Environment variable-based configuration
- Node.js
- Express.js
- MongoDB with Mongoose
- dotenv for environment variables
-
Clone the repository:
git clone https://github.com/ShivamMathtech/Reko_food_hub.git cd Reko_food_hub -
Install dependencies:
npm install
-
Set up environment variables:
- Create a
.envfile in the root directory. - Add the following and update values as needed:
PORT=5000 MONGO_URI=mongodb://localhost:27017/reko-food-hub JWT_SECRET=your_jwt_secret
- Create a
-
Run the server:
npm start
The server will run on
http://localhost:5000by default.
/models # Mongoose models (FoodItem, User, Order, etc.)
/controllers # Express route logic
/routes # Express routers
/server.js # App entry point
/.env # Environment variables
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/menu | Get all food items |
| POST | /api/menu | Add a new food item |
| PUT | /api/menu/:id | Update a menu item |
| DELETE | /api/menu/:id | Delete a menu item |
| POST | /api/auth/login | User login |
| POST | /api/auth/register | User registration |
| POST | /api/orders | Place an order |
| GET | /api/orders | Get all orders (admin) |
Full OpenAPI/Swagger docs coming soon!
Pull requests and suggestions are welcome!
MIT
Built by Shivam Mathur and contributors.