feat: full clean architecture refactor — domain → application → infrastructure → presentation

- Restructure from Modular MVC to Clean Architecture with 4 strict layers
- Domain: entities (anime/komik/proxy), Repository traits, typed errors
- Application: use case classes with proper error propagation
- Infrastructure: repository impls, parsers, Redis cache, HTTP/scraping, browser
- Presentation: Axum handlers, DTOs, AppState, router, AppError+IntoResponse
- Migrate all parsers (otakudesu, alqanime, komik) to native infra implementations
- Replace once_cell::sync::Lazy/OnceCell with std::sync::LazyLock/OnceLock
- Remove 150+ old files in modules/ and shared/ directories
- Remove once_cell from Cargo.toml dependencies
- Fix test/debug binaries to use new import paths
- Zero new clippy warnings

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
asepharyana
2026-07-21 12:54:23 +07:00
co-authored by Claude Opus 4.8
parent 80c96eaa42
commit 776fa828d8
205 changed files with 4241 additions and 14569 deletions
@@ -55,7 +55,7 @@ fn generate_list_handler(resource: &str, model: &str) -> String {
use axum::{{Extension, Json, response::IntoResponse, Router}};
use sea_orm::{{DatabaseConnection, EntityTrait}};
use std::sync::Arc;
use crate::shared::state::AppState;
use crate::presentation::state::AppState;
use crate::entities::{model_low}::{{Entity as {model}, Model}};
pub async fn list(
@@ -88,7 +88,7 @@ fn generate_show_handler(resource: &str, model: &str) -> String {
use axum::{{Extension, Json, extract::Path, response::IntoResponse, Router}};
use sea_orm::{{DatabaseConnection, EntityTrait}};
use std::sync::Arc;
use crate::shared::state::AppState;
use crate::presentation::state::AppState;
use crate::entities::{model_low}::{{Entity as {model}, Model}};
pub async fn show(
@@ -125,7 +125,7 @@ use axum::{{Extension, Json, response::IntoResponse, Router}};
use sea_orm::{{ActiveModelTrait, DatabaseConnection, Set}};
use serde::{{Deserialize, Serialize}};
use std::sync::Arc;
use crate::shared::state::AppState;
use crate::presentation::state::AppState;
use crate::entities::{model_low}::{{ActiveModel, Model}};
#[derive(Serialize, Deserialize)]
@@ -172,7 +172,7 @@ use axum::{{Extension, Json, extract::Path, response::IntoResponse, Router}};
use sea_orm::{{ActiveModelTrait, DatabaseConnection, EntityTrait, Set}};
use serde::{{Deserialize, Serialize}};
use std::sync::Arc;
use crate::shared::state::AppState;
use crate::presentation::state::AppState;
use crate::entities::{model_low}::{{ActiveModel, Entity as {model}, Model}};
#[derive(Serialize, Deserialize)]
@@ -228,7 +228,7 @@ fn generate_delete_handler(resource: &str, model: &str) -> String {
use axum::{{Extension, extract::Path, response::IntoResponse, Router}};
use sea_orm::{{ActiveModelTrait, DatabaseConnection, EntityTrait, IntoActiveModel}};
use std::sync::Arc;
use crate::shared::state::AppState;
use crate::presentation::state::AppState;
use crate::entities::{model_low}::{{Entity as {model}}};
pub async fn destroy(
@@ -270,7 +270,7 @@ fn generate_basic_controller(api_dir: &Path, resource: &str) {
use axum::Router;
use std::sync::Arc;
use crate::shared::state::AppState;
use crate::presentation::state::AppState;
pub async fn index() -> &'static str {{
"{resource} endpoint"