Skip to content

Latest commit

 

History

History
117 lines (108 loc) · 4.7 KB

README.md

File metadata and controls

117 lines (108 loc) · 4.7 KB

Bookify - Reservation Booking System - Backend

A production-grade reservation booking system with various features, including a scalable backend with NestJS microservices, Kubernetes deployment on Google Cloud, JWT authentication, Stripe payment integration, email notifications, and RabbitMQ message processing. Implemented CI/CD pipelines and production Dockerfiles for each microservice.

For the Frontend click here

For the Restauranteer API (AWS Lambda Function) click here

Software Engineering Principles

  • SOLID Principles: The project follows the SOLID principles, ensuring that the codebase is modular, maintainable, and scalable.
  • DRY (Don't Repeat Yourself): The codebase emphasizes the DRY principle by minimizing code duplication. Reusable components and services are employed to avoid redundancy and maintain code consistency.
  • Data Validation: Data validation is implemented at multiple levels of the application to ensure data integrity and security. Input validation is performed on the server-side to prevent invalid data from being processed.

Key Features

  • Scalable backend architecture
  • Event Driven Architecture
  • Creation of a monorepo which houses multiple NestJS applications (Micro-services) within a single repository.
  • Creation of a common library for code sharing across multiple applications.
  • Implementation of end-to-end (E2E) testing framework with Jest for NestJS microservices.
  • Microservices implementation using NestJS
  • Integration with Stripe for payment processing
  • Email notifications using nodemailer and Gmail
  • Data persistence with MongoDB
  • Asynchronous message processing with RabbitMQ
  • Automated CI/CD pipeline with CloudBuild
  • Application running on Google GKE
  • Load balancer provision for high availability
  • Creation of production-ready Dockerfiles and package.json for each microservice.

Bookify - Architecture

API Paths

Here are the main API endpoints with examples of how to use them:

Reservations Resource

This resource can be accessed only by authenticated users
  • Retrieve all of the existing reservations for resturants with assigned users

  • GET /reservations
  • Retrieve a specific reservation:

  • GET /reservations/:reservation_id
  • Create a new reservation (the userId will be automatically assigned):

  • POST /reservations
    Example request body:
    {
    	"startDate": "02-01-2021",
    	"endDate": "02-01-2023",
    	"restaurantId": "f24e3777-f167-4920-9652-15fefcd73b23",
    	"reservationDate": "02-01-2023 Monday 18:00 PM",
    	"charge": {
    		"amount": 199,
    		"card": {
    			"cvc": "413",
    			"exp_month": 12,
    			"exp_year": 2027,
    			"number": "4242 4242 4242 4242"
    		}
    	}
    }
    
  • Update reservation's information:

  • PUT /reservations/:reservation_id
    Example request body:
    {
       "startDate": "02-01-2021",
       "endDate": "02-01-2023",
       "reservationDate": "02-01-2023 Monday 18:00 PM",
    }
    
  • Delete a reservation:

  • DELETE /reservations/:reservation_id


    Auth Resource

    By logging in you receive a JWT Token which is signed by the server and an HTTP cookie is returned and can access the rest of the resources.

  • Logging into account:

  • POST /auth/login
    Example request body:
    {
    	"email": "[email protected]",
    	"password": "Password123!"
    }
    
  • Logging out account:

  • POST /auth/logout

    Users Resource (Included within Auth Resource)

  • Sign-Up / Create a new user for the Bookify App:

  • POST /users
    Example request body:
    {
    	"email": "[email protected]",
    	"password": "Password123!"
    }