๐ฌ๐ณ Rin Minase's AniDB API Service utilizing the latest version of Laravel and deployed to Heroku
ISC License
Add info here
Note: You can disable specific modules
This is done by setting these specific ENV flags to true, to disable them.
DISABLE_SCRAPER - Disables WebScraper
Database
Definition of terms:
These are the configuration options for the database:
DB_CONNECTION=pgsql
DATABASE_URL=
DB_HOST=anidb-pgsql
DB_PORT=5432
DB_DATABASE=anidb
DB_USERNAME=postgres
DB_PASSWORD=postgres
Notes : DB_HOST should use docker container name of db, by default this is 'anidb-pgsql', but yours could be different. You can check this by running docker ps
then check the container name of the postgres
container.
Cloudinary
API Environment variable
to CLOUDINARY_URL
of your ENV fileDownload and install Docker for Windows
.
Clone the project, then install the dependencies
git clone https://github.com/RinMinase/anidb-be.git
cd anidb-be
Run the necessary docker containers
docker-compose up -d
docker-compose exec php sh
Inside the docker image, copy the env file, install the necessary dependencies and generate the API Key
cp .env.example .env
composer install
php artisan key:generate
Modify the ENV file with the necessary configuration values
Clear the Laravel config cache, then run the database migrations
php artisan config:clear
php artisan migrate:fresh --seed
Fire up your browser and go to localhost
.
Note:
If you need to access the container run, docker-compose exec php bash
Navigate to the project foler root then run docker-compose up -d
Run the migrations when necessary, then install the dependencies also when necessary
php artisan migrate
composer install
Fire up your browser and go to localhost
.
Navigate to the project foler root then run docker-compose up -d
Run the command below:
composer docs
Fire up your browser and go to localhost/docs
to open Swagger UI.
Navigate to the project foler root then run docker-compose up -d
Run the command below:
php artisan test
or if you want to run a specific test module
php artisan test --filter <Class Name of Test File>
or if you want to run a specific single test
php artisan test --filter test_function_name tests/Location/of/TestCase.php
This shortcuts were created to reduce the need to keep typing the same long commands over and over again.
Shortcut | Long version |
---|---|
pa or artisan
|
php artisan |
docs |
composer docs |
dump or da
|
composer dumpautoload |
.
โโโ app/ # Application source code
โ โโโ docs.blade.php # Swagger page template
โ โโโ index.blade.php # Landing page template
โ โโโ ... # Other application-related files
โโโ bootstrap/ # Project initializers
โ โโโ app.php # Framework bootstrapper
โ โโโ helpers.php # Helper functions
โ โโโ routes.php # Route definitions
โโโ config/ # Laravel configuration files
โโโ database/ # Database migrations and seeders
โโโ docker/ # Docker functions
โ โโโ php-config/ # PHP settings for docker
โ โโโ sites/ # Nginx sites for docker
โ โโโ nginx.dockerfile # Nginx container docker file
โ โโโ php.dockerfile # PHP container docker file
โ โโโ ... # Other docker files
โโโ public/ # Project entry point
โโโ tests/ # Project test files
โโโ .czrc # Commitizen configuration file
โโโ docker-compose.yml # Main docker file
โโโ phpunit.xml # Unit test configuration file
โโโ Procfile # Heroku process file
โโโ ... # Other project files