This repository contains source code of backend system for 3D Avatar Generation service. It consists of four parts:
- HTTP API made with FastAPI. It is used for interaction with frontend.
- RabbitMQ message broker. It is used for communication with ml-workers (aka ml-agents)
- PostgreSQL database. It is used for storing user information, tasks and media metadata
- MinIO S3 storage. It is used for storing media data, such as images uploaded by users and generated 3D models
Overall architecture diagram is show below
-
Go to project root
-
Create environment file using:
make env-
Open newly created
.envfile and initializeSECRET_KEYandREFRESH_SECRET_KEYvariables usingopenssl rand -hex 32command -
If necessary, edit any other variables in
.envfile -
Run deployment to Docker Compose:
make deploy - If you don't have any alembic revisions, generate one using:
make revision- Migrate database to your revision:
make migrate- API Swagger is accessible via
http://{APP_HOST}:8080/docslink
.
|__app # FastAPI application
|
|__cmd # Convenient scripts for running parts of project
| |__migrator # Database migrator
| |__service # FastAPI service
| |__worker # API Worker for listening {RABBITMQ_TASKS_RESULTS_QUEUE} queue
|
|__config # Environment variables parser
|
|__deployment # Docker files
| |__docker-compose.yml # Defines all project's containers
| |__Dockerfile # for building FastAPI service and API Worker into Docker images
|
|__src # source code of FastAPI service
| |__data # Data layer - Communication with database, RabbitMQ, MinIO
| |__domain # Domain layer - bussiness logic (proccessing data from Data Layer and passing it to Presentation Layer)
| |__presentation # Presentation layer - handles API requests and responses
|
|__worker #Source code of API Worker