animedb
animedb is a Rust-first metadata project for local media servers.
Advisory
animedbstores and normalizes public metadata, but it does not override provider Terms of Service, attribution requirements, authentication rules, rate limits or mature-content restrictions. Before enabling bulk sync for a source, verify that your intended usage is allowed by that source and configure conservative sync budgets.
It has two consumption modes that can be used separately or together:
- local-first: manage a local SQLite catalog with schema, downloads, sync, FTS5 search and JSON source payloads
- remote-first: query normalized metadata from remote providers without forcing client applications to manage persistence or provider-specific normalization
The project also ships a Rust GraphQL API on top of the same crate.
See REFERENCE.md for the current library and API reference.
Workspace
crates/animedb- library crate with SQLite schema management, sync and query APIscrates/animedb-api- GraphQL API binary built on top ofanimedb
Current Rust surface
Local-first
use ;
let = generate_database_with_report?;
println!;
let updated = sync_database?;
println!;
let monster = db.anime_metadata.by_external_id?;
println!;
let movies = db.movie_metadata.search?;
println!;
# Ok::
Remote-first
use AnimeDb;
let remote = remote_anilist;
let results = remote.anime_metadata.search?;
let media = remote.anime_metadata.by_id?;
# Ok::
Or choose the provider dynamically:
use ;
let remote = remote;
let results = remote.movie_metadata.search?;
# Ok::
Database design
The SQLite catalog is created and migrated by the crate itself. The current schema includes:
media- canonical normalized recordsmedia_alias- normalized aliases and synonymsmedia_external_id- source-specific identifierssource_record- raw per-source JSON payloads and source update metadatafield_provenance- winner-per-field audit trail for canonical merge decisionssync_state- persisted sync checkpoints/cursorsmedia_fts-FTS5index for title, alias and synopsis search
The connection is configured with:
PRAGMA journal_mode=WALPRAGMA synchronous=NORMALPRAGMA foreign_keys=ONPRAGMA busy_timeout=5000PRAGMA temp_store=MEMORY
GraphQL API
The GraphQL API is provided by animedb-api.
Run it locally:
Environment variables:
ANIMEDB_DATABASE_PATH- SQLite file path, default/data/animedb.sqliteANIMEDB_LISTEN_ADDR- bind address, default0.0.0.0:8080
Endpoints:
GET /- GraphQL PlaygroundPOST /graphql- GraphQL endpointGET /healthz- health check
Docker
Build and run the Rust GraphQL API:
Make targets
The repository now includes a Makefile for the common workflows:
make build- compile the workspacemake test- run the Rust test suitemake crate-real- run the real-provider crate example against AniList, Jikan and Kitsumake test-real- run the end-to-end real pipeline: crate example + Docker API + GraphQL checksmake docker-build- build the API imagemake docker-run- run the API image locallymake debug-api- run the GraphQL API directly withcargo run