WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

HadesGuard/concert-booking-backend

Repository files navigation

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Support us

Description

Nest framework TypeScript starter repository.

Monorepo Structure

This project uses a monorepo structure with multiple services:

apps/
  auth-service/
  concert-service/
  booking-service/
  notification-service/
libs/

Development

  • Install dependencies:
    npm install
  • Start all services in development mode (with hot-reload):
    npm run start:dev

Production

  • Build all services:
    npm run build
  • Start all services in production mode:
    npm run start:prod

Docker Production

  • Build and start all services with Docker:
    docker-compose up --build

Environment Variables

  • Each service has its own .env file in apps/<service>/.env.
  • Example files: apps/auth-service/.env.example, etc.
  • Copy .env.example to .env and update values as needed.

API Testing with Postman

A ready-to-use Postman Collection is provided for API testing: Concert Booking API.postman_collection.json.

How to use:

  1. Open Postman and click "Import".
  2. Select the file Concert Booking API.postman_collection.json from the project root.
  3. Create a new environment in Postman and add these variables:
  4. Select the environment and run requests for each service.

This allows you to test Auth, Concert, and Booking APIs independently, even if they run on different ports or hosts.

Load Testing with k6

This project includes a k6 load test to simulate high-concurrency booking scenarios and ensure the system prevents overbooking and duplicate bookings.

Scripts location

  • load-test/booking-test.js: Main k6 test script for booking concurrency
  • load-test/setup.js: Script to initialize test data (users, concerts, seat types)

How to run the load test

  1. Make sure all services (auth, concert, booking, notification, MongoDB, Redis) are running (e.g., via docker-compose up).
  2. Install k6 if you haven't:
    brew install k6 # macOS
    # or see https://k6.io/docs/getting-started/installation/
  3. Run the load test:
    k6 run load-test/booking-test.js

Interpreting results

  • The test simulates 1,000 concurrent users booking tickets.
  • Key metrics:
    • booking_errors: Rate of failed bookings (should be low if system is correct)
    • http_req_failed: Rate of failed HTTP requests
    • http_req_duration: Response time percentiles
  • Check the summary at the end for threshold violations and overall system performance.

Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

Stay in touch

License

Nest is MIT licensed.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published