Skip to content

This is an example project based on the Spiral Framework and GRPC microservices.

Notifications You must be signed in to change notification settings

spiral/ticket-booking

Repository files navigation

Demo application - Ticket booking system

Ticket booking

The ticket booking system is built on the Spiral Framework, a high-performance PHP framework that allows developers to create reusable, independent, and easy-to-maintain services. In this demo application, you can find an example of using RoadRunner's gRPC plugin to create and consume gRPC services.

You can purchase tickets using a fake payment gateway in this demo system. You can also view and manage your bookings and receive notifications about your tickets and transactions. It's a great way to get a feel for how a real ticket booking system works without any of the actual commitment (or expense).

To ensure the best performance, reliability, and observability, we have used several powerful tools and technologies such as Opentelemetry, Centrifugo, RoadRunner, Grafana, Bidrdog, Buggregator, and Temporalio. These help us understand how the system behaves, identify and fix issues, and optimize the resources.

Grafana dashboard

Our demo ticket booking system is a great example of how Spiral Framework and other tools can be used to build a modern and performance-driven application. We hope you have a blast using it and learning more about the capabilities of Spiral Framework and the other tools we've used.

Happy (fake) ticket shopping!

Requirements

  • PHP 8.1
  • composer
  • docker

Installation

Clone project into a desired folder

Run console commands

docker compose up -d

Services dashboards

Project structure

  • frontend - SPA GUI
  • centrifugo - Centrifugo API
  • web - REST API
  • users - GRPC microservice. It's responsible for user management and auth tokens management. Works only with database.
  • cinema - GRPC microservice. It's responsible for movies and reservation. Works with database and temporal.
  • payment - GRPC microservice. Fake payment gateway. It's receives requests for money charging and responses with receipt.
  • shared - Shared package for all microservices. It contains common classes, proto files and compiler, DTO's, GRPC clients, e.t.c. docker-compose.yaml contains all necessary containers to run project.

Database

  • Connection address: 127.0.0.1:5432
  • Username: homestead
  • Password: secret
  • Database: homestead

ticket reservation

TODO

  • Register stripe in sandbox mode
  • Book and charge before 15 min screening. User will have the ability to cancel ticket.
  • Schema of services