asepharyana c7ffd29e79
Deploy Scraper / build-and-deploy (push) Canceled after 0s
refactor: migrate infra to mytheclipse crates (retry, cache, event, ratelimit, config)
Replace hand-rolled infrastructure with the custom mytheclipse library:

- retry (src/infrastructure/scraping/retry.rs): backoff crate -> mytheclipse
  RetryConfig + retry() with retry_all predicate; same call-site helpers.
- cache (src/infrastructure/cache): deadpool raw AsyncCommands ->
  mytheclipse_cache::RedisCache bridge (src/infrastructure/cache/mytheclipse.rs),
  typed JSON wrapper keeps the Cache<'a> API used by use cases.
- events (src/events/bus.rs): custom broadcast pub/sub ->
  mytheclipse_event InMemoryEventBus + TypedEventBus alias.
- ratelimit (src/presentation/middleware/ratelimit.rs): hand-rolled window ->
  mytheclipse::RateLimiter token bucket.
- config (src/config/mod.rs): config crate -> mytheclipse_config ConfigLoader,
  preserving env-only fallback (config files optional).

No route/API/Redis-key changes. mytheclipse-cache path-dep points at local
source (redis 0.32 aligned with deadpool). Removed backoff/config deps.
2026-08-30 18:53:00 +07:00

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
MINIO_ENDPOINT=
MINIO_BUCKET_NAME=
MINIO_ACCESS_KEY=
MINIO_SECRET_KEY=

Useful Endpoints

  • GET /docs - Swagger UI
  • GET /api-docs/openapi.json - OpenAPI JSON
  • GET /api/anime2/*
  • GET /api/komik/*
  • POST /api/proxy/image-cache
  • POST /api/proxy/image-cache/audit

Notes

  • Database akan dicek/dibuat saat startup jika DATABASE_URL bertipe MySQL.
  • Service ini juga menginisialisasi browser pool dan scheduler saat boot.

License

MIT

S
Description
No description provided
Readme
1.7 MiB
Languages
Rust 97.1%
Python 1.9%
Shell 0.6%
Nix 0.3%
JavaScript 0.1%