776fa828d8e961101f148b140bb348302fe31f40
- 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>
Scraper API
Backend service berbasis Axum untuk scraping, image proxy/cache, dan endpoint API inti.
Stack
- Rust + Axum
- SeaORM (MySQL)
- Redis (deadpool-redis)
- Utoipa + Swagger UI
Quick Start
cargo run
Server bind ke 0.0.0.0:${PORT} dengan default port 4091.
Required Environment Variables
DATABASE_URL=mysql://asephs:hunterz@localhost:3306/sosmed
JWT_SECRET=change-me
REDIS_URL=redis://localhost:6379
Optional yang sering dipakai:
RUST_LOG=info
EXTERNAL_BROWSERLESS_WS=
MINIO_ENDPOINT=
MINIO_BUCKET_NAME=
MINIO_ACCESS_KEY=
MINIO_SECRET_KEY=
Useful Endpoints
GET /docs- Swagger UIGET /api-docs/openapi.json- OpenAPI JSONGET /api/anime2/*GET /api/komik/*POST /api/proxy/image-cachePOST /api/proxy/image-cache/audit
Notes
- Database akan dicek/dibuat saat startup jika
DATABASE_URLbertipe MySQL. - Service ini juga menginisialisasi browser pool dan scheduler saat boot.
License
MIT
Languages
Rust
97.5%
Shell
1.3%
Python
1%
JavaScript
0.2%