A clean Telegram storefront built with aiogram 3: browse a catalog, add items to a cart, and place an order — the owner gets a formatted notification for every sale. A solid starting point for small shops that sell straight from Telegram.
- Inline catalog — one tap to view a product's details and price
- Cart — add / remove items, live totals, clear in one tap
- Checkout flow — collects name, phone and address via an FSM conversation
- Order notifications — the admin receives a formatted order the moment it's placed
- Configurable — shop name and currency from environment variables
- Swappable data layer — the catalog and cart hide behind small modules, so moving to a database is a local change
- Docker-ready —
Dockerfile+docker-compose.ymlincluded
# 1. install
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
# 2. configure
cp .env.example .env
# edit .env — set BOT_TOKEN (from @BotFather) and your ADMIN_ID
# 3. run
python -m botOr with Docker:
cp .env.example .env # fill it in
docker compose up --buildMessage @userinfobot on Telegram — it replies with
your numeric user id. Put that in ADMIN_ID to receive orders.
telegram-shop-bot/
├── bot/
│ ├── __main__.py # entry point, dispatcher wiring
│ ├── config.py # typed settings (pydantic-settings)
│ ├── catalog.py # products (swap for a DB later)
│ ├── cart.py # per-user cart store
│ ├── keyboards.py # inline keyboards
│ └── handlers/
│ ├── shop.py # catalog + cart
│ └── checkout.py # order FSM + admin notify
├── Dockerfile
├── docker-compose.yml
├── requirements.txt
└── pyproject.toml
The catalog and carts are kept in memory to stay dependency-free. For
production, back cart.py with Redis and catalog.py with your database —
the handler code doesn't change, since it only talks to those modules'
functions.
MIT — see LICENSE.