Giter VIP home page Giter VIP logo

taxi-booking's Introduction

Taxi booking system

Taxi booking system written in Node.js using TypeScript and Express server

Install node modules

npm install

Compile TypeScript files and start the application

npm run start

API Endpoints:

  • http://localhost:8090/api/book
    • POST only
    • accepts JSON data in the format:
      • { source: { x: x1, y: y1 }, destination: { x: x2, y: y2 }}
    • books the nearest available car and returns response in the format:
      • { car_id: id, total_time: t }
    • if no car is available, empty response is returned
  • http://localhost:8090/api/tick - moves all booked cars by 1 distance unit and returns current cars positions
  • http://localhost:8090/api/reset - resets all cars to (0, 0) and unbooks them and returns current cars positions
  • http://localhost:8090/api/status- returns current cars positions without any modifications made

Tests

Run all tests

npm run tests

Run Unit tests

npm run test-unit

Run unit tests with watch mode

npm run test-unit-watch

Run Python API tests (make sure API server is up and running)

npm run test-api

Coverage

After first time Unit tests have run, coverage is collected and accessible from /test/reports/jest/index.html.


Linting

Run TSLint

npm run lint

Development

Start watching TypeScript files for changes and compiling them automatically

npm run watch

taxi-booking's People

Stargazers

 avatar  avatar

Watchers

 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.