Python 3.9 app coverage

ScreenShot

Description

The application processes sound files. Three functions: recognition, enhancement and separation. The application consists of backend and frontend parts.

Frontend

Based on Streamlit

Backend

Based on Fastapi

Usage

docker compose up -d --build

nginx starts on 80 port

Backend API Documentation:

http://0.0.0.0:80/docs/

Development

Install dev environment:

pip install -r app/requirements-dev.txt
pip install -r client/requirements.txt

Set necessary env variables:

export APP_PROJECT_NAME='AI Software Engineering'
export AUDIO_RATE=16000
export MAX_FILE_SIZE=1*1024*1024
export API_RECOGNITION_URI=http://0.0.0.0:8000/api/recognize

Check flake8:

flake8 app/

Run tests:

pytest

Check tests coverage:

pytest --cov app

Deploy

sudo su
sudo git clone https://github.com/brain4power/ai_software_engineering.git /opt/aise
  • build containers and start application
cd /opt/aise
docker compose up -d --build
  • enable the application to run on system boot
cp configs/prod/aise.service /etc/systemd/system/aise.service
systemctl daemon-reload
systemctl enable aise.service
systemctl start aise.service

Update server

sudo su
cd /opt/aise
git pull
docker compose up -d --build