mir-one / twa

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TON Starter Template - Telegram Web App (TWA)

Starter template for a new TWA interacting with the TON blockchain

Overview

This project is part of a set of 3 typical repositories needed for a blockchain dapp running on TON blockchain:

Prerequesities

  • Node.js v16 (other versions may work, needs more testing)
  • Tonhub wallet installed on a mobile phone

What does this repo contain?

  • A react-based TWA-ready app, interacting with TON
  • Github actions set to deploy app to github pages
  • A script to connect a telegram bot to the deployed app

How to use

  1. Create a template from this repo with the "Use this template" button

    1. Choose a name for your repo
    2. Important! mark "Include all branches", otherwise github pages deployment will not work. image
  2. Clone this repo and run npm install

  3. Create a new bot with botfather

    1. Type /newbot
    2. Choose a name for your bot, e.g. My Ton TWA
    3. Choose a username for your bot, e.g. my_ton_twa_482765_bot
    4. Take note of the access token, e.g. 5712441624:AAHmiHvwrrju1F3h29rlVOZLRLnv-B8ZZZ
    5. Run node configure.js to link your bot to the webapp

Development

  1. Run npm run dev and edit the code as needed
  2. On push to the main branch, the app will be automatically deployed via github actions.

Roadmap

  • Jetton transfer support
  • Light/dark theme handling

About


Languages

Language:TypeScript 63.1%Language:JavaScript 20.3%Language:CSS 13.4%Language:HTML 3.2%