From 30c0e593ae197c15e1f7fa55ea047c34c69775f7 Mon Sep 17 00:00:00 2001 From: ITQ Date: Wed, 12 Feb 2025 11:37:44 +0300 Subject: [PATCH] feat: added READMEs for main services --- solution/services/backend/README.md | 109 +++++++++++++++++++++++ solution/services/telegram_bot/README.md | 83 +++++++++++++++++ 2 files changed, 192 insertions(+) create mode 100644 solution/services/backend/README.md create mode 100644 solution/services/telegram_bot/README.md diff --git a/solution/services/backend/README.md b/solution/services/backend/README.md new file mode 100644 index 0000000..49fa967 --- /dev/null +++ b/solution/services/backend/README.md @@ -0,0 +1,109 @@ +# AdNova Backend + +## Prerequisites + +Ensure you have the following installed on your system: + +- [Python](https://www.python.org/) (>=3.10,<3.12) +- [uv](https://docs.astral.sh/uv/) +- [Docker](https://www.docker.com/) (for containerized setup) + +## Basic setup + +### Installation + +#### Clone the project + +```bash +git clone https://gitlab.prodcontest.ru/2025-final-projects-back/devitq.git +``` + +#### Go to the project directory + +```bash +cd devitq/solution/services/backend +``` + +#### Customize environment + +```bash +cp .env.template .env +``` + +And setup env vars according to your needs. + +#### Install dependencies + +##### For dev environment + +```bash +uv sync --all-extras +``` + +##### For prod environment + +```bash +uv sync --no-dev +``` + +#### Running + +##### In dev mode + +Apply migrations: + +```bash +uv run python manage.py migrate +``` + +Start project: + +```bash +uv run python manage.py runserver +``` + +##### In prod mode + +Apply migrations: + +```bash +uv run python manage.py migrate +``` + +Start project: + +```bash +uv run gunicorn config.wsgi +``` + +## Containerized setup + +### Clone the project + +```bash +git clone https://gitlab.prodcontest.ru/2025-final-projects-back/devitq.git +``` + +### Go to the project directory + +```bash +cd devitq/solution/services/backend +``` + +### Build docker image + +```bash +docker build -t adnova-backend . +``` + +### Customize environment + +Customize environment with `docker run` command (or bind .env file to container), for all environment vars and default values see [.env.template](./.env.template). + +### Run docker image + +```bash +docker run -p 8080:8080 --name adnova-backend adnova-backend +``` + +Backend will be available on localhost:8080. diff --git a/solution/services/telegram_bot/README.md b/solution/services/telegram_bot/README.md new file mode 100644 index 0000000..7cff7f1 --- /dev/null +++ b/solution/services/telegram_bot/README.md @@ -0,0 +1,83 @@ +# AdNova Telegram Bot + +## Prerequisites + +Ensure you have the following installed on your system: + +- [Python](https://www.python.org/) (>=3.10,<3.12) +- [uv](https://docs.astral.sh/uv/) +- [Docker](https://www.docker.com/) (for containerized setup) + +## Basic setup + +### Installation + +#### Clone the project + +```bash +git clone https://gitlab.prodcontest.ru/2025-final-projects-back/devitq.git +``` + +#### Go to the project directory + +```bash +cd devitq/solution/services/telegram_bot +``` + +#### Customize environment + +```bash +cp .env.template .env +``` + +And setup env vars according to your needs. + +#### Install dependencies + +##### For dev environment + +```bash +uv sync --all-extras +``` + +##### For prod environment + +```bash +uv sync --no-dev +``` + +#### Running + +```bash +uv run python main.py +``` + +## Containerized setup + +### Clone the project + +```bash +git clone https://gitlab.prodcontest.ru/2025-final-projects-back/devitq.git +``` + +### Go to the project directory + +```bash +cd devitq/solution/services/telegram_bot +``` + +### Build docker image + +```bash +docker build -t adnova-telegram_bot . +``` + +### Customize environment + +Customize environment with `docker run` command (or bind .env file to container), for all environment vars and default values see [.env.template](./.env.template). + +### Run docker image + +```bash +docker run --name adnova-telegram_bot adnova-telegram_bot +```