- Create telegram bot that will copy post from given VK user to the telegram channel after user will create new post.
- The admin users can set pair of vk_user_id and telegram_channel_id.
- User send vk_user_id. Validate it using VK API.
- User send telegram_channel_id. Validate it using Telegram API.
- After all validation, save to User table Vk account info and to Post table Last Post info.
- Celery periodic task.
- Every N-minutes start task to check new post for user.
- If new post is ready send it to the telegram_channel and admin users.
- aiogram - Asynchronious framework to create telegram bots
- aiohttp - For creating Non-Blocking http client
- aioredis - Asynchronious redis client
- celery - Distributed Task Queue for periodic tasks
- pydantic - For settings management
- sentry - logging system
- watchfiles - for reloading in development process
- linters and formatters(mypy, flake8, isort, black, autoflake)
-
Using docker-compose
docker-compose up -d bot scheduler
-
Using shell
- Install requirements.txt
poetry install
- Run start script
./docker/start.sh
- Install requirements.txt
- Create .env file
- Start using docker-compose
docker-compose up -d bot scheduler
- Login using heroku.
heroku login
- Add new remote repository
heroku git:clone -a vk-copy-post-bot
- Create new branch with Procfile, requirements.txt and runtime.txt.
- Push change using custom branch
git push heroku deploy/heroku:master
Application consists of three layers: handlers, services, database.
- Handlers layer. Responsible for creating API route function, validation input user data.
- Service layer. It's a place for all business logic and additional validation.
- Database layer. Responsible for creating actual database queries and executing them.
- Add sphinx documendation.
- Check using clean code.