# ๐Ÿš€ ULTIMATE TELEGRAM CMS SYSTEM - Implementation Plan **Status:** Ready to implement **Duration:** ~15 minutes **Completion:** 8/8 workflows --- ## ๐ŸŽฏ System Overview Your portfolio will be **fully manageable via Telegram** with these features: ### โœ… Commands (All work via Telegram Bot) | Command | Function | Example | |---------|----------|---------| | `/start` | Main dashboard with quick action buttons | - | | `/list projects` | Show all draft projects | `/list projects` | | `/list books` | Show pending book reviews | `/list books` | | `/search ` | Search projects & books | `/search nextjs` | | `/stats` | Analytics dashboard (views, trends) | `/stats` | | `/preview ` | Show EN + DE translations before publish | `/preview 42` | | `/publish ` | Publish project or book (auto-detects type) | `/publish 42` | | `/delete ` | Delete project or book | `/delete 42` | | `/deletereview ` | Delete specific book review translation | `/deletereview 3` | | `.review ` | Create AI-powered book review | `.review427565 4 Great book!` | --- ## ๐Ÿ“ฆ Workflow Architecture ``` โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ ๐Ÿค– ULTIMATE TELEGRAM CMS (Master Router) โ”‚ โ”‚ Handles: /start, /list, /search, /stats, /preview, etc. โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ” โ”‚ Docker โ”‚ โ”‚ Book โ”‚ โ”‚ Status โ”‚ โ”‚ Events โ”‚ โ”‚ Reviews โ”‚ โ”‚ API โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ Auto-creates AI prompts Spotify + project drafts for reviews Discord + WakaTime ``` --- ## ๐Ÿ› ๏ธ Implementation Steps ### **1. Command Router** โœ… (DONE) - File: `ULTIMATE-Telegram-CMS.json` - Central command parser - Switch routes to 10 different actions ### **2. /start Dashboard** ```telegram ๐Ÿ  Portfolio CMS Dashboard ๐Ÿ“Š Quick Stats: โ”œโ”€ 3 Draft Projects โ”œโ”€ 2 Pending Reviews โ””โ”€ Last updated: 2 hours ago โšก Quick Actions: โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ ๐Ÿ“‹ List Drafts โ”‚ ๐Ÿ” Search โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ ๐Ÿ“ˆ Stats โ”‚ ๐Ÿ”„ Sync Now โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ ``` ### **3. /list Command** ```telegram ๐Ÿ“‹ Draft Projects (3): 1๏ธโƒฃ #42 Portfolio Website Category: webdev Created: 2 days ago /preview42 ยท /publish42 ยท /delete42 2๏ธโƒฃ #38 Suricata IDS Category: selfhosted Created: 1 week ago /preview38 ยท /publish38 ยท /delete38 โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ /list books โ†’ See book reviews ``` ### **4. /search Command** ```telegram ๐Ÿ” Search: "nextjs" Found 2 results: ๐Ÿ“ฆ Projects: 1. #42 - Portfolio Website (Next.js 15...) ๐Ÿ“š Books: (none) ``` ### **5. /stats Command** ```telegram ๐Ÿ“ˆ Portfolio Stats (Last 30 Days) ๐Ÿ† Top Projects: 1. Portfolio Website - 1,240 views 2. Docker Setup - 820 views 3. Suricata IDS - 450 views ๐Ÿ“š Book Reviews: โ”œโ”€ Total: 12 books โ”œโ”€ This month: 3 reviews โ””โ”€ Avg rating: 4.2/5 โšก Activity: โ”œโ”€ Projects published: 5 โ”œโ”€ Drafts created: 8 โ””โ”€ Reviews written: 3 ``` ### **6. /preview Command** ```telegram ๐Ÿ‘๏ธ Preview: Portfolio Website (#42) ๐Ÿ‡ฌ๐Ÿ‡ง ENGLISH: Title: Modern Portfolio with Next.js Description: A responsive portfolio showcasing... ๐Ÿ‡ฉ๐Ÿ‡ช DEUTSCH: Title: Modernes Portfolio mit Next.js Description: Ein responsives Portfolio das... โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ /publish42 ยท /delete42 ``` ### **7. Publish/Delete Logic** - Auto-detects collection (projects vs book_reviews) - Fetches item details from Directus - Updates `status` field - Sends confirmation with item title ### **8. AI Review Creator** โœ… (Already works!) - `.review ` - Calls OpenRouter AI - Generates EN + DE translations - Creates draft in Directus --- ## ๐Ÿ”ง Technical Implementation ### **Workflow 1: ULTIMATE-Telegram-CMS.json** **Nodes:** 1. Telegram Trigger (listens to messages) 2. Parse Command (regex matcher) 3. Switch Action (10 outputs) 4. Dashboard Node โ†’ Fetch stats from Directus 5. List Node โ†’ Query projects/books with pagination 6. Search Node โ†’ GraphQL search on Directus 7. Stats Node โ†’ Aggregate views/counts 8. Preview Node โ†’ Fetch translations 9. Publish Node โ†’ Update status field 10. Delete Node โ†’ Delete item + translations ### **Directus Collections Used:** - `projects` (slug, title, category, status, technologies, translations) - `book_reviews` (hardcover_id, rating, finished_at, translations) - `tech_stack_categories` (name, technologies) ### **APIs Integrated:** - โœ… Directus CMS (Bearer Token: `RF2Qytq...`) - โœ… Hardcover.app (GraphQL) - โœ… OpenRouter AI (Free models) - โœ… Gitea (Self-hosted Git) - โœ… Spotify, Discord Lanyard, Wakapi --- ## ๐ŸŽจ Telegram UI Patterns ### **Inline Keyboards:** ```javascript { "replyMarkup": "inlineKeyboard", "inlineKeyboard": { "rows": [ { "buttons": [ { "text": "๐Ÿ“‹ List", "callbackData": "list_projects" }, { "text": "๐Ÿ” Search", "callbackData": "search_prompt" } ] } ] } } ``` ### **Pagination:** ```javascript { "buttons": [ { "text": "โ—€๏ธ Prev", "callbackData": "list_page:1" }, { "text": "Page 2/5", "callbackData": "noop" }, { "text": "โ–ถ๏ธ Next", "callbackData": "list_page:3" } ] } ``` --- ## ๐Ÿ“Š Implementation Checklist - [x] Command parser with 10 actions - [ ] Dashboard (/start) with stats - [ ] List command (projects/books) - [ ] Search command (fuzzy matching) - [ ] Stats dashboard (views, trends) - [ ] Preview command (EN + DE) - [ ] Unified publish logic (auto-detect collection) - [ ] Unified delete logic with confirmation - [ ] Error handling (try-catch all API calls) - [ ] Logging (audit trail in Directus) --- ## ๐Ÿš€ Deployment Steps 1. **Import workflow:** n8n โ†’ Import `ULTIMATE-Telegram-CMS.json` 2. **Set credentials:** - Telegram Bot: `DK0_Server` (already exists) - Directus Bearer: `RF2Qytq...` (already exists) 3. **Activate workflow:** Toggle ON 4. **Test commands:** ``` /start /list projects /stats ``` --- ## ๐ŸŽฏ Future Enhancements 1. **Media Upload** - Send image โ†’ "For which project?" โ†’ Auto-upload 2. **Scheduled Publishing** - `/schedule ` 3. **Bulk Operations** - `/bulkpublish`, `/archive` 4. **Webhook Monitoring** - Alert if workflows fail 5. **Multi-language AI** - Switch between OpenRouter models 6. **Undo Command** - Revert last action --- ## ๐Ÿ“ Notes - Chat ID: `145931600` (hardcoded, change if needed) - Timezone: Europe/Berlin (hardcoded in some workflows) - AI Model: `openrouter/free` (cheapest, decent quality) - Rate Limit: None (add if needed) --- **Ready to deploy?** Import `ULTIMATE-Telegram-CMS.json` into n8n and activate it!