This plan outlines the steps to implement a Vite-based documentation website for the Telegram-rs library and a weather bot example. The documentation site will include API references, examples, and user-provided demo videos embedded from YouTube. The weather bot will use Telegram-rs for bot logic, OpenWeatherMap API for weather data, in-memory caching for scalability, and environment variables for secure API key handling. Deployment options include GitHub Pages or Vercel.
- Build a comprehensive documentation site to showcase Telegram-rs features.
- Develop a functional weather bot example demonstrating library usage.
- Ensure scalability, security, and ease of deployment.
- Documentation Site: Vite web app with React/Vue, deployed to GitHub Pages or Vercel.
- Demo Videos: User-created and hosted on YouTube; embedded via iframe.
- Weather Bot: Basic location query with OpenWeatherMap; in-memory cache (TTL 10-15 min); API key via env var.
- No Video Generation: User handles video creation externally.
- Set up Vite project in
docs/directory with Markdown support and basic structure (home, API docs, examples, demos). - Configure project dependencies in
docs/package.json(Vite, React/Vue, any plugins for docs). - Initialize basic pages and navigation for the site.
- Build core pages: Populate with content from README.md, PRD, and Rustdoc-generated API references.
- Create demos section with placeholders for YouTube video embeds (user provides iframe code).
- Implement responsive design, search functionality, and styling (e.g., Tailwind CSS).
- Test site locally and ensure embeds work.
- Create
examples/weather_bot.rsbased on existing bot examples (e.g.,simple_bot.rs). - Implement bot logic for
/weather <location>commands using Telegram-rs client. - Integrate OpenWeatherMap API: Add reqwest for HTTP calls, parse JSON responses.
- Add in-memory cache with 10-15 minute TTL using HashMap and Instant for storing weather data.
- Secure API key handling: Load from
OPENWEATHER_API_KEYenv var; document in example README. - Add error handling for invalid locations, API failures, and rate limits.
- Test weather bot: Run locally with polling, simulate commands, verify cache and API integration.
- Update
Cargo.tomlfor any new dependencies (e.g., reqwest if not present). - Configure CI/CD: GitHub Actions for build/test/deploy to GitHub Pages; or link to Vercel for alternative deployment.
- Deploy site and test live; update main README.md with links to docs and weather bot example.
- Rust: Telegram-rs library, reqwest, serde.
- Frontend: Vite, React/Vue, Tailwind CSS.
- Deployment: GitHub Pages (via Actions) or Vercel.
- External: OpenWeatherMap API (free tier), YouTube for videos.
- API Limits: OpenWeatherMap has rate limits; cache helps; monitor usage.
- Video Embeds: Ensure YouTube iframes are responsive; test on mobile.
- Deployment Issues: Have fallback (GitHub Pages if Vercel fails); test builds locally.
- Site: Loads docs, embeds videos, responsive.
- Bot: Handles queries, caches data, secure key usage.
- Code: Passes
cargo check, tests added.
This plan is ready for execution. Confirm to proceed.