Giter Club home page Giter Club logo

parking-lot's Introduction

Parking lot

Build Status Coverage Status e2e

Assumption

  • Scenario: free parking lot without human intervention.
  • parking lot:
    • can create unlimited parking lots.
    • can set the number of slots in each parking lot.
  • car
    • the car must park at the same slot size only.
  • size:
    • slots sizes: small, medium, large.
    • car sizes: small, medium, large.
  • pricing: free.

Running the API

Development

  • Install Node.js 15.12.0
  • Update the environment variables in .env file (you can see the example in .env.example)
  • Run npm install
  • Run npm run start:dev

Production

Test Scripts

Tests are written using Jest and can be run using

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

for production you have to run docker exec -it parkinglot_api sh before running test scripts

Document APIs

MongoDB Databases

 - parkingLots
        - _id
        - rank
        - name
        - slots
          - smalls
            - slotId
            - isAvailable
          - mediums
            - slotId
            - isAvailable
          - larges
            - slotId
            - isAvailable
        - createdAt
 - tickets
        - _id
        - parkingLotId
        - slotId
        - plateNumber
        - carSize
        - exitAt
        - createdAt

API Endpoints

  • POST /parkinglot to create parking lot

  • POST /car/park to park a car in a parking lot

  • POST /car/exit to check out a parking

  • GET /car/status to get available slots of all parking slots

  • GET /ticket?vehicleSize=large to get ticket

TODOs

  • E2E test
  • Unit test
  • JWT for Authentication
  • Example for client use
  • Dockerfile for development

Reference

parking-lot's People

Contributors

theerapat-vijitpoo avatar ben-theerapat avatar

Stargazers

 avatar Martin Thuo avatar

Watchers

James Cloos avatar  avatar

Forkers

fossabot

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.