A full-stack e-commerce platform with Telegram Bot integration for seamless product management, user authentication, and real-time notifications. Manage your entire shop directly through Telegram!
- Telegram OAuth: Secure user authentication via Telegram
- Role-based Access Control: Admin and regular user permissions
- Session Management: Secure token-based authentication
- Admin Dashboard: Full CRUD operations for products
- Telegram Bot Admin Panel: Manage products directly from Telegram
- Category Management: Organize products by categories
- Inventory Tracking: Real-time stock management
- Image Upload: Product photos with preview
- Product Catalog: Browse products with filters and search
- Shopping Cart: Add, update, and remove items
- Wishlist: Save favorite products
- Responsive Design: Optimized for mobile and desktop
- Bot Commands: Manage shop via Telegram bot
- Real-time Notifications: Order updates and alerts
- Admin Control: Complete shop management from Telegram
- User Interactions: Browse and purchase through bot
- Persian (Farsi): Full RTL support
- English: Complete translation
- Easy Extension: i18n ready for more languages
- Node.js (v18 or higher)
- npm or yarn
- Telegram Bot Token (from @BotFather)
- Your Telegram Chat ID (from @userinfobot)
-
Clone the repository
git clone https://github.com/cleverboy01/Telegram-Based-Shopping.git cd Telegram-Based-Shopping -
Install dependencies
npm install
-
Set up environment variables
Create a
.envfile in the root directory:VITE_API_URL=http://localhost:3000/api BOT_TOKEN=your_telegram_bot_token_here MAIN_ADMIN_CHAT_ID=your_telegram_chat_id_here
-
Start both frontend and backend
npm run dev:all
Or start them separately:
# Terminal 1 - Start backend & bot npm run server # Terminal 2 - Start frontend npm run dev
The app will be available at http://localhost:5173
- Open Telegram and search for @BotFather
- Send
/newbotand follow the instructions - Copy the bot token provided
- Paste it in your
.envfile asBOT_TOKEN
- Start a chat with @userinfobot
- The bot will send you your Chat ID
- Copy it and paste in
.envasMAIN_ADMIN_CHAT_ID
/start- Initialize the bot/addproduct- Add a new product/listproducts- View all products/deleteproduct- Remove a product/orders- View pending orders/stats- View shop statistics
/start- Browse products/shop- View product catalog/cart- View shopping cart/orders- View order history/help- Get help
Telegram-Based-Shopping/
├── src/ # Frontend source code
│ ├── components/ # React components
│ ├── pages/ # Page components
│ ├── contexts/ # React contexts
│ ├── services/ # API services
│ └── types/ # TypeScript types
├── backend/ # Backend API
│ ├── bot.js # Telegram bot
│ ├── server.js # Express server
│ └── database.js # Database operations
├── public/ # Static assets
└── README.md # This file
-
Web Dashboard
- Login with admin credentials
- Access
/adminroute - Manage products, categories, and orders
-
Telegram Bot
- Send commands to your bot
- Add products with images
- Monitor orders in real-time
- View analytics
-
Web Interface
- Browse product catalog
- Add items to cart
- Checkout and place orders
- Track order status
-
Telegram Bot
- Browse products
- Add to cart
- Complete purchases
- Receive order updates
- React 18 - UI framework
- TypeScript - Type safety
- Vite - Build tool
- TailwindCSS - Styling
- React Router - Navigation
- Zustand - State management
- Node.js - Runtime
- Express - Web framework
- SQLite - Database
- node-telegram-bot-api - Telegram integration
- bcrypt - Password hashing
- JWT - Authentication
Mohammad Reza Kazemi
- GitHub: @cleverboy01
- Portfolio: my-portfolio-8y5.pages.dev
- Email: [email protected]
If you have any questions or need help, feel free to:
- Open an issue on GitHub
- Contact via Telegram Bot
- Email: [email protected]
⭐ If you find this project useful, please consider giving it a star!