WayFarer is a public bus transportation booking API server.
- User can sign up
- User can log in
- View all trips
- Book a seat on a trip
- View bookings
- Admin can add bus for a Trip
- Create a trip
- Cancel a trip
- View all trips
- View bookings for all trips
- Delete their bookings
- Filter trips by origin
- Filter trips by destination
- Specify seat numbers when making a booking
- TypeScript
- Node v18
- Express
- nodemon
- ts-node
- PostgreSQL
- ESLint
- Prettier
- Airbnb style guide
- Token Authentication
- Admin Authorization
- Prevents DOS attacks
- Limit body payload (
bodyParser) - Express rate limit dependency (
express-rate-limit)
- Limit body payload (
- Prevents XSS attacks
- Appropriate headers (
helmet) - Data Sanitization against XSS (
xss-clean) :TO-DO
- Appropriate headers (
- Jest with SuperTest
- Unit and integration testing
- Compiler: Babel
- Containerization: Docker
- GitHub Actions
- Clone the repository.
- Navigate to the project directory.
- Make sure you have Docker installed.
- Create a
.envfile with the required configurations. - Run
docker-compose buildto build the application. - Run
docker-compose upto start the application. - To run migrations for the tables, use
docker exec wayfarer-node-ts-server-1 npm run migrate up.
- Swagger (Todo)
To run the tests:
- Provide a DB URL link in the
.envfile. You can find a sample on the .env file in the root folder called.env.sample - Run migrations on the DB to create tables:
DB_URL=<test-db-connection string> npm run migrate up. - Run
npm run test.