Skip to content

hkholic13/movie

Repository files navigation

movie-tickets

An application for booking tickets at the cinema. Implemented in the microservices architecture, using Docker and docker-compose.

Architecture

How to run

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

Features

  • Browsing available movies at cinema

    Details of movies are fetched from external api's OMDb TMDb

  • 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

Development

Commands

#rebuild containers
docker-compose build

#list all containers
docker-compose ps -all

Useful links