{"id":22632986,"url":"https://github.com/makoni/releaseinformerbot","last_synced_at":"2026-04-02T19:05:15.435Z","repository":{"id":70343115,"uuid":"48768912","full_name":"makoni/ReleaseInformerBot","owner":"makoni","description":"Telegram Bot that will inform you about updates in App Store","archived":false,"fork":false,"pushed_at":"2024-06-25T11:07:15.000Z","size":252,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-03T14:22:32.904Z","etag":null,"topics":["couchdb","javascript","node-js","nodejs","telegram","telegram-bot"],"latest_commit_sha":null,"homepage":"https://telegram.me/ReleaseInformerBot","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/makoni.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-12-29T21:59:13.000Z","updated_at":"2024-06-25T11:07:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"e4be7d0d-bf53-41b4-bf09-87fabb3cbe5c","html_url":"https://github.com/makoni/ReleaseInformerBot","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makoni%2FReleaseInformerBot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makoni%2FReleaseInformerBot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makoni%2FReleaseInformerBot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makoni%2FReleaseInformerBot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/makoni","download_url":"https://codeload.github.com/makoni/ReleaseInformerBot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246140569,"owners_count":20729797,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["couchdb","javascript","node-js","nodejs","telegram","telegram-bot"],"created_at":"2024-12-09T02:25:53.688Z","updated_at":"2026-04-02T19:05:15.428Z","avatar_url":"https://github.com/makoni.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Release Informer Bot for Telegram\n\nA Telegram bot that monitors iOS App Store releases and sends notifications to subscribers when new versions are available. Built with modern Swift using the Vapor framework for robust server-side development.\n\n## How It Works\n\nThe Release Informer Bot provides a comprehensive subscription system for iOS app release notifications:\n\n1. **App Discovery**: Users can search for apps using the `/search \u003capp name\u003e` command, which queries the iTunes Search API\n2. **Subscription Management**: Users subscribe to specific apps using `/add \u003cbundle_id\u003e` and manage their subscriptions with `/list` and `/del \u003cbundle_id\u003e`\n3. **Release Monitoring**: A background watcher checks all subscriptions every 5 minutes using the iTunes API to detect new versions\n4. **Smart Notifications**: When a new version is detected, the bot sends formatted notifications to all subscribed users with release details including version number, release notes, and App Store link\n5. **Data Persistence**: All subscriptions are stored in CouchDB with efficient indexing for fast lookups by bundle ID and chat ID\n\n### Available Commands\n\n- `/start` - Show welcome message with inline keyboard\n- `/help` - Display help information\n- `/search \u003capp name\u003e` - Search for apps in the App Store\n- `/add \u003cbundle_id\u003e` - Subscribe to notifications for an app\n- `/del \u003cbundle_id\u003e` - Unsubscribe from an app\n- `/list` - Show your current subscriptions\n\n## Key Features \u0026 Architecture\n\n### ✨ Good Parts\n\n- **Modern Swift Concurrency**: Built with async/await and actors for safe concurrent operations\n- **Modular Architecture**: Clean separation with three modules:\n  - `ReleaseInformerBot`: Main bot logic and Telegram handlers\n  - `ReleaseWatcher`: Background monitoring service\n  - `Shared`: Common models and database management\n- **Robust Monitoring**: Automated release checking with intelligent rate limiting and error handling\n- **Scalable Storage**: CouchDB integration with optimized views for efficient queries\n- **Production Ready**: Comprehensive logging and error handling\n- **Real-time Notifications**: Instant notifications with rich formatting including release notes\n- **Resource Management**: Intelligent memory management with version history limits (5 versions per app)\n\n### 🏗️ Technical Architecture\n\n- **Server Framework**: Vapor 4.x for high-performance HTTP server\n- **Concurrency**: Swift's native actor system for thread-safe operations  \n- **Database**: CouchDB with custom views for efficient data access\n- **External APIs**: iTunes Search/Lookup API for app metadata\n- **Deployment**: Flexible for local development and production\n\n## Dependencies\n\nThe project uses carefully selected, production-grade dependencies:\n\n### Core Dependencies\n- **[Vapor](https://github.com/vapor/vapor)** `4.110.1+` - Server-side Swift web framework\n- **[Swift NIO](https://github.com/apple/swift-nio)** `2.65.0+` - Non-blocking networking foundation\n- **[SwiftTelegramBot](https://github.com/nerzh/swift-telegram-bot)** `4.3.0+` - Telegram Bot API client\n- **[CouchDB Swift](https://github.com/makoni/couchdb-swift)** `2.1.0+` - CouchDB client library\n- **[Swift Configuration](https://github.com/apple/swift-configuration)** `0.1.0+` - Unified configuration reader for environment variables and files\n\n### Development Dependencies\n- **VaporTesting** - Testing utilities for Vapor applications\n\n## Deployment Instructions\n\n### Prerequisites\n- Swift 6.0+\n- macOS 15.0+ or Linux with Swift 6 toolchain\n- CouchDB instance (local or remote)\n- Telegram Bot Token (from [@BotFather](https://t.me/botfather))\n\n### Swift Package Manager (Development)\n\n1. **Clone the repository**:\n   ```bash\n   git clone https://github.com/makoni/ReleaseInformerBot.git\n   cd ReleaseInformerBot\n   ```\n\n2. **Set environment variables** (override as needed):\n   ```bash\n   export TELEGRAM_API_KEY=\"YOUR_TELEGRAM_BOT_TOKEN\"\n   export COUCH_HOST=\"127.0.0.1\"\n   export COUCH_USER=\"admin\"\n   export COUCH_PASSWORD=\"\"\n   export COUCH_PORT=5984\n   ```\n\n3. **Build and run**:\n   ```bash\n   swift build\n   swift run\n   ```\n\n4. **Run tests**:\n   ```bash\n   swift test\n   ```\n\n### Configuration\n\nThe bot now uses [Swift Configuration](https://github.com/apple/swift-configuration) to resolve settings from multiple sources. The lookup order is:\n1. Environment variables (using uppercase keys such as `TELEGRAM_API_KEY` or `COUCH_HOST`)\n2. Optional JSON configuration file\n3. Hard-coded defaults\n\nProvide a JSON file at `config/config.json` (or set `RELEASE_INFORMER_CONFIG_PATH` to an absolute path) to manage settings locally:\n\n```json\n{\n   \"telegram\": {\n      \"apiKey\": \"YOUR_TELEGRAM_BOT_TOKEN\"\n   },\n   \"couch\": {\n      \"protocol\": \"http\",\n      \"host\": \"127.0.0.1\",\n      \"port\": 5984,\n      \"user\": \"admin\",\n      \"password\": \"\",\n      \"requestsTimeout\": 30\n   },\n   \"runtime\": {\n      \"bootstrapServices\": true\n   }\n}\n```\n\nSet `runtime.bootstrapServices` to `false` (default in `testing` environment) to skip bot initialization and external service connections while still registering routes.\n\n### Production Configuration\n\nFor production deployments, ensure:\n- Set `LOG_LEVEL=info` or `LOG_LEVEL=warning`\n- Provide CouchDB credentials via configuration (environment variables or JSON file)\n- Use proper secrets management for the Telegram bot token\n- Set up monitoring and health checks on port 8080\n- Ensure the `couchdb-swift_CouchDBClient.resources` bundle is deployed alongside the binary. When you build with SwiftPM (e.g., `swift build --swift-sdk x86_64-swift-linux-musl -c release`), copy both of these paths to the server directory where you host the executable:\n   - `.build/x86_64-swift-linux-musl/release/ReleaseInformerBot`\n   - `.build/x86_64-swift-linux-musl/release/couchdb-swift_CouchDBClient.resources`\n   A minimal deployment directory on the server should look like:\n   ```\n   /home/user/ReleaseInformerBot\n   ├── ReleaseInformerBot\n   └── couchdb-swift_CouchDBClient.resources/\n   ```\n\n## CouchDB Setup\n\nThe bot will automatically create the required CouchDB database (`release_bot`) and design document with the necessary views on startup.\n\n**Automatic Setup:**\n\n- The `DBManager` includes a `setupIfNeed()` method that checks for the existence of the database and required views, and creates them if they do not exist. No manual setup is required for most users—just ensure your CouchDB instance is running and credentials are provided through configuration.\n\n**Manual Setup (optional):**\n\nIf you prefer to create the database and design document manually, use the following JSON for the design document:\n\n```json\n{\n   \"_id\": \"_design/list\",\n   \"language\": \"javascript\",\n   \"views\": {\n       \"by_bundle\": {\n           \"map\": \"function(doc) {\\n  emit(doc.bundle_id, doc);\\n}\"\n       },\n       \"by_chat\": {\n           \"map\": \"function(doc) {\\n  for (var i=0; i\u003cdoc.chats.length; i++) {\\n    emit(doc.chats[i], doc);\\n  }\\n}\"\n       }\n   }\n}\n```\n\nCreate a database named `release_bot` and add this design document for optimal performance.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakoni%2Freleaseinformerbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmakoni%2Freleaseinformerbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakoni%2Freleaseinformerbot/lists"}