A public transportation booking server that helps in easing the stress of transportation
This instructions will help you get started in running the API
To run this program you need to have:
- NodeJs v10.16.0
- NPM
- Postgresql
- Git
- Postman or any other app to test endpoints
- Clone the repo and cd into the directory
>> git clone https://github.com/sa-ma/WayFarer.git
>> cd Wayfarer
- Install dependencies
npm install
- Create an .env file using env.sample as a sample
- run
npm run migrations
to seed database tables - run
npm run build
to transpile the project - run
npm start
to start the local server - Use postman to access the server and on
http://localhost:3000
and other endpoints
- User can sign up
- User can sign in
- Admin can create a trip
- Admin can cancel a trip
- Admin and Users can see all trips
- Users can book a seat on trip
- Admin can see all bookings and User can see all his/her bookings
- Users can delete their bookings
- Admin and Users can filter trips based on origin or destination
To run test run npm test
command.
The test covers all the specified endpoints
This application was deployed to the following:
- Heroku : API endpoints
- Pivotal Tracker : Project Management
- Documentation : API Documentation
METHOD | DESCRIPTION | ENDPOINTS |
---|---|---|
POST | User's Sign up | /api/v1/auth/signup |
POST | User's Sign in | /api/v1/auth/signin |
POST | Admin can create a trip | /api/v1/trips |
PATCH | Admin can cancel a trip | /api/trips/:tripId |
GET | Admin and users can see all trips | /api/v1/trips |
POST | Users can book a seat on a trip | /api/v1/bookings |
GET | Admins and Users can see all bookings | /api/v1/bookings |
DELETE | Users can delete their bookings | /api/v1/bookings |
GET | Admins & Users can get trips by origin | /api/v1/trips?origin=anything |
GET | Admins & Users can get trips by destination | /api/v1/trips?destination=anything |
This project is licensed under the MIT License - see the LICENSE.md file for details
- Samaila Bala - SA-MA
- Andela (For the opportunity to do this)
- All the wonderful people who take out time to create awesome tutorials.