Flask-Hexagonal is an opinionated study-oriented implementation of Python REST API using Hexagonal Architecture design.
- Built with Python ๐
- Allows switching Web Frameworks interchangeably (Flask <> Falcon)
- Allows switching Databases (Postgres <> Redis)
- Tooling for code styling
- Add unit tests
- Add integration tests
- Add test coverage
- More commands to CLI
- Add docs (OpenAPI)
To get a local copy up and running follow the Prerequisites and Setup sections. After that, you can start to build the new service.
Make sure you have a properly Python & Poetry environment.
-
Clone the repo
gh repo clone victormartinez/flask-hexagonal
-
Install the dependencies
cd flask-hexagonal/ poetry install
-
Edit flask_hexagonal/main.py and choose the web framework
-
Run project
make run
curl -X POST http://127.0.0.1:5000/api/v1/templates/ -d '{"name": "Online Contract Template", "external_id": "16250ce4-0f9c-4c7c-b333-beef66646516", "tokens": ["CONTRACT_ID", "ISSUER_NAME"]}' -H "Content-Type: application/json"
curl -X POST http://127.0.0.1:5000/api/v1/templates/
python -m flask_hexagonal.framework.cli list-templates --source memory
python -m flask_hexagonal.framework.cli list-templates --source database
make unit-test
make integration-test
make help
Pull requests are welcome! Before you open a pull request, make sure the code follow our code style and tests are passing:
make format
make unit-test
make integration-test
Please, use Conventional Commits as framework to build commit messages.