Telegram commerce bot
The complete order flow for a family grocery store inside Telegram — from catalogue to the admin notification.
- 1
- command to deploy
- 0
- external file hosts
- 91
- source files
Problem
For a small family shop, both a website and a mobile app were expensive and beside the point — the customers were already in Telegram and simply typed their order. Orders got lost in the message stream, prices were asked again every time, and only whoever happened to reply knew an item had run out.
Solution
I built the entire flow inside the bot: category → product → cart → checkout → a notification to the admin group. The admin manages the catalogue from the bot too — adding products, changing prices, marking items out of stock, without opening any panel. Product photos are stored as Telegram `file_id` values, so no external file hosting is needed at all.
Key capabilities
- aiogram 3 FSM with Redis — cart and checkout state persists, so a dropped conversation does not lose the order
- The admin runs the whole catalogue from bot commands: products, prices, availability
- Product photos stored as Telegram `file_id` values — no external file hosting required
- Orders arrive in the admin group in a structured layout
- Multilingual copy separated into its own layer
- Docker Compose — one command brings it up, migrations apply automatically
- Async SQLAlchemy and a repository layer: the planned mobile app builds on the same data layer
- A separate FastAPI service for Telegram WebApp sign-in
Architecture
The bot runs in polling mode, state in Redis and data in PostgreSQL. The repository layer is shared between the bot and the API, so a future mobile app will not duplicate the domain logic.
Entry points
Handlers & state
Cart and checkout state in Redis
Repository layer
Data & deployment
Stack
Backend
Infrastructure
Telegram
My role
Sole developer: bot, data model, admin flow, WebApp API and Docker deployment.
Client names, domains and server addresses are withheld for confidentiality.