I created a service that powers a lottery system, incorporating several key features:
- It allows users to easily register and participate in the lottery.
- Participants can submit multiple entries for any ongoing lottery until it closes.
- Each day at midnight, the system automatically closes the current lottery and selects a random winner from that day’s entries.
- Users can check the winning entry for any date they choose.
- The service includes persistent storage to retain all lottery-related data.
- At the project's root, create .env and copy .env.local values for local deployment
- docker-compose build
- docker-compose up -d
- Go to http://localhost:8001/docs to start your journey or docs/Lottery.postman_collection.json there is the postman collection with the all endpoints requests/response
- Install the all requirements + the dev.txt requirements:
- pip install -r requirements/requirements.txt
- pip install -r requirements/dev.txt
- Go to /app/tests
- Create .env and copy .env.test values for running the tests
- and run docker-compose up -d
- Go back to /app and run the test script ./tests/run_test.sh