Skip to content

asqarbekolimov/twa-weather-app

Repository files navigation


logo of telegram web apps

Telegram Mini Apps Basic Example

This is a basic and straightforward Telegram Mini App(TMA) implemented using plain React (Vite). This project aims to provide a minimalistic example of how to create a simple TWA, location access and launch it within Telegram without relying on complex build tools or bleeding-edge libraries.

Features

  • Minimalistic user interface.
  • No external libraries or frameworks used.
  • Easy to understand and modify.

Getting Started

Prerequisites

To run this example, you'll need a modern web browser with JavaScript enabled.

Installation

  1. Clone this repository to your local machine:

    git clone https://github.com/asqarbekolimov/twa-weather-app.git
    
  2. Navigate to the project directory:

    cd twa-weather-app

Open App.jsx in your preferred code editor or IDE.

Environment Variables

VITE_WEATHER_API_KEY= your Open Weather Map api key

Telegram Mini App API

 <script src="https://telegram.org/js/telegram-web-app.js?56"></script>

add to head tag in index.html

Enable Dev Tools

<script src="https://cdn.jsdelivr.net/npm/eruda"></script>

Added script to run dev tools

<script>eruda.init();</script>

Customization

Feel free to customize this web app to suit your needs. You can modify the React JS and Tailwind CSS files as required.

Contributing

If you'd like to contribute to this project, please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes and commit them with descriptive messages.
  4. Push your branch to your fork.
  5. Create a pull request to the main repository's main branch.

License

This project is licensed under the MIT License - see the LICENSE file for details.