Developed a Telegram Restaurant Mini App & Bot for Order Management
Project Overview
This blog describes a Telegram Mini App built with Next.js and NestJS, allowing customers to place restaurant orders while the backend bot manages workflows efficiently.
- Frontend Mini App built with Next.js for a smooth, responsive UI.
- Backend API built with NestJS for fast and reliable order management.
- SQLite database for storing blacklisted IDs and other essential data.
- Security features including Telegram widget login and blacklist handling by ID.
- Telegram Bot integration for workflow automation and group updates.
Frontend Features: Telegram Mini App
The Mini App provides a smooth ordering experience, handling menu display, cart functionality, secure login, and a 3-step checkout process.
- Dynamic Menu System with categories and items.
- Shopping Cart: Add, remove, and review items before checkout.
- 3-Step Checkout Process:
- 1. Customer details (Name, Phone Number, Address, Note).
- 2. Branch selection from available locations.
- 3. Payment options: Cash on Delivery or QR Code.
- Telegram widget login for secure authentication.
- Orders submitted securely to backend via Telegram Web App API.
- Fast and responsive UI powered by Next.js.
Backend Features: NestJS API & Telegram Bot
The backend is an API service built with NestJS, handling order management, workflows, security, and real-time updates efficiently.
- Order Forwarding: Sends order summary to Admin (Boss) Group with Confirm/Cancel buttons.
- Workflow Management:
- - On confirmation, updates Boss Group and sends details to Workers Group.
- - Status transitions: Confirm → Preparing → Delivering → Complete.
- Blacklist feature with SQLite to prevent banned users from placing orders.
- Supports multiple simultaneous orders with real-time updates.
- Customers do not receive order status updates.
- API ensures low latency and reliable performance for all operations.
Development Timeline
The project was completed in 21 days, following a structured plan to ensure stability, security, and full functionality.
- Week 1 (Days 1–7): Project setup, Next.js frontend development, menu & cart implementation, 3-step checkout, Telegram login integration.
- Week 2 (Days 8–14): NestJS backend API development, order forwarding, workflow logic, blacklist feature implementation using SQLite.
- Week 3 (Days 15–21): QA & testing with concurrent orders, integration of frontend & backend, final bug fixes, deployment via Telegram Web App..
Deployment & Hosting
The Mini App frontend is hosted as a Telegram Web App using BotFather, while the backend API is hosted on Render. SQLite is used for lightweight and efficient data storage.
- Frontend hosted via Telegram Web App using BotFather.
- Backend API hosted on Render for fast and reliable performance.
- SQLite database stores blacklisted IDs and other essential management data.
Why This Project Was Successful
- Next.js frontend provides a fast, responsive, and smooth UI.
- NestJS backend ensures reliable and low-latency API performance.
- Telegram widget login ensures secure user authentication.
- Blacklist feature prevents unwanted or malicious users from placing orders.
- SQLite provides lightweight and efficient storage for management data.
- Workflow buttons (Confirm, Preparing, Delivering, Complete) function as expected.
- System handles multiple orders efficiently with real-time updates.
- Integration of all assets ensures smooth operations without delays.
If you come this far, thank you.