An application for booking tickets at the cinema. Implemented in the microservices architecture, using Docker and docker-compose.
Before you start
- Install Docker and Docker Compose
- Set up the connection to database in movie-service/src/config/db.js
- Set AMQP_URL variable in .env file (you can use a free 'Little Lemur' plan from CloudAMQP)
#start services
docker-compose up -d
#fill db with sample data
docker exec -it <MOVIE_SERVICE_CONTAINER_NAME> node src/init
After starting services web app is available on https://localhost:80
-
Browsing available movies at cinema
-
Buying tickets
Orders are stored in local database
-
Temporary reservations
Reservations are implemented by using Socket.io (each movie has own room -> each client subscribe only room/movie event which is actually browsed) and stored in-memory on api-gateway. To improve api scalability on production, reservations should be stored in distributed DB like Redis
-
Sending email with purchased ticket
Using fake SMTP service Ethereal
#rebuild containers
docker-compose build
#list all containers
docker-compose ps -all
- how to apply environment variables on container build stage docker/compose#1837 (comment)
- docker-compose build args (map vs list) docker/for-mac#2661 (comment)