Skip to content

Commit

Permalink
Mini Event Submission
Browse files Browse the repository at this point in the history
This app shows an interface that allows users to mark events they plan to attend
  • Loading branch information
mbasaglia committed Oct 10, 2023
1 parent 6ed01d9 commit 07b7b9e
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 13 deletions.
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
Event Telegram Mini-App Demo
============================

Mini Apps is a Python framework to create [Telegram Mini Apps](https://core.telegram.org/bots/webapps).
This app shows an interface that allows users to mark events they plan to attend.

There are some built-in apps that showcase the features of both this framework and the mini apps feature on Telegram:
User will receive a notification when the event is starting.

_Tic Tac Toe_ allows you to play tic tac toe (also known as naughts and crosses) against another player on Telegram.
Live instance: [@GlaxMiniEventBot](https://t.me/GlaxMiniEventBot).

_Mini Events_ is a demo app that shows a list of events the user can attend.

_Glaximini_ is a more complex app that allows the user to create animated stickers and share them on Telegram.
More info in the [Mini Event app page](./docs/apps/mini_event.md).

Full documentation is available on [Read the Docs](https://mini-apps.readthedocs.io/en/latest/).

## Limitations

The events app is a technical demo, for a fully functional app some changes are needed.

For one, the events are only specified as a time (not a date), this allows the bot
to always show some data regardless of the current date.

The bot will send notifications based on the server time, which might be different from the time shown to the users.


Set Up
------
Expand Down
10 changes: 10 additions & 0 deletions docs/installation/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ Then run `supervisorctl reload` to load the new job, you can see whether it's ru
with `supervisor status`.


## Permissions

The media directory in the client needs to be writable by the web server:

```bash
chgrp www-data /opt/miniapps.example.com/client/media/
chmod g+w /opt/miniapps.example.com/client/media/
```


## Front-End (Apache)

This step is what makes the app accessible from outside the server machine.
Expand Down
17 changes: 10 additions & 7 deletions docs/installation/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ If you are planning to run from docker, somewhere in your home directory will al


There are [multiple apps](../apps/index.md) available, this guide will set up
the [Tic Tac Toe](../apps/tic_tac_toe.md) app, but you can easily add more apps.
the [Mini Event](../apps/mini_event.md) app, but you can easily add more apps.


## Bot Setup

Talk to [BotFather](https://t.me/BotFather) and create a bot, keep note of the token it gives you as it's needed later.

On that bot enable the _Menu Button_ under _Bot Settings_, and give it `https://miniapps.example.com/tic_tac_toe/` as URL.
On that bot enable the _Menu Button_ under _Bot Settings_, and give it `https://miniapps.example.com/mini_event/` as URL.

You need to create a new app on that bot (`/newapp`) with the same URL as the button, and `tic_tac_toe` short name.
You need to create a new app on that bot (`/newapp`) with the same URL as the button, and `events` short name.

Finally, enable inline mode with `/setinline`.

Expand Down Expand Up @@ -79,11 +79,12 @@ with the following:
"port": 2536
},
"apps": {
"tic_tac_toe": {
"class": "mini_apps.apps.tic_tac_toe.TicTacToe",
"mini_event": {
"class": "mini_apps.apps.mini_event.MiniEventApp",
"bot-token": "(your bot token)",
"short-name": "tic_tac_toe",
"url": "https://miniapps.example.com/tic_tac_toe/"
"short-name": "events",
"media-url": "https://miniapps.example.com/media/",
"url": "https://miniapps.example.com/mini_event/"
}
},
"api-id": "(your api id)",
Expand All @@ -96,6 +97,8 @@ The values for `api-id` and `api-hash` can be obtained from <https://my.telegram

`url` should be the public URL of your mini app, the same you specified on BotFather.

`media-url` is the URL that serves images for the events.

`short-name` is the app short name that you set on BotFather with `/newapp`.

If you want to run on the Telegram test server, add the following to the JSON,
Expand Down

0 comments on commit 07b7b9e

Please sign in to comment.