The entire project is dockerized. To get started, follow these steps:
-
Install Docker: Ensure you have Docker installed on your machine.
-
Configure Environment Variables: Create a
.envfile in the root of your project directory with the following structure:db_user=your_db_user db_password=your_db_password db_host=your_db_host db_port=your_db_port db_name=your_db_name
- db_user: The username for your database connection. For example,
"postgres". - db_password: The password for your database connection. For example,
"postgres". - db_host: The hostname for the database service. Use
"database"as it corresponds to the Docker container name. - db_port: The port number on which your database server listens. For example,
5432. - db_name: The name of the database to connect to. For example,
"duke".
These variables configure the PostgreSQL database service that the project will use.
db_user=postgres db_password=postgres db_host=database db_port=5432 db_name=duke
- db_user: The username for your database connection. For example,
-
Run
duke-cli: To execute theduke-clicommand, use the following command:source ./duke-cli.shFor help and usage options, run:
source ./duke-cli.sh --help -
Run MyPy Tests: To perform type checking with MyPy, use the following command:
source ./mypy-tests.sh -
Run Backend: To start the backend service, use the following command:
source ./duke-cli.sh serve 0.0.0.0 80
The project includes the following Docker containers:
-
duke-cli: This container runs the
duke-clicommand-line interface. It is built from the providedDockerfileand depends on thedatabasecontainer. -
duke-database: This container runs a PostgreSQL database. It is configured with environment variables for database credentials and persists data using a Docker volume. It also includes a health check to ensure the database is ready.
The project follows Clean Architecture principles with the following package structure:
- domain: Corresponds to the entities/enterprise business rules layer.
- application: Corresponds to the use cases/application business rules layer.
- interface_adapters: Corresponds to the interface adapters layer.
- infrastructure: Corresponds to the frameworks/drivers layer.
If you'd like to set up a Python virtual environment for local development, follow these steps:
-
Create a Virtual Environment:
python3 -m venv venv
-
Activate the Virtual Environment:
source venv/bin/activate -
Install the Project Requirements:
pip install -r requirements.txt
This setup is useful during development.
© Made by Vladyslav Panik & Danylo Zahorulko for thesis project at the Technical University of Košice KPI FEI TUKE, 2024-2025