Application for notifying about free seats in popular restaurants. Uses telegram to send notifications.
- Actual logic to check for seats and send notifications accordingly
- Format sent telegram messages nicely
- CI Pipeline to deploy as scheduled Azure Function
- Terraform to manage infrastructure
- Support multiple chat ids: in webhook use chat id from request and in timer, store chat id where to send the results to
- Add persistence
- Store sent notifications so there are not duplicate notification about the same seat
- Neon
- Supabase
- CockroachDB serverless
- Azure SQL
- Telegram bot webhook
- Check
secret_tokenfrom request header - Support adding new restaurants dynamically
- Autocomplete for bot commands
- Support
inline_queryto enable interacting with the bot from any chat/conversation - Register webhook automatically using
setWebhookduring deployment/startup?
- Check
- Combine multiple free seats together in one message
- Scala/SBT for building
- Docker for local blob storage
- Telegram bot token and chat ID
Create a .env file in the project root with your Telegram credentials:
TELEGRAM_CHATID=<your-chat-id>
TELEGRAM_BOTTOKEN=<your-bot-token>
TELEGRAM_SECRETTOKEN=<your-secret-token>
The .env file should be loaded into your environment. If using nix-direnv or dotenv, it will be loaded automatically.
- Ensure environment variables from
.envfile are loaded before starting SBT. - Run
sbt run
- Ensure Azure Functions Core Tools (v4) are available (automatically included in nix dev shell)
- Start blob storage:
docker compose up - Build the application:
sbt assembly - Navigate to
azure-functionsfolder - Start the function:
func start
The application infrastructure is managed with Terraform and applied as part of deployment process in GitHub Actions.
- Azure setup
- Create an Azure subscription
- Create a service principal for GitHub Actions:
az ad sp create-for-rbac --name "seat-stalker-github" --role contributor --scopes /subscriptions/{subscription-id} --json-auth - Create storage account for Terraform state:
az group create --name <resource-group> --location <location> az storage account create --name <storage-account> --resource-group <resource-group> --location <location> --sku Standard_LRS az storage container create --name tfstate --account-name <storage-account>
- GitHub secrets
Add these secrets to your GitHub repository (Settings → Secrets and variables → Actions):
AZURE_CREDENTIALS- JSON output from service principal creation- Required properties:
clientId,clientSecret,subscriptionId,tenantId
- Required properties:
TELEGRAM_CHAT_ID- Your Telegram chat IDTELEGRAM_BOT_TOKEN- Your Telegram bot tokenTELEGRAM_SECRET_TOKEN- Your Telegram secret tokenEMAIL_ALERT_RECIPIENT- Email for Azure alerts