https://github.com/Kharacternyk/paper-tactics
The backend for www.paper-tactics.com — a web application to play a pen-and-paper game with other people around the world.
https://github.com/Kharacternyk/paper-tactics
aws-lambda clean-architecture game hexagonal-architecture pen-and-paper
Last synced: about 2 months ago
JSON representation
The backend for www.paper-tactics.com — a web application to play a pen-and-paper game with other people around the world.
- Host: GitHub
- URL: https://github.com/Kharacternyk/paper-tactics
- Owner: Kharacternyk
- License: agpl-3.0
- Created: 2021-07-10T16:22:54.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-03-22T18:58:32.000Z (about 1 year ago)
- Last Synced: 2024-03-22T20:02:48.194Z (about 1 year ago)
- Topics: aws-lambda, clean-architecture, game, hexagonal-architecture, pen-and-paper
- Language: Python
- Homepage: https://www.paper-tactics.com
- Size: 274 KB
- Stars: 21
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- stars - Kharacternyk/paper-tactics - The backend for www.paper-tactics.com — a web application to play a pen-and-paper game with other people around the world. (Python)
README
# Paper Tactics
This is the backend for www.paper-tactics.com.
[The frontend is also open source.](https://github.com/Kharacternyk/paper-tactics-pwa)## Architecture
The application has borrowed the concepts of a _port_ and an _adapter_ from the
[hexagonal architecture]()
and the concepts of a _use case_ and an _entity_ from the
[clean architecture](https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html). The dependency graph looks like this:
## Deployment
The production runs on AWS as a few lambdas,
a few DynamoDB tables and a WebSocket AWS API Gateway.
A CloudFormation template and the lambdas are within the `aws/` directory.
A lambda instantiates adapters, parses requests, and invokes a use case.## Development
`app.py` is an application for local testing.
It requires `bidict`, `websockets` and `nest-asyncio` from PyPI.
The [frontend](https://www.paper-tactics.com) can connect to your locally run server
by selecting _Localhost_ from the server drop-down.## Testing
Entity tests require `pytest` and `hypothesis`.
AWS adapter tests also require `docker`, `moto` and `boto3`.
Most of the tests check a lot of random inputs (property based, `hypothesis`),
so it's best to run them selectively.