Installation in Production

Set Up the Laravel Application

  1. Clone the Repository: Clone the repository and navigate to its directory.

  2. Create the .env File: Copy the .env.example file to create your .env file:

    cp .env.example .env
  3. Configure the .env File: Edit the .env file to set up the application URL, database connection, and other necessary configurations.

  4. Install Dependencies: Run the following commands to install PHP and Node.js dependencies, generate the application key, and run database migrations:

    composer install
    php artisan key:generate
    php artisan migrate
    npm install
    npm run build

Set Up the Bot

  1. Add Telegram Bot API Token: Add your Telegram bot API token to the .env file:

    TELEGRAM_TOKEN=your-telegram-bot-token
  2. Initialize the Bot: Run the following command to set up the bot's commands and description:

    php artisan bot:init

Set Up the Mini App

  1. Access @BotFather: Find @BotFather in the Telegram app or open the following URL in the browser https://BotFather.t.me/.

  2. Configure the Mini App:

    • Send the /setmenubutton command to @BotFather.
    • Choose the bot you want to associate with the Mini App.
    • Provide the Mini App URL, e.g., https://example.com/telegram-web-app.
    • Set the button title, for example, "Tasks".

Local Development

For local development, follow the same steps as for production installation, with a few modifications:

Run the Development Server

  1. Start the Development Server: Use the following command to start the development server:

    npm run dev

Set Up the Mini App for Local Development

To set up the Mini App for local development, provide @BotFather with the local development URL of your app.