|
1 | | -# AI-помощник для подготовки к интервью Middle Python-разработчика |
2 | | -Под капотом: aiogram, PostgreSQL, Redis, GigaChat |
| 1 | +# AI assistant for preparing for a Middle-level Python developer interview |
| 2 | +Under the hood: aiogram, PostgreSQL, Redis, GigaChat |
3 | 3 |
|
4 | | -## Live-демо |
| 4 | +## Live demo |
5 | 5 | https://t.me/pyainter_bot |
6 | 6 |
|
7 | | -## Инструкции |
| 7 | +## Instructions |
8 | 8 |
|
9 | | -### Инструкция для быстрого запуска в контейнере |
10 | | -1. Скачать исходники из репозитория |
11 | | -2. Создать файл `.env` из шаблона `template.env` |
12 | | -3. Запустить `docker compose up --build` для сборки образа |
13 | | -4. Для первого запуска написать `/start`, для последующих — `/get_question` в боте или воспользоваться кнопками |
| 9 | +### Instructions for quick launch in a container |
| 10 | +1. Download the source code from the repository |
| 11 | +2. Create a .env file from the template .env |
| 12 | +3. Run docker compose up --build to build the image |
| 13 | +4. For the first run, type /start; for subsequent runs, type /get_question in the bot or use the buttons |
14 | 14 |
|
15 | | -### Инструкция для быстрого запуска локально |
16 | | -1. Указать в .env тестовый `TG_TOKEN` и `DB_HOST=localhost` для локалки |
17 | | -2. Запустить контейнер базы данных: |
18 | | -`docker run --name pg-container -e POSTGRES_DB=inter_db -e POSTGRES_USER=inter_user -e POSTGRES_PASSWORD=inter_password -p 5432:5432 -d postgres:15` |
19 | | -3. Запустить контейнер Redis: |
| 15 | +### Instructions for quick launch locally |
| 16 | +1. Specify a test TG_TOKEN in .env and DB_HOST=localhost for localhost |
| 17 | +2. Start the database container: |
| 18 | +docker run --name pg-container -e POSTGRES_DB=inter_db -e POSTGRES_USER=inter_user -e POSTGRES_PASSWORD=inter_password -p 5432:5432 -d postgres:15` |
| 19 | +3. Start the Redis container: |
20 | 20 | `docker run -d -p 6379:6379 --name redis_local redis_local` |
21 | | -4. Скачать сертификат Минцифры (на Mac): |
| 21 | +4. Download the Ministry of Digital Development, Communications and Mass Media certificate (on Mac): |
22 | 22 | `curl -k "https://gu-st.ru/content/Other/doc/russian_trusted_root_ca.cer" -o russian_trusted_root_ca.cer` |
23 | | -5. Установить сертификат: |
| 23 | +5. Install the certificate: |
24 | 24 | `cat russian_trusted_root_ca.cer >> $(python -m certifi)` |
25 | | -6. Запустить main.py, можно прямо из консоли |
| 25 | +6. Run main.py, you can do this directly from the console. |
26 | 26 |
|
27 | | -### Профилирование кода |
28 | | -1. Для проверки асинхронности можно запустить `pyinstrument`: |
| 27 | +### Code Profiling |
| 28 | +1. To check for asynchrony, you can run `pyinstrument`: |
29 | 29 | `PYTHONPATH=. pyinstrument src/main.py -t -r RENDERER` |
30 | | -2. Для общего профилирования — `scalene`: |
31 | | -`scalene --cpu --memory --cli src/main.py` |
| 30 | +2. For general profiling, use `scalene`: |
| 31 | +`scalene --cpu --memory --cli src/main.py` |
0 commit comments