malcolm-kee / dine-in

Web service for restaurant seating management system.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dine-in

https://dine-in-rest.herokuapp.com/docs

Web service for restaurant seating management system.

  • a REST service
  • a queue service using Redis
  • a WebSocket service

Get Started

There are two ways to start the services of this project:

  1. Using Docker (recommended)
  2. Manual Installation

Using Docker

If you already have Docker installed with Docker Compose, you can install and start the services with:

docker-compose --compatibility up -d

This will starts 3 Rest API services with 3 WebSocket servers with Nginx as load-balancer in front of them.

You can shutdown the services with the command docker-compose down

Manual Installation

  1. Install the following software if not available in your machine:

    • MongoDB
    • Redis
  2. Install all project dependencies.

    yarn install
  3. Add a .env file at the root of the project with the following contents:

    RESTAURANT_DB_URL=mongodb://localhost:27017/restaurant
    PORT=4000
    REDIS_URL=redis://localhost:6379
    WEBSOCKET_PORT=8080
    JWT_SECRET=Y0UR_JWT_S3CR3T
    
  4. Start all the services:

    yarn start

API

  • Once the services started, you can explore the available REST endpoints at <baseUrl>/api, e.g. http://localhost:4000/api
  • The Websocket endpoints is available at the port number following WEBSOCKET_PORT variable, e.g. ws://localhost:8080

Integration Testing

You can run the integration testing between the application of the project with the following command:

yarn test:e2e

E2E Testing

You can run end-to-end testing between the applications in a docker containers with:

docker-compose -f docker-compose-test.yaml run e2etest

Built With

About

Web service for restaurant seating management system.


Languages

Language:TypeScript 94.4%Language:JavaScript 3.1%Language:Dockerfile 1.7%Language:Shell 0.8%