iyiolaosuagwu / WayFarer

WayFarer is a public bus transportation booking server.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WayFarer

WayFarer is a public bus transportation booking server

Pivotal Tracker

https://www.pivotaltracker.com/n/projects/2359647

Heroku Api Endpoint

https://wayfarerapiv1.herokuapp.com/

Required

  • Node JS
  • Express JS
  • Postgresql DATABASE

Technologies

Backend Libraries & Frameworks:

  • Node JS
  • Express
  • Babel
  • Passport
  • passport-jwt
  • Mocha & Chai
  • ESLint
  • Validator
  • Jwt
  • Morgan
  • Bcrypt
  • pg
  • dot env
  • faker

Installation

To install and run the project you need to do the following:

Create the folder you wish to run the project in

Clone the repository: git clone https://github.com/iyiolaosuagwu/WayFarer in the folder you created

Install all dependencies by running the command: yarn or npm install

Start the server by running thhe command: yarn start or npm start

Navigate to localhost: 6000/api/v1 in your browser to view the running application

Testing

To run unit tests run the command : yarn run test in the command line terminal

API Endpoints

HTTP VERBENDPOINTFUNCTIONALITY
POST /api/v1/auth/signup User signup
POST /api/v1/auth/signin User signin
POST /api/v1/trips Create a trip
POST /api/v1/bus Create a bus for a trip
POST /api/v1/bookings Book a seat on a trip
GET /api/v1/users Admin can View all registered users
GET /api/v1/trips View all trips
GET /api/v1/bus View all bus available for a trip
GET /api/v1/trips?filter_by=origin View trips by origin
GET /api/v1/trips?filter_by=destination View trips by destination
GET /api/v1/bookings View all bookings
GET /api/v1/user/bookings View all users bookings
GET /api/v1/bookings/:bookingId View bookings by booking ID
PATCH /api/v1/trips/:tripId Cancel a trip
PATCH /api/v1/bookings/:bookingId user can update seat number after booking a trip
DELETE /api/v1/bookings/:bookingId Delete a booking

Install Postman and navigate localhost: 3000/api/v1/ to test API endpoints

Authurization headers

"x-auth-token": Token

Features

Users

  • Users can sign up
  • Users can login
  • Users can booking a seat on a trip.
  • Users can view booking by ID
  • Users can delete their booking.
  • Users can get a list of filtered trips based on origin.
  • Users can get a list of filtered trips based on destination.
  • Users can specify their seat numbers when making a booking.
  • Users can change seat after booking a trips.

Admin

  • Admin can create a trip.
  • Admin can cancel a trip.
  • Both Admin and Users can see all trips.
  • View all bookings. An Admin can see all bookings, while user can see all of his/her bookings.
  • Admin can see all registered users

Author

Iyiola Osuagwu

About

WayFarer is a public bus transportation booking server.


Languages

Language:HTML 57.3%Language:JavaScript 34.3%Language:API Blueprint 8.4%