Dicery (Backend API)
Dicery is a dice-rolling app where a group of friends can create their own room, roll the dice, and have their dice results broadcasted to everyone in the same room.
Frontend Github Repository: paxcodes/dicery_app
Built with FastAPI | Deployed in an AWS EC2 instance using principles in dockerswarm.rocks |
CI/CD using buddy.works
About
The API receives requests to:
- create a room
- add members to a room
- close a room
- broadcast dice results to users subscribed in a room using Server-Sent Events
Development
To setup a development environment:
- Install Docker
- Navigate to the project's root directory / the directory where docker-compose files are located
- Run
docker-compose up
Tests
To run tests,
- Initially, run:
DOMAIN=backend sh ./scripts/test-local.sh
- For subsequent tests, run
docker-compose exec backend /app/tests-start.sh
You can pass pytest arguments at the end of the previous command. E.g.
DOMAIN=backend sh ./scripts/test-local.sh -k test_it_also_deletes_rows_in_room_players
docker-compose exec backend /app/tests-start.sh -k test_it_also_deletes_rows_in_room_players
License
See LICENSE file in this repo.