Skip to content

ShivamMathtech/Reko_food_hub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reko Food Hub - Backend

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.

Features

  • User authentication (JWT)
  • Menu management (CRUD)
  • Order handling
  • Food item categories
  • RESTful API structure
  • Environment variable-based configuration

Technologies

  • Node.js
  • Express.js
  • MongoDB with Mongoose
  • dotenv for environment variables

Getting Started

Prerequisites

Installation

  1. Clone the repository:

    git clone https://github.com/ShivamMathtech/Reko_food_hub.git
    cd Reko_food_hub
  2. Install dependencies:

    npm install
  3. Set up environment variables:

    • Create a .env file 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
      
  4. Run the server:

    npm start

    The server will run on http://localhost:5000 by default.

Folder Structure

/models       # Mongoose models (FoodItem, User, Order, etc.)
/controllers  # Express route logic
/routes       # Express routers
/server.js    # App entry point
/.env         # Environment variables

API Endpoints

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!

Contributing

Pull requests and suggestions are welcome!

License

MIT


Built by Shivam Mathur and contributors.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors