Giter Club home page Giter Club logo

cafeteria's Introduction

Cafeteria

Description

This is a demo application for a cafeteria. It is a simple application that allows users to order food and drinks from a cafeteria. The application is built with NestJS and uses a MongoDb database. The application is dockerized and can be run with docker-compose or without docker, details are below.

Toolings

Installation - without docker

Create and set up a .env file using the sample in the .env.example file.

$ yarn install

Running the app

# development
$ yarn run start

# watch mode
$ yarn run start:dev

# production mode
$ yarn run start:prod

Installation - with docker

Install and set up docker according to your OS requirements

Running the app

You can use all the original docker commands but these few scripts are available for use.

# development - start a docker in undetached mode - we might not be able to watch file changes
$ yarn run docker:dev:up

# production - start a docker in undetached mode
$ yarn run docker:prod:up

# stop the running container
$ yarn run docker:down

# Remove dev container
$ yarn run docker:dev:rm

# Remove prod container
$ yarn run docker:prod:rm

# Restart dev container
$ docker:dev:restart

# Restart production container
$ docker:prod:restart

# At some point you might want to delete and rebuilt the image
$ docker image rm <image-id or repository-name>

API Documentation (Swagger): localhost

The API documentation is available at http://localhost:9092/api/v1/docs when the application is running on localhost. Your port can be different from the one above. Check your .env file or the server logs on the terminal for the PORT variable value.

API Documentation (Swagger): live host

The API documentation is available at <your-host>/api/v1/docs when the application is running.

Test the API

The API can be tested using the swagger documentation.

Create a user account and login to get a token. The token is required to access the protected routes.

Once you login, copy the accessToken and click on the Authorize button on the top right corner of the page. Logout if not already logout. Paste the token in the input field and click on the Authorize button. You can now test the API.

Test

# unit tests
$ yarn run test

# e2e tests
$ yarn run test:e2e

# test coverage
$ yarn run test:cov

Application Code Documentation

app-code-docs

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.