Coder Social home page Coder Social logo

flask-hexagonal's Introduction

flask-hexagonal

Flask-Hexagonal is an opinionated study-oriented implementation of Python REST API using Hexagonal Architecture design.

Features

  • Built with Python ๐Ÿ
  • Allows switching Web Frameworks interchangeably (Flask <> Falcon)
  • Allows switching Databases (Postgres <> Redis)
  • Tooling for code styling

Next Steps

  • Add unit tests
  • Add integration tests
  • Add test coverage
  • More commands to CLI
  • Add docs (OpenAPI)

Getting Started

To get a local copy up and running follow the Prerequisites and Setup sections. After that, you can start to build the new service.

Prerequisites

Make sure you have a properly Python & Poetry environment.

Setup

  1. Clone the repo

    gh repo clone victormartinez/flask-hexagonal
  2. Install the dependencies

    cd flask-hexagonal/
    poetry install

Usage

Run in development mode

  1. Edit flask_hexagonal/main.py and choose the web framework

  2. Run project

    make run

Populate database

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"

Retrieve data

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

Run unit tests

make unit-test

Run system tests

make integration-test

Help

make help

Contributing

Requirements

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

Commit recommendations

Please, use Conventional Commits as framework to build commit messages.

flask-hexagonal's People

Contributors

victormartinez avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.