8000 GitHub - maro14/foodie-backend: Backend for foodie
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

maro14/foodie-backend

Repository files navigation

Foodie Backend

A robust RESTful API backend for a food delivery application, built with Node.js, Express, and MongoDB.

Table of Contents

Features

  • User authentication and authorization
  • Food item management
  • Order processing
  • Review system
  • Role-based access control
  • Rate limiting
  • Error handling
  • Docker support

Prerequisites

  • Node.js (v16 or higher)
  • MongoDB
  • npm or Yarn
  • Docker (optional)

Installation

  1. Clone the repository:
git clone https://github.com/maro14/foodie-backend.git
cd foodie-backend
  1. Install dependencie 7EDD s:
npm install
# or using Yarn
yarn install
  1. Set up environment variables: Create a .env file in the root directory with the following variables:
NODE_ENV=development
PORT=5000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret_key
JWT_EXPIRES_IN=24h
CORS_ORIGIN=*
  1. Start the development server:
npm run dev
# or using Yarn
yarn dev

The server will be running at http://localhost:5000

API Documentation

Authentication Endpoints

  • POST /users/register - Register a new user
  • POST /users/login - User login

Items Endpoints

  • GET /items - Get all items
  • POST /items - Add new item
  • GET /items/:id - Get specific item
  • PUT /items/:id - Update item
  • DELETE /items/:id - Delete item

Orders Endpoints

  • GET /orders - Get all orders
  • POST /orders - Create new order
  • GET /orders/:id - Get specific order

Reviews Endpoints

  • POST /items/:itemId/reviews - Add review for an item
  • GET /items/:itemId/reviews - Get item reviews

Testing

Run the test suite:

npm test

Run tests in watch mode:

npm run test:watch

Generate coverage report:

npm run test:coverage

Docker

Build and run using Docker:

docker-compose up --build

Access the containerized application at http://localhost:5000

License

This project is licensed under the MIT License.

About

Backend for foodie

Topics

Resources

License

Stars

Watchers

Forks

0