Перейти до вмісту

nextjs-tma-template

Example of Telegram Mini App developed with NextJS

nextjs-tma-template — проєкт з відкритим кодом, автор Ярослав Коваль. Основна мова: TypeScript. Ліцензія: GPL-3.0. Останнє оновлення: 30 лист. 2026 р. Вихідний код доступний на GitHub.

  • TypeScript
  • javascript
  • miniapp
  • nextjs
  • react
Оновлено
Ліцензія
GPL-3.0
Зірки
0
git clone https://github.com/koval01/nextjs-tma-template.git

README

README показано мовою оригіналу.

Telegram Mini App Next.js Template

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

The template was created using pnpm. 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:

pnpm install

Scripts

This project contains the following scripts:

  • dev. Runs the application in development mode.
  • dev:https. Runs the application in development mode using self-signed SSL certificate.
  • build. Builds the application for production.
  • start. Starts the Next.js server in production mode.
  • lint. Runs eslint to ensure the code quality meets the required standards.
  • deploy. Starting the build of the project, and in the case of a successful build, all commits will be pushed to the origin repository

To run a script, use the pnpm run command:

pnpm run {script}
# Example: pnpm 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:

pnpm run dev

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

▲ Next.js 14.2.3
- Local:        http://localhost:3000

✓ Starting...
✓ Ready in 2.9s

To view the application, you need to open the Local link (http://localhost:3000 in this example) in your browser.

It is important to note that some libraries in this template, such as @tma.js/sdk, are not intended for use outside of Telegram.

Nevertheless, they appear to function properly. This is because the src/hooks/useTelegramMock.ts

[... continued on GitHub]

Інші проєкти

Усі репозиторії: github.com/koval01