Skip to content

itplamen/LotteryGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

194 Commits
 
 
 
 
 
 
 
 

Repository files navigation

LotteryGame

Practical assignment from Bede Gaming for the role of .NET Developer

A lottery game implemented as microservices with a SAGA orchestrator, where a human player and CPU players buy tickets, and winners are drawn randomly across three prize tiers: grand prize (50% of revenue), second tier (30% shared among 10% of tickets), and third tier (10% shared among 20% of tickets)

Alt Text

Technologies

  • Microservice Architecture
  • SAGA orchestration pattern
  • ASP.NET Core Web API
  • gRPC for service-to-service calls
  • Snowflake algorithm for unique ticket numbers
  • SQL Server
  • Entity Framework Core
  • MongoDB
  • CouchDB
  • Redis
  • Docker Compose
  • Automapper
  • NUnit

Docker Images:

https://hub.docker.com/r/itplamen/operativeservice/tags
https://hub.docker.com/r/itplamen/userdataservice/tags
https://hub.docker.com/r/itplamen/drawservice-workers
https://hub.docker.com/r/itplamen/drawservice
https://hub.docker.com/r/itplamen/wagerservice
https://hub.docker.com/r/itplamen/walletservice

docker-compose build --no-cache

# Check status
[+] Building 284.0s (105/105) FINISHED
[+] Building 6/6
 ✔ lotterygame-orchestrator.api     Built                                                                          0.0s
 ✔ lotterygame-consoleapp           Built                                                                          0.0s
...
...
docker-compose up -d sqlserver mongo couchdb walletservice.api wagerservice.api drawservice.api drawservice.workers redis orchestrator.api

# Check status
 ✔ Network lotterygame_backend          Created                                                                    0.1s
 ✔ Volume "lotterygame_mongo_data"      Created                                                                    0.0s
...
...
docker logs -f walletservice

# Check for applied migrations
Applying migrations...
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
      Executed DbCommand (683ms) [Parameters=[], CommandType='Text', CommandTimeout='60']
      CREATE DATABASE [WalletServiceDb];
...
...
Migrations successfully applied!
# Check logs
docker logs -f wagerservice
docker logs -f drawservice
docker logs -f drawservice.workers
docker logs -f orchestrator
...
...
docker-compose run --rm consoleapp

Alt Text

Databases

Alt Text

MongoDB (Compass): mongodb://127.0.0.1:27017/

Alt Text

Redis

Alt Text

About

Practical assignment from Bede Gaming for the role of .NET Developer

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors