The app is available at https://t.me/eventizerbot
This is a mini app for Telegram designed to help you organize events, share them with your friends, and join events hosted by others.
Bot is accessible via inline mode to make it easy to share events in chats.
You can manage your events using the web app, which is accessible via the bot's menu button.
The app supports attachment menu. When accessed from attachment menu, the app shows events list, that can be edited before sending to the chat.
If you click on a direct link to an event, you'll be able to see detailed information about that event and join it. If the event is already full, the app will notify you. Similarly, if you're already a participant in the event, the app will display a message and offer you a cancel button.
When you join an event, the bot automatically sends you a message containing all the details about the event.
Use BotFather to perform the following steps:
- Create a new bot
- Create mini app
- Set URL. For development use
https://dolphin.dmku.local/
- Turn on inline mode for the bot
- Setup menu button to open mini app. For development use
https://dolphin.dmku.local/
- Setup attachments menu for the bot. Ensure it enabled for all chat types
- Set URL for the attachments' menu. For development use
https://dolphin.dmku.local/attach
- Docker
- Docker Compose
- Node.js (version 20 or higher)
- Yarn
Since telegram requires to use HTTPS,
we need to configure it for local development using Caddy container.
The configuration file for Caddy is located in Caddyfile.dev
file.
First create a volumes for Caddy and Postgres
docker volume create dolphin-caddy-data
docker volume create dolphin-pg-data-local
Then run the following command to start Caddy and Postgres containers
docker-compose -f docker-compose.dev.yaml up -d
Run frontend (Web App). Feel free to run it from your IDE.
cd apps/quiz-mini-app
yarn
yarn start:dev
Go to backend directory apps/dolphin-backend
and create .env
file with the following variables:
TELEGRAM_BOT_TOKEN=<your telegram bot token>
TELEGRAM_MINI_APP_LINK=<your telegram mini app link> # e.g. t.me/usernamebot/app
ACCESS_TOKEN_SECRET=<your access token secret>
If you want to use the bot in telegram test environment, you need to add the following variable:
TELEGRAM_TEST_ENVIRONMENT='true'
Prepare backend dependencies and database
cd apps/dolphin-backend
yarn
yarn schema:sync
yarn migration:up
Run backend. Feel free to run it from your IDE.
cd apps/dolphin-backend
yarn start:dev
Follow the instructions in Caddy documentation to set up certificates for local development.
Then add domain name dolphin.dmku.local
to your /etc/hosts
file or use any local DNS server.
Now you can use dolphin.dmku.local
as a URL for your mini app in telegram.
In this case, it works only locally.
Before running the bot, you need to create a .env
file in the root directory of the project. This file should contain the following variables:
TELEGRAM_BOT_TOKEN=<your telegram bot token>
TELEGRAM_MINI_APP_LINK=<your telegram mini app link> # e.g. t.me/usernamebot/app
ACCESS_TOKEN_SECRET=<your access token secret>
POSTGRES_PASSWORD=<your postgres password>
MINI_APP_URL=<your domain> # e.g. https://dolphin.dmku.local
If you want to use the bot in telegram test environment, you need to add the following variable:
TELEGRAM_TEST_ENVIRONMENT='true'
Create a volume for the postgres database and a network to connect the app and upstanding web server:
docker volume create dolphin-pg-data
docker network create dolphin
To run the bot, execute the following command:
docker-compose up -d
This configuration implies that you have a web server running on the host machine that proxies requests to the bot and terminates TLS. For example, you can use Caddy for this purpose.
Use network dolphin
to connect your web server to the bot.
Bot will be available at http://dolphin-entrypoint:3000
inside the network.
With Caddy you can use the following configuration:
<your domain> {
reverse_proxy dolphin-entrypoint:3000
}
And Caddy will automatically generate and renew certificates for your domain using Let's Encrypt.