- ...
- Python 3.10.11
- MariaDB 10.4
To clone this project, run the following command:
git clone https://github.com/isnandar1471/semaphore-api.git
To install all necessary dependencies, run:
pip install -r requirements.txt
Important dependencies:
tensorflow
: For reading imported models.bcrypt
: For password encryption.sqlalchemy
: For ORM.sqlalchemy-seeder
: For seeding.alembic
: For database version control.fastapi
: For REST API.starlette
: For ASGI framework.uvicorn
: For ASGI server.python-dotenv
: For reading env files.pymysql
: For MySQL connection.pydantic
: For data validation.pyjwt
: For generating JWT.pillow
: For image processing.numpy
: For image conversion.
sqlalchemy
requirespymysql
, but it is not automatically installed.- Some dependencies require
pillow
.
cp .env.example .env
Using JWT for authentication.
To create a new migration:
alembic revision -m "<migration_description>"
To run migrations up to a specific version:
alembic upgrade <version>
To run migrations to the latest version:
alembic upgrade head
To rollback x number of migrations:
alembic downgrade <-x>
To seed the database, run the following command:
python -m src.seeder.seeder
To run the application, use:
python main.py
This application can also be run in Docker using the provided scripts in the docker folder.
A guide for installing all available packages from requirements.txt can be found here.
autoflake --in-place --remove-all-unused-imports <filepath>
isort <filepath>
To maintain code quality, use pylint as a linter.