-
Notifications
You must be signed in to change notification settings - Fork 0
Backend
We decided to use Flask for a CV service because it is lightweight and synchronous (CV is a cpu-bound task).
Service logic now use Fabric pattern and Cain of responsibility pattern.
We add swagger to have easy access to the routes. Now this service only has one route, which takes an image and return color of face skin (using OpenCV see).
We are going to add more routes to this service and tests.
We decided to use Django as a service for the admin panel because it has the most customizable and useful admin panel. We will add mock-data generation in this service in the future.
To generate mock data run python manage.py gen_data
We decided to use FastApi as one of the fastest and useful framework. As ORM we used a new library called SQL models. It contains sqlalchemy and pydantic model in one model.
With this service you can:
- get vendor info by id
- get all vendors
- get product info by id
- get all products
- get products by color
This server has API specification (check another Wiki page called Vendor API)
In the current configuration, Nginx serves static files from Django admin and acts like a proxy server for it. But it'll change in the future (for security reasons).
We created a separate Dockerfile for the DB and SQL scheme files. The reason for that is that we want to create or DB as the container starts. And we want to upload this configuration to the docker hub.
You can check ER diagram