Skip to content

reactjs-tmajs

This template demonstrates how developers can implement a single-page application on the Telegram Mini Apps platform using the following technologies...

reactjs-tmajs is an open-source project by Yaroslav Koval, written mainly in TypeScript. Last updated: Jul 30, 2024. The source code is on GitHub.

  • TypeScript
Updated
Stars
0
git clone https://github.com/koval01/reactjs-tmajs.git

README

Telegram Mini Apps React Template

This template demonstrates how developers can implement a single-page application on the Telegram Mini Apps platform using the following technologies and libraries:

The template was created using npm. Therefore, it is required to use it for this project as well. Using other package managers, you will receive a corresponding error.

Install Dependencies

If you have just cloned this template, you should install the project dependencies using the command:

npm install

Scripts

This project contains the following scripts:

  • dev. Runs the application in development mode.
  • build. Builds the application for production.
  • lint. Runs eslint to ensure the code quality meets the required standards.
  • deploy. Deploys the application to GitHub Pages.

To run a script, use the npm run command:

npm run {script}
# Example: npm run build

Create Bot and Mini App

Before you start, make sure you have already created a Telegram Bot. Here is a comprehensive guide on how to do it.

Run

Although Mini Apps are designed to be opened within Telegram applications, you can still develop and test them outside of Telegram during the development process.

To run the application in the development mode, use the dev script:

npm run dev

After this, you will see a similar message in your terminal:

VITE v5.2.12  ready in 237 ms

➜  Local:   http://localhost:5173/reactjs-template
➜  Network: http://172.18.16.1:5173/reactjs-template
➜  Network: http://172.19.32.1:5173/reactjs-template
➜  Network: http://192.168.0.171:5173/reactjs-template
➜  press h + enter to show help

Here, you can see the Local link, available locally, and Network links accessible to all devices in the same network with the current device.

To view the application, you need to open the Local link (http://localhost:5173/reactjs-template in this example) in your browser:

[... continued on GitHub]

More projects

All repositories: github.com/koval01