This project provides a boilerplate for creating Telegram Mini Apps using React and Vite. It's designed to help you quickly set up and start developing your Telegram Mini App with modern web technologies.
Clone the repository:
git clone https://github.com/etherwave-labs/telegram-mini-app-react-boilerplate.git
cd telegram-mini-app-react-boilerplate
Install dependencies:
yarn
To start the development server:
yarn dev
This will start the Vite development server. Open your browser and navigate to http://localhost:5173
to see your app.
To build the app for production:
yarn build
This will generate a production-ready build in the dist
folder.
To make your Mini App accessible through Telegram, you need to attach it to a bot. Here's how to do it using BotFather:
Open Telegram and search for @BotFather.
Start a chat with BotFather and use the /newbot
command to create a new bot if you haven't already.
Once you have a bot, use the /mybots
command to list your bots.
Select the bot you want to attach your Mini App to.
Choose the "Bot Settings" option.
Select "Menu Button" or "Menu Buttons" (depending on your BotFather version).
Choose "Configure menu button" or "Add menu button" to add a new button.
Send the text you want to appear on the button (e.g., "Open Mini App").
For the URL, enter the URL where your Mini App is hosted. If you're still developing, you can use your local development URL (e.g., http://localhost:5173
). For production, use your deployed app URL.
BotFather will confirm that the menu button has been added to your bot.
Now, when users interact with your bot, they'll see a menu button that opens your Mini App.
Remember to update the URL to your production URL before releasing your bot to the public!
For more information on how to develop Telegram Mini Apps, refer to the following resources:
dev
: Start the development serverbuild
: Build the project for productionlint
: Run ESLint to check for code issuespreview
: Preview the production build locallyThis boilerplate is maintained by Etherwave Labs.
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
This project is licensed under the MIT License - see the LICENSE file for details.