Muhammadali-Akbarov / fastgram

Fastgram is a robust and scalable Telegram bot built with FastAPI, Aiogram3, SQLAlchemy, PostgreSQL, Redis, FastStream and Celery. It leverages modern web technologies and asynchronous programming to deliver high-performance and efficient bot interactions.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fastgram template

Support Group - Telegram

Installation

  • 1 - clone repo
    • git clone git@github.com:Muhammadali-Akbarov/fastgram.git
  • 2 - Setting up environment variables
    • cp .env.dist .env
  • 3 - RUN Project the following commands
    • make run.image - run with docker
  • 4 - Run the following commands without docker
    • python3 -m venv venv
    • source venv/bin/activate or ./venv/Scripts/activate
    • pip3 install -r requirements.txt
    • uvicorn main:app --port ${SERVICE_PORT} run bot
    • celery -A app.bot.services.external.celery.tasks worker -l INFO run celery worker
    • celery -A app.bot.services.external.celery.tasks beat -l INFO run celery beat

Architecture Overview

Fastgram is built using the following technologies:

  • FastAPI: A modern, fast (high-performance) web framework for building APIs with Python 3.6+ based on standard Python type hints.
  • aiogram 3: An asynchronous framework for Telegram Bot API based on asyncio and aiohttp.
  • SQLAlchemy: The Python SQL toolkit and Object-Relational Mapping (ORM) library.
  • PostgreSQL: A powerful, open-source object-relational database system.
  • Redis: An in-memory data structure store, used as a database, cache, and message broker.
  • Celery: An asynchronous task queue/job queue based on distributed message passing.
  • FastStream: For pub/sub messaging.

This combination of technologies ensures that Fastgram is robust, scalable, and ready for production environments.

(fastgram) πŸš€ fastgram % tree app/bot/services/external/aiogram
app/bot/services/external/aiogram
β”œβ”€β”€ __init__.py
β”œβ”€β”€ enum
β”‚   β”œβ”€β”€ __init__.py
β”‚   └── state.py
β”œβ”€β”€ filter
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ chat.py
β”‚   β”œβ”€β”€ payment.py
β”‚   └── text.py
β”œβ”€β”€ handler
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ echo.py
β”‚   β”œβ”€β”€ example.py
β”‚   └── start.py
β”œβ”€β”€ keyboard
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ inline
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ create.py
β”‚   β”‚   └── default.py
β”‚   └── markup
β”‚       β”œβ”€β”€ __init__.py
β”‚       β”œβ”€β”€ create.py
β”‚       └── default.py
β”œβ”€β”€ middleware
β”‚   β”œβ”€β”€ __init__.py
β”‚   └── lang.py
β”œβ”€β”€ router
β”‚   β”œβ”€β”€ __init__.py
β”‚   └── prepare.py
β”œβ”€β”€ shortcut
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ action.py
β”‚   └── schema.py
β”œβ”€β”€ state
β”‚   β”œβ”€β”€ __init__.py
β”‚   └── intro.py
└── storage
    β”œβ”€β”€ __init__.py
    └── fsm.py

About

Fastgram is a robust and scalable Telegram bot built with FastAPI, Aiogram3, SQLAlchemy, PostgreSQL, Redis, FastStream and Celery. It leverages modern web technologies and asynchronous programming to deliver high-performance and efficient bot interactions.


Languages

Language:Python 94.2%Language:Makefile 3.0%Language:Shell 1.9%Language:Dockerfile 0.9%