How brewpipeline/blog-server works
Project Type and Purpose
• This is a backend‐only, modular blog platform written in Rust. It exposes a JSON/HTTP API for posts, comments, and author management, applies database migrations on startup, and broadcasts events to Telegram and Discord (optionally via RabbitMQ). The web front-end lives in a separate blog-ui repository (server-side rendering supported via a feature).
File Structure
• Top-level files:
• Cargo.toml (workspace)
• config.yaml (runtime notifications config)
• index.html (fallback/static file)
• .github/workflows (CI for builds/tests)
• Three workspace crates:
a. blog-server-api
– Entry point (main.rs), HTTP router (router.rs), endpoint modules (src/endpoints/*), DB migrations (src/migrations/*), authentication & JWT utilities (src/utils/*).
b. blog-server-services
– Business‐logic service layer: traits (src/traits/*) and implementations (src/impls/*) for posts, comments, authors, and event bus (RabbitMQ) plus external integrations (Discord, Telegram).
c. blog-generic
– Shared domain entities (src/entities/*), domain events (src/events/*), page processing utilities, author/slug helpers.
• Look for architectural patterns:
• Clear separation of HTTP layer (API), service/domain layer, and persistence/events
• Trait-based abstractions for easy replacement/mocking (e.g., Rbatis, RabbitMQ)
• Cargo workspace for modular reuse
README for Additional Insights
• Tech stack: Screw ecosystem + Hyper for HTTP, Rbatis + PostgreSQL for the database, RabbitMQ for the event bus.
• Features: Optional SSR, optional Yandex/Telegram login, config‐driven notification channels.
• Startup sequence: apply migrations → connect to RabbitMQ (if available) → listen on SERVER_ADDRESS.
• API path prefix: /api/* with standard CRUD routes.