Giter Club home page Giter Club logo

car-booking-api's Introduction

Car Booking API 🛡️

Tools

  • NodeJS
  • Express
  • Sequelize
  • PostgreSQL

Getting Started

The easiest way to get started is to clone the repository:

clone the repository

git clone https://github.com/melitus/car-booking-api.git

Change directory

cd car-booking-api

Install NPM dependencies

yarn install

start the server

yarn run dev

Note: It is recommended to install nodemon for livereloading - It watches for any changes in your node.js app and automatically restarts the server

Deployment

Deployment to Heroku

  • Download and install Heroku CLI

  • In a terminal, run heroku login and enter your Heroku credentials

  • From your app directory run heroku create

  • Use the command heroku config:set KEY=val to set the different environment variables (KEY=val) for your application (i.e. heroku config:set BASE_URL=[heroku App Name].herokuapp.com etc.)

  • Do git add .

  • Do git commit -m" reason for commit"

  • Lastly, do git push heroku master.

Please note that you may also use the Herko Dashboard to set or modify the configurations for your application.

View live demo and test with any api

I used postman to test the api. To use postman, go to the project doc folder and import the docs file into your postman client to ease the testing

User Endpoint

  • Login - https://car-booking-backend.herokuapp.com/v1/api/user/login
  • Register - https://car-booking-backend.herokuapp.com/v1/api/user/register

Car Endpoints

  • Get all cars - https://car-booking-backend.herokuapp.com/v1/api/booking?pagesize=10&pagenumber=1

  • Book a car - https://car-booking-backend.herokuapp.com/v1/api/booking

  • Get previous booking filtered by user - https://car-booking-backend.herokuapp.com/v1/api/booking/24d551b9-6845-443a-ba9e-de18dd0b4fec/previous?pagesize=10&pagenumber=1

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.