How brewpipeline/blog-ui works
Project type and purpose
• This is a full-stack web UI (single-page application + partial SSR) written in Rust, using Yew for the client, compiled to WebAssembly, styled with Bootstrap.
• It provides a blog interface: posts, authors, tags, comments, admin panel, plus authentication (Telegram, Yandex, internal), SSR for SEO, and integrations (Telegram notifications, image mirroring).
File structure
• Top-level:
• Cargo.toml, build.rs, Trunk.toml → Rust build and Trunk configuration for WASM + SSR.
• index.html, index.css, images/ → static assets.
• src/app.rs + src/lib.rs → application entry points; SSR hooks.
• src/components/, src/pages/ → component-based UI (Yew).
• src/utils/ → reusable helpers (API calls, context, formatting).
• src/bin/blog_ui.rs → optional binary entry (e.g., SSR server).
• CI: .github/workflows/builds.yml, tests.yml.
• README describes features, environment vars, dev and prod build commands.
Architecture overview
Main layers and components:
A. Developer & CI/CD
1. Developer machines (Rust + Trunk + Git)
2. GitHub Actions (build + test workflows)
3. Artifacts: WASM bundle, HTML/CSS, static images
B. Deployment & Hosting
1. CDN or static file host for front-end assets
2. SSR service (binary from src/bin or embedded in a server) for server-side rendering of selected routes (posts, authors, tags)
C. Client & Runtime
1. Browser loads index.html + index.css + WASM module
2. Yew-powered front-end executes in WASM, hydrates/controls the DOM
3. Calls to backend API (API_URL) for data (posts, comments, authors, tags, settings)
D. Backend & External Services
1. Blog-server (REST API)
2. Authentication providers (Telegram OAuth, Yandex OAuth)
3. Notification service (Telegram bot for new posts)
4. Images processor service (mirroring, resizing)
Detail is key—but keep it focused
• Major service and flow.
• Non-obvious environment variables or build steps (e.g., Trunk SSR).