GithubHelp home page GithubHelp logo

evanigwilo / food-delivery-api Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 78 KB

Food Delivery API

Home Page: https://petstore.swagger.io/?url=https://raw.githubusercontent.com/evanigwilo/food-delivery-api/main/docs/api-definition.yml

Dockerfile 1.13% Shell 1.08% TypeScript 97.79%
docker food-delivery model-view-controller postgresql rest-api session-cookie typescript

food-delivery-api's Introduction

Food Delivery API

TypeScript

A RESTful API backend service for an online food delivery platform.

The API can create user accounts (includes an initial amount), browse restaurants, view menu items, place orders, and handle order fulfillment.

This solution uses Node.js runtime, Express for the API layer, Redis for user sessions, Postgres for relational data.

You can explore the Live REST API

Demo accounts

identity: mark;
password: 123456;

identity: john;
password: 123456;

API Routes

Methods Routes Description
GET /user/authenticate Gets user attributes for the current authenticated user.
POST /user/register Registers and authenticates users.
POST /user/login Logs in and authenticates users.
POST /user/logout Logs out the current authenticated user.
POST /country Gets countries for creating locations
POST /country/create Creates a country
GET /country/{countryId} Get a country by id
PATCH /country/{countryId} Update country by id
DELETE /country/{countryId} Delete country by id
POST /location Gets locations for creating restaurants (and users)
POST /location/create Creates a location
GET /location/{locationId} Get a location by id
PATCH /location/{locationId} Update location by id
DELETE /location/{locationId} Delete location by id
POST /restaurant Gets restaurants for creating menus
POST /restaurant/create Creates a restaurant
GET /restaurant/{restaurantId} Get a restaurant by id
PATCH /restaurant/{restaurantId} Update restaurant by id
DELETE /restaurant/{restaurantId} Delete restaurant by id
POST /menu Gets menus for creating foods
POST /menu/create Creates a menu
GET /menu/{menuId} Get a menu by id
PATCH /menu/{menuId} Update menu by id
DELETE /menu/{menuId} Delete menu by id
POST /food Gets foods
POST /food/create Creates a food
GET /food/{foodId} Get a food by id
PATCH /food/{foodId} Update food by id
DELETE /food/{foodId} Delete food by id
POST /order Gets user orders
POST /order/create Creates an order
GET /order/{orderId} Get an order by id
PATCH /order/{orderId} Pay for an order by id

Requirements

Before getting started, make sure you have the following requirements:

Run The Project

Follow these steps to get your development environment set up:

  1. Clone this repository locally;
# Change to the desired directory
$ cd <desired-directory>

# Clone the repo
$ git clone https://github.com/evanigwilo/food-delivery-api.git

# Change to the project directory
$ cd food-delivery-api
  1. Change environmental variables filename from .env.example to .env

  2. Update the .env file configuration values (optional)

  3. At the root directory, run the following command:

# Create external docker volume for the postgres database
$ docker volume create postgres-db-volume

# Build and run the server in a container environment
$ docker-compose --env-file .env -p food-deliver-stack -f docker-compose.yml up --build -d
  1. The server will be running at http://localhost:4000/v1

Useful commands

# Stops and removes containers, networks and volumes
$ docker-compose --env-file .env -p food-deliver-stack -f docker-compose.yml down -v --remove-orphans

References

food-delivery-api's People

Contributors

evanigwilo avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.