revuel / challenge-amenitiz-backend

Backend simple solution to the provided challenge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Challenge amenitiz.io


Requirements

  • python 3.7.z
  • pip
  • virtualenv

Project Structure

  • src
    • application (Business Logic Layer)
    • domain (Domain Layer)
    • infrastructure (Infrastructure Layer)
    • presentation (Presentation Layer)
  • tests
    • unit
      • application
      • domain
      • infrastructure
      • presentation

Details

  • App has been organised this way in an attempt to reflect Hexagonal Architecture in the code base
  • The Domain Layer has been implemented with SQL Alchemy declarative Base style
  • The Infrastructure layer SQL Alchemy along its ORM has been chosen
  • The Presentation layer has been implemented using FastAPI
  • The Business Logic Layer consists in a set of services where each method is executed in a transactional fashion (see Transaction class)

The heart of the challenge can be found at RuleEngine class

The idea behind this approach is to keep each layer as much as isolated as possible.

Run

Create a virtual environment

Just follow virtualenv documentation

Install requirements

  1. Enable virtualenv
# From project's root directory (assuming virtualenv was named 'venv')
source venv/bin/activate
# From project's root directory
pip install -r requirements.txt

Launch app

# From project's root directory
python -m src.main

Now you can visit Swagger's UI

About

Backend simple solution to the provided challenge


Languages

Language:Python 100.0%