Categorygithub.com/rl404/mal-db
module
0.5.4
Repository: https://github.com/rl404/mal-db.git
Documentation: pkg.go.dev

# README

mal-db

MyAnimeList database dump and REST API.

Powered by my go-malscraper.

Features

  • Save anime detail, character list, staff list, and stats.
  • Save manga detail, character list, and stats.
  • Save character detail, animeography list, mangaography list, and voice actor list.
  • Save people detail, anime character role list, anime staff role list, and published manga list.
  • Database (postgresql)
  • Caching (in-memory, redis, memcache)
  • Logging (elasticsearch)
  • PubSub (redis, nsq, rabbitmq)
  • Swagger
  • Docker

More will be coming soon...

Requirement

Installation

With Go

  1. Clone the repository.
git clone github.com/rl404/mal-db
  1. Update .env file.
  2. Prepare the database.
make install
  1. Build and run worker.
make worker
  1. In another console/terminal, build and run server.
make server

With Docker & Docker compose

  1. Clone the repository.
git clone github.com/rl404/mal-db
  1. Update .env file.
  2. Prepare the database.
make docker-install
  1. Build and run server & worker.
make docker-up

To stop containers.

make docker-stop

Config

Env are optional except the ones with *.

EnvDefaultDescription
MAL_WEB_PORT8006HTTP port
MAL_WEB_READ_TIMEOUT5HTTP read timeout (in seconds)
MAL_WEB_WRITE_TIMEOUT5HTTP write timeout (in seconds)
MAL_WEB_GRACEFUL_TIMEOUT10HTTP server shutdown timeout (in seconds)
MAL_WORKER_AGE_LIMIT604800Entry age that needs to be re-parsed (in seconds)
MAL_WORKER_BREAK_TIME5Break time between parsing (in seconds)
MAL_CACHE_DIALECTinmemoryCache type (nocache, inmemory, redis, memcache)
MAL_CACHE_ADDRESSCache address
MAL_CACHE_PASSWORDCache password
MAL_CACHE_TIME86400Cache time (in seconds)
MAL_LOG_LEVEL4Log all
MAL_LOG_COLORtrueLog color
MAL_DB_ADDRESS*Postgresql host and port
MAL_DB_NAMEDatabase name
MAL_DB_USERDatabase username
MAL_DB_PASSWORDDatabase password
MAL_DB_MAX_CONN_OPEN10Max database open connection
MAL_DB_MAX_CONN_IDLE10Max database idle connection
MAL_DB_MAX_CONN_LIFETIME60Max database connection lifetime
MAL_ES_ADDRESSElasticsearch host and port
MAL_ES_USERElasticsearch user
MAL_ES_PASSWORDElasticsearch password
MAL_PUBSUB_DIALECT*PubSub type (redis, nsq, rabbitmq)
MAL_PUBSUB_ADDRESS*PubSub address
MAL_PUBSUB_USERPubSub user
MAL_PUBSUB_PASSWORDPubSub password

*Required

Log Level

LevelTraceDebugInfoWarnErrorFatal
0:x::x::x::x::x::x:
1:x::x::x::x::heavy_check_mark::heavy_check_mark:
2:x::x::heavy_check_mark::x::heavy_check_mark::heavy_check_mark:
3:x::heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:
4:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:

Disclamer

mal-db is meant for educational purpose and personal usage only. Although there is no limit in using the API, do remember that every scraper method is accessing MyAnimeList page so use it responsibly according to MyAnimeList's Terms Of Service.

All data (including anime, manga, people, etc) belong to their respective copyrights owners. mal-db does not have any affiliation with content providers.

License

MIT License

Copyright (c) 2021 Axel

# Packages

No description provided by the author
No description provided by the author