This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
⚠ DO NOT use this guide. This is for the feature/elasticsearch branch only which is currently under development.
🐳 Docker Installation
Not available.
Manual Installation
ℹ This installation guide is for Jikan REST API v4 only.
-
- Does not require a self-managed installation, you can connect to a cloud-managed MongoDB instance as well
-
- Does not require a self-managed installation, you can connect to a cloud-managed Elasticsearch instance as well
-
Apache (optional)
✅ Tested with Ubuntu 20
Getting Started
Prerequisites
- Install Git and build-essentials for compiling the PHP MongoDB Driver
sudo apt install git build-essential
- Install PHP 8.0
- Install Required PHP 8.0 dependencies
sudo apt install php8.0-{xml,mbstring,common,curl,pear}
- Note:
pear
will install PECL for you
- Install PHP MongoDB Driver
sudo pecl install mongodb
- Add
extension=mongodb.so
to yourphp.ini
(On Ubuntu 20 it will be in/etc/php/8.0/
)
Installing Jikan REST API v4
- Clone the repo in
/var/www
git clone https://github.com/jikan-me/jikan-rest.git
- Jikan REST API v4 will now be in
/var/www/jikan-rest
- Change Directory:
cd jikan-rest
- If you haven't installed Composer 2 yet, now's the time
- Make sure you have appropriate write permissions for
/var/www/jikan-rest
- Install Jikan REST API v4 dependencies
composer install
(If you have Composer installed Globally.php path/to/composer.phar install
- Copy Environment variables
cp .env.dist .env
(Read: Configuring your Jikan REST API v4 Instance)
- Run Database Migrations with
php artisan migrate
- Enable the scheduler by adding it to
corntab -e
* * * * * cd /var/www/jikan-rest && php artisan schedule:run >> /dev/null 2>&1
- You can modify the scheduler here
Ignition
For Development
- For Development purposes, you can use PHP's own built-in webserver
- Run the following in
/var/www/jikan-rest
:php artisan serve
(Read: Artisan Commands)
- Run the following in
Apache
You can use Apache to host the Jikan REST API (it's what I use personally too)
sudo apt install apache2
- Set
AllowOverride All
in/etc/apache2/apache2.conf
inside<Directory /var/www/>
- Edit your virtual host document root
- By default it's in
/etc/apache2/sites-available/000-default.conf
:DocumentRoot /var/www/jikan-rest/public
- If you have other sites, you can set up a different virtual host (Learn More)
- By default it's in
- Enable Mod Rewrite and Mod Deflate (for GZIP'd responses)
sudo a2enmod deflate && sudo a2enmod rewrite
- Restart the Apache server
sudo service apache2 restart
Your very own Jikan REST API v4 is now good to go!
- Tune into http://localhost/v4
to access the API
Nginx/Other Web Servers
- ℹ️ If you wish to configure it for Nginx or anything else, you'll have to port the rewrite rules located at
public/.htaccess
Configuration
https://github.com/jikan-me/jikan-rest/wiki/Configuration
Using Elasticsearch
Troubleshooting
Please read the troubleshooting guide. For any additional help, join our Discord server.
Artisan Commands
Please read the commands guide. For any additional help, join our Discord server.
Information
If you don't want to host your instance, there's a public API available.
Wrappers
See the list of wrappers here