How irilith/vbt works
Main Components
• Backend (Rust):
– Two Rust crates are present: one called “rss” and another called “vbt”. The “vbt” crate is the primary application that contains modules for configuration, file operations, HTTP requests, services (such as the watchlist update), and Discord webhook integration. There is also a dedicated “rss” crate to handle RSS generation or parsing.
– Key modules include:
o Requests: Responsible for fetching or retrieving necessary data.
o File Operations & JSON Processing: Handling reading and writing of JSON/RSS files, caches, and configuration.
o Services: Including a watchlist service to track the books.
o Discord Integration: For sending updates or notifications via webhooks.
• Frontend (Next.js):
– Located in the “pages” directory, this part of the project uses Next.js and React.
– It presents the RSS feeds – for example, offering a website where users can select and copy an RSS feed URL.
– It uses UI components (buttons, dialog, etc.) and configuration files like tailwind.config and next.config.
• GitHub Actions / CI Integration:
– The .github folder contains several workflows (ci.yml, daily.yml, nextjs.yml) that handle continuous integration, daily updates, and perhaps deployment of the Next.js site.
– These workflow files indicate that the project is built and updated automatically via these pipelines.
• Data Feed Storage:
– Local file storage is used as a “database” of sorts, with directories like “feed/json” and “feed/rss” that store actual feed files.
– There are also configuration files like rss.json, watchlist.json, and date_cache.json that control the application’s runtime behavior and caching.
Relationships and Data Flow
• GitHub Actions initiates the periodic runs (daily or on event triggers).
• The backend Rust application (VBT) is built and executed as part of these actions:
– It retrieves the latest data (using its requests and services modules).
– It processes the data (using file_ops, json, and types modules), generates or updates the RSS feeds, and writes these to the “feed” directory.
– It optionally sends notifications or webhook messages via the Discord integration.
• The frontend Next.js application then serves a website that:
– Displays the available book feeds.
– Allows users to copy RSS feed URLs, and possibly provides further interaction.
• There is a clear separation of concerns, with the backend handling all the data processing and feed generation, and the frontend delivering user interaction.
Architectural Patterns and Key Technologies
• Modular Architecture: The backend is organized into distinct Rust crates and clearly separated modules (for file operations, requests, Discord communications, etc.). This encourages clean separation of concerns.
• Full-Stack Design: The system is split into a Rust-based backend and a Next.js frontend.
• CI/CD Integration: GitHub Actions workflows are crucial to automate testing, building, and deployment.
• File-Based Persistence: Instead of a database, the system uses local JSON and RSS files to manage state and feed data.
• External Integration: The Discord webhook integration module shows that the system can push notifications to an external messaging system.
Final Touches
• Avoid overcomplicating; focus on identifying as many separate functional components as possible, as this aids in clarity during discussions with your team.