A template repository for creating a Telegram bot using Aiogram. This template includes essential setup for Docker, PostgreSQL, and Alembic for database migrations, making it easy to bootstrap your next project.
- Aiogram Framework: A modern and efficient framework for Telegram bots.
- Database Integration: Pre-configured with PostgreSQL.
- Database Migrations: Integrated with Alembic for schema migrations.
- Dockerized Setup: Docker Compose configuration for easy deployment.
- Environment Variables: Centralized configuration using a
.env
file.
βββ app/ # Main application folder
β βββ runme.py # Entry point to start the bot
β βββ bot.py # Core bot logic
βββ migrations/ # Alembic migrations folder
βββ .env # Environment configuration file
βββ alembic.ini # Alembic configuration file
βββ requirements.txt # Python dependencies
βββ Dockerfile # Docker configuration for the bot
βββ docker-compose.yml # Docker Compose setup
βββ README.md # Project documentation
- Python 3.10+
- Docker & Docker Compose
- PostgreSQL (if running locally without Docker)
git clone https://github.com/iismoilov7/jessy.git
cd jessy
Create a .env
file in the project root, you can use .env-example
for instacne
Using Docker Compose:
docker-compose up --build
This will:
- Build the
bot
service. - Spin up a PostgreSQL database.
- Run the Telegram bot.
-
Starting the Bot: The bot starts automatically when the
bot
container is running. -
Accessing Logs: To view logs:
docker-compose logs -f bot
-
Stopping the Services:
docker-compose down
If you prefer running the bot locally:
- Set up postgresql database and set .env files
- Install dependencies:
pip install -r requirements.txt
- Apply migrations:
alembic upgrade head
- Start the bot:
python app/runme.py
This template is designed for easy deployment via Docker. You can use platforms like Heroku, AWS, or DigitalOcean to host your bot.
- Fork the repository.
- Create a feature branch:
git checkout -b feature/your-feature-name
- Commit your changes:
git commit -m "Add your commit message"
- Push to the branch:
git push origin feature/your-feature-name
- Create a Pull Request.
This project is licensed under the MIT License. See the LICENSE
file for details.
For issues or questions, please open an issue.