Skip to content

Service oriented architecture realizing the core functionalities of Lotto leveraging concepts from cloud native development

Notifications You must be signed in to change notification settings

JoeG777/lotto_soa

Repository files navigation

lotto_soa

This congolmerate of services realizes a simple service oriented architecture of a lottery. Three main actions are available for execution:

  • /add_bet - a customer can register their own bet by supplying it to the endpoint
  • /trigger_draw - a draw for the winning-numbers can be initiated
  • /show_result - the results expressed by an attribute winning_class shows for each bet their profit

To test out each deployment some example calls are provided and documented in the example_call directory.

  1. Two services with one having a persistence layer

    customer_service is realized with a persistence layer in the form of NoSQL MongoDB-Datenbank with a corresponding adapter

  2. One of the service is realized with a hexagonal architecture

  3. How to install the application in a VM

  4. Dockerfiles and their execution strategy

  5. Docker Compose of entire application, execution strategy, NGNIX as load balancer

  6. Kubernetes Manifeste

  7. Automated Buildpipeline

    The build pipeline is realized with GitHub-Actions. The needed steps are described in the github-workflows. Their history of execution and builds can be seen here.

  8. Skizze der Service-Architektur Architecture Overview architecture overview

    Hexagonal Architecture of drawing_service drawing_service with hexa-architecture


Information referenced by the above instructions

Install application on a VM

  1. Install Python Install Python according to the offical documentation in version 3.9
  2. Install MongoDB according to the official documentation
  3. Install RabbitMQ according to the official documentation
  4. Install the application - Move the source code or artifacts into the ROM of the VM by cloning the repository or moving them manuall
  5. Setup the configuration for each of the sub-applications which in this project is done by passing or setting environment variables. Make sure the separate applications are reacheable by eachother for communication
  6. Execute all the single parts in separate processes

Docker commands for infrastructure services

  • MongoDB instance
docker run -p 27017:27017 \
    --rm \
    --env-file ../.env \
    --name mongodb \
    --mount source=cnd_mongodb_data,target=/data/db \
    --network=lotto_local \
    mongo:6.0.3
  • RabbitMQ instance
docker run -it \
    -p 5672:5672 \
    -p 15672:15672 \
    --rm \
    --mount source=cnd_rabbitmq_log,target=/var/log/rabbitmq/ \
    --mount source=cnd_rabbitmq_data,target=/var/lib/rabbitmq/ \
    --network=lotto_local \
    --name rabbitmq \
    rabbitmq:3.9-management

About

Service oriented architecture realizing the core functionalities of Lotto leveraging concepts from cloud native development

Topics

Resources

Stars

Watchers

Forks