mirror of
https://github.com/Xevion/xevion.dev.git
synced 2026-01-31 06:26:44 -06:00
refactor: reorganize Rust codebase into modular handlers and database layers
- Split monolithic src/db.rs (1122 lines) into domain modules: projects, tags, settings - Extract API handlers from main.rs into separate handler modules by domain - Add proxy module for ISR/SSR coordination with Bun process - Introduce AppState for shared application context - Add utility functions for asset serving and request classification - Remove obsolete middleware/auth.rs in favor of session checks in handlers
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
pub mod assets;
|
||||
pub mod auth;
|
||||
pub mod health;
|
||||
pub mod projects;
|
||||
pub mod settings;
|
||||
pub mod tags;
|
||||
|
||||
// Re-export handlers for easier imports
|
||||
pub use assets::*;
|
||||
pub use auth::*;
|
||||
pub use health::*;
|
||||
pub use projects::*;
|
||||
pub use settings::*;
|
||||
pub use tags::*;
|
||||
|
||||
// Request/Response types used by handlers
|
||||
|
||||
#[derive(serde::Deserialize)]
|
||||
pub struct CreateTagRequest {
|
||||
pub name: String,
|
||||
pub slug: Option<String>,
|
||||
pub color: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(serde::Deserialize)]
|
||||
pub struct UpdateTagRequest {
|
||||
pub name: String,
|
||||
pub slug: Option<String>,
|
||||
pub color: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(serde::Deserialize)]
|
||||
pub struct AddProjectTagRequest {
|
||||
pub tag_id: String,
|
||||
}
|
||||
Reference in New Issue
Block a user