Skip to content

rl404/akatsuki

Repository files navigation

Akatsuki

Go Report Card License: MIT GitHub tag (latest SemVer) Docker Image Size (latest semver) publish & deploy

Akatsuki is MyAnimeList anime database dump and REST API.

Powered by my nagato library and MyAnimeList API as reference.

Features

  • Save anime details
    • Anime data
    • Anime genres
    • Anime pictures
    • Anime relation (with other anime)
    • Anime studios
  • Save anime stats history
  • Save user anime list
  • Get all anime related in user anime list
  • Handle empty anime id
  • Auto update anime & user data (cron)
  • Interchangeable database
  • Interchangeable cache
    • no cache
    • inmemory
    • Redis
  • Interchangeable pubsub
  • Swagger
  • Docker
  • Newrelic monitoring
    • HTTP
    • Cron
    • Database
    • Cache
    • Pubsub
    • External API

More will be coming soon...

Requirement

Installation

  1. Clone the repository.
git clone github.com/rl404/akatsuki
  1. Rename .env.sample to .env and modify the values according to your setup.
  2. Create the database according to your .env.
  3. Migrate the tables.
make migrate
  1. Run. You need at least 2 consoles/terminals.
# Run the API.
make

# Run the consumer.
make consumer
  1. localhost:45001 is ready (port may varies depend on your .env).

Other commands

# Update old anime data.
make cron-update

# Fill missing anime data.
make cron-fill
  1. Clone the repository.
git clone github.com/rl404/akatsuki
  1. Rename .env.sample to .env and modify the values according to your setup.
  2. Create the database according to your .env.
  3. Get docker image.
# Pull existing image.
docker pull rl404/akatsuki

# Or build your own.
make docker-build
  1. Migrate the tables.
make docker-migrate
  1. Run the container. You need at least 2 consoles/terminals.
# Run the API.
make docker-api

# Run the consumer.
make docker-consumer
  1. localhost:45001 is ready (port may varies depend on your .env).

Other commands

# Update old anime data.
make docker-cron-update

# Fill missing anime data.
make docker-cron-fill

# Stop running containers.
make docker-stop

Environment Variables

Env Default Description
AKATSUKI_APP_ENV dev Environment type (dev/prod).
AKATSUKI_HTTP_PORT 45001 HTTP server port.
AKATSUKI_HTTP_READ_TIMEOUT 5s HTTP read timeout.
AKATSUKI_HTTP_WRITE_TIMEOUT 5s HTTP write timeout.
AKATSUKI_HTTP_GRACEFUL_TIMEOUT 10s HTTP gracefull timeout.
AKATSUKI_GRPC_PORT 46001 GRPC server port.
AKATSUKI_GRPC_TIMEOUT 10s GRPC timeout.
AKATSUKI_CACHE_DIALECT inmemory Cache type (nocache/redis/inmemory)
AKATSUKI_CACHE_ADDRESS Cache address.
AKATSUKI_CACHE_PASSWORD Cache password.
AKATSUKI_CACHE_TIME 24h Cache time.
AKATSUKI_DB_DIALECT mysql Database type (mysql/postgresql)
AKATSUKI_DB_ADDRESS localhost:3306 Database address with port.
AKATSUKI_DB_NAME akatsuki Database name.
AKATSUKI_DB_USER Database username.
AKATSUKI_DB_PASSWORD Database password.
AKATSUKI_DB_MAX_CONN_OPEN 10 Max open database connection.
AKATSUKI_DB_MAX_CONN_IDLE 10 Max idle database connection.
AKATSUKI_DB_MAX_CONN_LIFETIME 1m Max database connection lifetime.
AKATSUKI_PUBSUB_DIALECT rabbitmq Pubsub type (rabbitmq/redis/google)
AKATSUKI_PUBSUB_ADDRESS Pubsub address (if you are using google, this will be your google project id).
AKATSUKI_PUBSUB_PASSWORD Pubsub password (if you are using google, this will be the content of your google service account json).
AKATSUKI_MAL_CLIENT_ID MyAnimeList client id.
AKATSUKI_CRON_UPDATE_LIMIT 10 Anime count limit when updating old data.
AKATSUKI_CRON_FILL_LIMIT 30 Anime count limit when filling missing anime data.
AKATSUKI_CRON_RELEASING_AGE 1 Age of old releasing/airing anime data (in days).
AKATSUKI_CRON_FINISHED_AGE 30 Age of old finished anime data (in days).
AKATSUKI_CRON_NOT_YET_AGE 7 Age of old not yet released/aired anime (in days).
AKATSUKI_CRON_USER_ANIME_AGE 7 Age of old user anime list (in days).
AKATSUKI_NEWRELIC_NAME akatsuki Newrelic application name.
AKATSUKI_NEWRELIC_LICENSE_KEY Newrelic license key.

Trivia

Akatsuki's name is taken from japanese destroyer with her sisters (Inazuma, Hibiki, Ikazuchi). Also, exists in Kantai Collection games and anime.

Disclaimer

Akatsuki is meant for educational purpose and personal usage only. Please use it responsibly according to MyAnimeList API License and Developer Agreement.

All data belong to their respective copyrights owners, akatsuki does not have any affiliation with content providers.

License

MIT License

Copyright (c) 2022 Axel