https://github.com/spiral/ticket-booking
This is an example project based on the Spiral Framework and GRPC microservices.
https://github.com/spiral/ticket-booking
buggregator grpc microservices opentelemetry roadrunner spiral spiral-framework
Last synced: 9 months ago
JSON representation
This is an example project based on the Spiral Framework and GRPC microservices.
- Host: GitHub
- URL: https://github.com/spiral/ticket-booking
- Owner: spiral
- License: mit
- Created: 2022-06-29T18:01:06.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-06-19T00:39:54.000Z (almost 2 years ago)
- Last Synced: 2025-06-19T23:05:58.721Z (9 months ago)
- Topics: buggregator, grpc, microservices, opentelemetry, roadrunner, spiral, spiral-framework
- Language: PHP
- Homepage: https://spiral.dev/
- Size: 33.6 MB
- Stars: 71
- Watchers: 8
- Forks: 10
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Demo application - Ticket booking system

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.

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
```bash
docker compose up -d
```
## Services dashboards
- http://127.0.0.1:3000/ - Ticket booking system
- http://127.0.0.1:9411/ - Zipkin
- http://127.0.0.1:3001/ - Grafana (login: `admin`, password: `secret`)
- http://127.0.0.1:8088/ - Temporal
- http://127.0.0.1:8089/ - Centrifugo
- http://127.0.0.1:8003/ - Buggregator
- http://127.0.0.1:8002/ - Birddog
## 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`

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