Car-pooling
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 add vehicles.
- Authenticated users can update vehicle specs.
- Authenticated users can delete vehicles.
- Authenticated admins can delete vehicles.
- Authenticated users can view all trips.
- Authenticated users can create trips.
- Authenticated users can cancel trip their own trip.
- Authenticated users can start trip.
- AUthenticated users can modify a trip that hasn't started.
- Authenticated admins can cancel trips.
- Authenticated users can book trips.
- Authenticated users can modify bookings.
- Authenticated users can cancel bookings.
- Authenticated users can view all bookings belonging to them.
- Authenticated admins can cancel bookings.
- Authenticated admins can view all bookings.
- Authenticated users can search for trips by origin, destination or both.
- Authenticated admins can delete a user profile
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/car-pooling.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
Run server
npm run start:dev
Running the tests
To run test cases
npm test
To view the documentation
Working Routes
Endpoint | Functionality |
---|---|
POST api/v1/auth/signup | Create new user |
POST api/v1/auth/signin | Sign in user |
PATCH api/v1/user/:userId | Modify user data |
GET api/v1/user/:userId | Fetch user data |
POST api/v1/vehicles | Create new vehicle |
PATCH api/v1/vehicles/:vehicleId | Fetch vehicle data |
GET api/v1/vehicles/:vehicleId | Fetch all trips |
License
This projects is under the ISC LICENSE