WayFarer is a public bus transportation booking server where a client can book a trip, view all his/her bookings and can cancel any if necessary. to understand more, visit the api documentation hosted on heroku at: WayFarer API Documentation
- User can sign up.
- User can sign in.
- Admin can create a trip.
- Admin can cancel a trip.
- Both Admin and Users can see all trips.
- Users can book a seat on a trip.
- View all bookings. An Admin can see all bookings, while user can see all of his/her bookings.
- Users can delete their booking.
- Admin can update a trip.
- Both user and admin can get a particular trip.
- Users can update their booking.
- Admin can create a bus.
- Both admin and users can get a bus.
- Admin can delete a bus.
- Admin can update a bus.
- 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.
Endpoints | Request Method | Request parameter |
---|---|---|
/api/v1/auth/signup | POST |
Endpoints | Request Method | Request parameter |
---|---|---|
/api/v1/auth/signin | POST |
Endpoints | Request Method | Request parameter |
---|---|---|
/api/v1/trips | POST | |
/api/v1/trips | GET | |
/api/v1/trips/:tripId | GET | tripId |
/api/v1/trips/:tripId | PATCH | tripId |
/api/v1/trips/:tripId | DELETE | tripId |
Endpoints | Request Method | Request parameter |
---|---|---|
/api/v1/bookings | POST | |
/api/v1/bookings | GET | |
/api/v1/bookings/:bookingId | GET | bookingId |
/api/v1/bookings/:bookingId | PATCH | bookingId |
/api/v1/bookings/:bookingId | DELETE | bookingId |
Endpoints | Request Method | Request parameter |
---|---|---|
/api/v1/buses | POST | |
/api/v1/buses | GET | |
/api/v1/buses/:busId | GET | busId |
/api/v1/buses/:busId | PATCH | busId |
/api/v1/buses/:busId | DELETE | busId |
URL: http://adc-wayfarer-andela.herokuapp.com/api/v1/auth/signup
Request Type: POST
Response:
{
"status": "Success",
"data": {
"id": 1,
"first_name": "John",
"last_name": "Richman",
"username": "Richman",
"email": "[email protected]",
"is_admin": 0,
"token": "eyJhbGciOiJIU..."
}
}
URL: http://adc-wayfarer-andela.herokuapp.com/api/v1/auth/signin
Request Type: POST
Response:
{
"status": "Success",
"data": {
"id": 1,
"first_name": "John",
"last_name": "Richman",
"username": "Richman",
"email": "[email protected]",
"is_admin": false,
"token": "eyJhbGciOiJIUzI1NiI..."
}
}
URL: http://adc-wayfarer-andela.herokuapp.com/api/v1/trips
Request Type: POST
Response:
{
"status": "Success",
"data": {
"id": 1,
"bus_id": 0,
"origin": "Yaounde",
"destination": "Lagos",
"trip_date": "2019-07-20T00:00:00.000Z",
"fare": 70000,
"status": 1
}
}
URL: http://adc-wayfarer-andela.herokuapp.com/api/v1/trips/2
Request Type: GET
Response:
{
"status": "Success",
"data": {
"id": 1,
"bus_id": 0,
"origin": "Yaounde",
"destination": "Lagos",
"trip_date": "2019-07-20T00:00:00.000Z",
"fare": 70000,
"status": 1
}
}
URL: http://adc-wayfarer-andela.herokuapp.com/api/v1/trips/2
Request Type: PATCH
Response:
{
"data": {
"id": 1,
"bus_id": 0,
"origin": 0,
"destination": 0,
"trip_date": 0,
"fare": 0,
"status": 0
},
"message": "Trip updated successfully"
}
URL: http://adc-wayfarer-andela.herokuapp.com/api/v1/trips/2
Request Type: DELETE
Response:
{
"status": "Trip deleted!",
"data": []
}
URL: http://adc-wayfarer-andela.herokuapp.com/api/v1/buses
Request Type: POST
URL: http://adc-wayfarer-andela.herokuapp.com/api/v1/buses/1
Request Type: GET
URL: http://adc-wayfarer-andela.herokuapp.com/api/v1/buses/1
Request Type: PATCH
URL: http://adc-wayfarer-andela.herokuapp.com/api/v1/buses/1
Request Type: DELETE
URL: http://adc-wayfarer-andela.herokuapp.com/api/v1/bookings
Request Type: POST
URL: http://adc-wayfarer-andela.herokuapp.com/api/v1/bookings/1
Request Type: GET
URL: http://adc-wayfarer-andela.herokuapp.com/api/v1/bookings/1
Request Type: PATCH
URL: http://adc-wayfarer-andela.herokuapp.com/api/v1/bookings/1
Request Type: DELETE