Description
Refactor the Rust backend to improve code structure and maintainability by separating domain models and HTTP handlers into dedicated modules.
Currently, all logic is implemented in main.rs. This task introduces a modular structure that will make future development (scraping, database integration, filtering) easier and more scalable.
Scope
• Extract Event and HealthResponse into models.rs
• Extract route handler functions into handlers.rs
• Update main.rs to use modules
• Ensure application still runs correctly
• No functional changes (pure refactoring)
Acceptance Criteria
• Project compiles and runs (cargo run)
• /health and /events endpoints still work
• main.rs only contains:
• router setup
• server startup
• Models and handlers are in separate files
Learning Goals
• Understand Rust modules (mod)
• Understand imports (use crate::...)
• Learn how to structure backend projects
• Prepare codebase for future features (scraping, DB)
Description
Refactor the Rust backend to improve code structure and maintainability by separating domain models and HTTP handlers into dedicated modules.
Currently, all logic is implemented in main.rs. This task introduces a modular structure that will make future development (scraping, database integration, filtering) easier and more scalable.
Scope
• Extract Event and HealthResponse into models.rs
• Extract route handler functions into handlers.rs
• Update main.rs to use modules
• Ensure application still runs correctly
• No functional changes (pure refactoring)
Acceptance Criteria
• Project compiles and runs (cargo run)
• /health and /events endpoints still work
• main.rs only contains:
• router setup
• server startup
• Models and handlers are in separate files
Learning Goals
• Understand Rust modules (mod)
• Understand imports (use crate::...)
• Learn how to structure backend projects
• Prepare codebase for future features (scraping, DB)