-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/RaZoom-Team/meeting-2107
- Loading branch information
Showing
54 changed files
with
594 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Знакомства 2107 | ||
|
||
![image](https://github.com/user-attachments/assets/8b00b471-8251-4967-864a-5c6d6598bc94)<br> | ||
**Telegram Web App** для поиска пары на вальс (и не только) для старшеклассников **ГБОУ Школа 2107** | ||
|
||
## Настройка | ||
|
||
Переименуйте `.env.example` в `.env` и обновите в нём следующие значения: | ||
- **DB_HOST**, **DB_PORT**, **DB_USER**, **DB_PASSWORD**, **DB_NAME** замените на свои значения подключения к базе данных или поставьте на стандартные (например postgres, postgres, postgres), потому что порты БД не выведены в сеть и остаются внутри закрытой докер сети. | ||
- **TG_TOKEN** - токен вашего ТГ бота | ||
- **TG_ADMIN_CHAT** - ID закрытого админ-чата формата `-100XXXXXXXXXX` | ||
- Поля, которые при необходимости можно удалить из .env | ||
- **TG_CHANNEL_ID** - ID канала, подписка на который необходима для использования аппа. Формата `-100XXXXXXXXXX` | ||
- **TG_CHANNEL_LINK** - ссылка на канал формата `t.me/channel` | ||
- **API_URL** - Итоговый URL API сервиса *(https://example.com/api)* | ||
- **ROOT_PATH** - Коренной путь для API, используемый после проксирования *(в случае если архитектура изменяться не будет, оставить на текущее)* | ||
- **LOKI_URL** - на данный момент не используется | ||
- **RABBIT_URL** - путь до RabbitMQ *(в случае если архитектура изменяться не будет, оставить на текущее)* | ||
|
||
Бот должен быть добавлен в админ чат, выдача ему админ-прав необязательна, его команды будут работать только в этом чате | ||
Бот также должен быть добавлен в канал, в случае если вы используете эту проверку (в противном случае строки, отвечающие за это, должны быть удалены из .env) | ||
|
||
Архитектура подразумевает проксирование через внешний веб-сервер, например **Apache** или **Nginx**, поэтому необходимо настроить полное проксирование до `127.0.0.1:8022`, данный адрес при стандартной конфигурации будет работать только в локальной сети. | ||
При необходимости можно настроить проксирование до сервиса **Grafana**, расположенного по адресу `127.0.0.1:8023`. В случае если в этом нет необходимости, объявление этого сервиса стоит удалить из `docker-compose.yaml` | ||
|
||
## Запуск | ||
|
||
`docker compose up -d --build` запустит все сервисы и приложение будет готово к работе, в случае если проксирование из пункта настройки было настроено. | ||
|
||
## Credits | ||
|
||
**Александр Замараев** - Backend разработчик, системный администратор, DevOps | ||
- [Github](https://github.com/Zoom-Developer) | ||
- [ВКонтакте](https://vk.com/zoom_developer) | ||
- [Telegram](https://t.me/zoomdevs) | ||
|
||
**Рамир Воробьёв** - Frontend разработчик, UI/UX дизайнер | ||
- [Github](https://github.com/Ramchike) | ||
- [ВКонтакте](https://vk.com/ramchike) | ||
- [Telegram](https://t.me/ramchike) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
alembic upgrade head | ||
gunicorn src.main:app --worker-class uvicorn.workers.UvicornWorker --workers 2 --bind "0.0.0.0:80" --access-logfile - | ||
gunicorn src.main:app --worker-class uvicorn.workers.UvicornWorker --bind "0.0.0.0:80" --access-logfile - |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
backend/src/infrastructure/db/migrations/versions/89c117ff40e4_is_admin.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
"""is_admin | ||
Revision ID: 89c117ff40e4 | ||
Revises: ffe8d61cff53 | ||
Create Date: 2024-11-18 00:04:07.064495 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
import sqlmodel | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '89c117ff40e4' | ||
down_revision = 'ffe8d61cff53' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column('users', sa.Column('is_admin', sa.Boolean(), server_default=sa.text('false'), nullable=False)) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_column('users', 'is_admin') | ||
# ### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from .models import * | ||
from .models import * | ||
from .grafana import * |
Oops, something went wrong.