Skip to content

Kellswork/wayfarer-node-ts

Repository files navigation

Wayfarer

CI Test

WayFarer is a public bus transportation booking API server.

Table of Contents

Features

Implemented:

User functionality:

  • User can sign up
  • User can log in
  • View all trips
  • Book a seat on a trip
  • View bookings

Admin functionality:

  • Admin can add bus for a Trip
  • Create a trip
  • Cancel a trip
  • View all trips
  • View bookings for all trips

Planned

Admin functionality:

User functionality:

  • Delete their bookings
  • Filter trips by origin
  • Filter trips by destination
  • Specify seat numbers when making a booking

Technologies

Language

  • TypeScript
  • Node v18

Framework

  • Express

Debugging

  • nodemon
  • ts-node

Database

  • PostgreSQL

Logging ( TO-DO )

Linting and Code formatting

  • ESLint
  • Prettier
  • Airbnb style guide

Security

  • Token Authentication
  • Admin Authorization
  • Prevents DOS attacks
    • Limit body payload (bodyParser)
    • Express rate limit dependency (express-rate-limit)
  • Prevents XSS attacks
    • Appropriate headers (helmet)
    • Data Sanitization against XSS (xss-clean) :TO-DO

Testing

  • Jest with SuperTest
  • Unit and integration testing

Deployment

  • Compiler: Babel
  • Containerization: Docker

Continuous Integration

  • GitHub Actions

Usage

Installation and Setup

  1. Clone the repository.
  2. Navigate to the project directory.
  3. Make sure you have Docker installed.
  4. Create a .env file with the required configurations.
  5. Run docker-compose build to build the application.
  6. Run docker-compose up to start the application.
  7. To run migrations for the tables, use docker exec wayfarer-node-ts-server-1 npm run migrate up.

API Documentation

  • Swagger (Todo)

Testing

To run the tests:

  1. Provide a DB URL link in the .env file. You can find a sample on the .env file in the root folder called .env.sample
  2. Run migrations on the DB to create tables: DB_URL=<test-db-connection string> npm run migrate up.
  3. Run npm run test.

About

WayFarer is a public bus transportation booking API server.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published