This is a simple igaming platform, made with flask and mongodb. The idea was to keep it simple and have all the game logic under one class (Game class). This configuration enables a lot of possible deploy architectures, it could be runing behind an http api (as the example here), with ZeroMQ or run serverles on AWS with Api Gateway + AWS Lambda. Also the data model design was made having in mind that every transaction in the wallet must be immutable. This improves the data consistency and also enables the possibility of having a cron process (with Celery), that every day collects all the data for every user, moves that rows to a 'historical' db and writes a resume of the latest user account status. This way will be super easy to scale, even with out cache.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
MongoDB, Python 2.7 and Virtualenv
Clone the project, create the env and install the requirements
git clone https://github.com/matiasbastos/igaming.git
cd igaming
virtualenv env
source env/bin/activate
pip install -r requirements.txt
Create admin:
fabmanager create-admin --app 'cli'
Run it:
python run.py
To run the tests execute:
py.test -v
Currently is deployed using Gunicorn and Nginx on the url sent on the mail.
- Flask - The web framework used
- MongoEngine - Mongo Lib for Python
- Flask App Builder - Used to generate the skeleton
- Matias Bastos - LinkedIn