refactor: migrate monolithic crate to Cargo Workspace with Clean Architecture
Transform the single binary crate into a 9-crate workspace monorepo: - Root Cargo.toml as [workspace] manager with resolver = "2" - zesdex-entities: Domain entity types (session, settings, store, message, etc.) - zesdex-utils: Pure utility functions (error, logger, pagination, slug, clipboard) - zesdex-dto: Data Transfer Objects for LLM provider API communication - zesdex-ipc: Unix-socket IPC layer (client/server/framing/protocol) - zesdex-iam: Identity & Access Management (Clean Architecture: domain/application/infrastructure) - zesdex-cms: Content Management (Clean Architecture: domain/application/infrastructure) - zesdex-middleware: HTTP middleware (Auth, CORS, Rate Limiting) - zesdex-libs: Composition root (AppContext, DB init, JWT, Argon2) - zesdex-backend: Main binary entry point + seed/migrate binaries - DevOps: Dockerfile, docker-compose, Nix (flake/shell/default), CI/CD updates - Remove dead root src/ and src-misc/ directories All crate re-exports maintain backward compatibility with original crate::model::*, crate::dto::*, crate::ipc::* module paths. Feature crates enforce strict layer separation: domain -> application -> infrastructure with generic trait-based dependency injection.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
//! Re-exports from `zesdex-entities` (canonical types) and `zesdex-dto`
|
||||
//! (provider request/response) under the original module paths.
|
||||
//!
|
||||
//! Chat types come from the entities crate to avoid type duplication
|
||||
//! with `crate::model::conversation::Conversation` which stores
|
||||
//! `ChatMessage` values. Provider wire types come from the dto crate.
|
||||
|
||||
pub mod chat {
|
||||
pub mod message {
|
||||
pub use zesdex_entities::seaorm::common::message::*;
|
||||
}
|
||||
pub mod tool {
|
||||
pub use zesdex_entities::seaorm::common::tool_call::*;
|
||||
}
|
||||
}
|
||||
|
||||
pub mod provider {
|
||||
pub mod request {
|
||||
pub use zesdex_dto::provider::request::*;
|
||||
pub use zesdex_dto::provider::request::ChatCompletionRequest as ChatRequest;
|
||||
}
|
||||
pub mod response {
|
||||
pub use zesdex_dto::provider::response::ChatCompletionResponse as ChatResponse;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user