way-farer
Style guide
Airbnb (Javascript style guide)
Tech stack
Features
- Users can create an account and log in.
- Authenticated users can update their profile
- Authenticated users can view all trips.
- Authenticated users can view all bookings.
- Authenticated admins can create trips.
- Authenticated admins can update trips.
- Authenticated admins can delete trips.
- Authenticated users can book trips.
- Authenticated users can edit bookings.
- Authenticated users can delete bookings.
- Authenticated users can search for trips by origin or destination or both.
Installing
Prerequisites
Ensure you have NodeJS installed by entering node -v
on your terminal
If you don't have NodeJS installed go to the NodeJS Website, and follow the download instructions
Ensure you have Postgresql server installed on your local machine by entering postgres -V
on your terminal
If you don't have PostgreSQL installed, go to the PostgreSQL website and follow the download instructions
To install this app
git clone https://github.com/EphraimDev/way-farer.git
cd into the project folder and install the required dependencies
npm install
Set up PostgreSQL database
Open the pgAdmin app on your local machine and create a database
Create a .env
file by running cp .env.sample .env
on your terminal
Update your .env
file with the necessary informations
Create tables using your terminal
npm run db:migrations
Seed the database
npm run db:seed
Run server
npm run start:dev
Running the tests
To run test cases
npm run test:db
To view the documentation
localhost:4000
Working Routes
Endpoint | Functionality |
---|---|
POST api/v1/auth/signup | Create new user |
POST api/v1/auth/signin | Sign in user |
POST api/v1/bus | Create new buss |
POST api/v1/trips | Create new trip |
DELETE api/v1/trips/:tripId | Cancel a trip |
GET api/v1/trips | Fetch all trips |
GET api/v1/trips/search? | Search for trips by origin or destination |
PUT api/v1/trips/:tripId | Update a trip |
POST api/v1/bookings | Book a trip |
GET api/v1/bookings | Fetch all bookings |
DELETE api/v1/bookings/:bookingId | Cancel a booking |
License
This projects is under the ISC LICENSE