{"id":14986598,"url":"https://github.com/rinminase/anidb-be","last_synced_at":"2025-04-11T20:32:39.769Z","repository":{"id":39998980,"uuid":"193341191","full_name":"RinMinase/anidb-be","owner":"RinMinase","description":"💬🐳 Rin Minase's AniDB API Service utilizing the latest version of Laravel and deployed to Heroku","archived":false,"fork":false,"pushed_at":"2025-04-10T20:50:22.000Z","size":3713,"stargazers_count":7,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T21:35:24.355Z","etag":null,"topics":["anilist-api","cloudinary","docker","functional-testing","graphql","heroku","laravel","open-api","open-api-v3","php","phpunit","postgresql","restful-api","sentry","swagger","web-scraping"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RinMinase.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-06-23T11:43:33.000Z","updated_at":"2025-04-10T20:50:29.000Z","dependencies_parsed_at":"2024-04-21T03:23:55.600Z","dependency_job_id":"f028aef4-fe4d-4ecf-b947-17bf382bf6bd","html_url":"https://github.com/RinMinase/anidb-be","commit_stats":{"total_commits":2076,"total_committers":1,"mean_commits":2076.0,"dds":0.0,"last_synced_commit":"770e327d75428533aa814d9575f836ee92dbd7b0"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RinMinase%2Fanidb-be","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RinMinase%2Fanidb-be/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RinMinase%2Fanidb-be/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RinMinase%2Fanidb-be/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RinMinase","download_url":"https://codeload.github.com/RinMinase/anidb-be/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248476566,"owners_count":21110315,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anilist-api","cloudinary","docker","functional-testing","graphql","heroku","laravel","open-api","open-api-v3","php","phpunit","postgresql","restful-api","sentry","swagger","web-scraping"],"created_at":"2024-09-24T14:13:12.351Z","updated_at":"2025-04-11T20:32:39.758Z","avatar_url":"https://github.com/RinMinase.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e Rin Minase's Anime Database\u003cbr\u003e(Back-end API Service) \u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://laravel.com\"\u003e\n        \u003cimg alt=\"Laravel\" src=\"https://img.shields.io/badge/laravel-11-red.svg?logo=laravel\u0026logoColor=white\u0026style=for-the-badge\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://php.net\"\u003e\n        \u003cimg alt=\"PHP\" src=\"https://img.shields.io/badge/php-8.4-blue.svg?logo=php\u0026logoColor=white\u0026style=for-the-badge\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n## Introduction\n_Add info here_\n\n## Table Of Contents\n\n- [Getting Started](#getting-started)\n    - [Environment variables setup](#environment-variables-setup)\n    - [Running the project](#running-the-project)\n    - [Running the optional containers](#running-the-optional-containers)\n    - [Re-running the project](#re-running-the-project)\n    - [Running scheduled tasks](#running-scheduled-tasks)\n    - [Running the Swagger Generator / API Documentation Generator](#running-the-swagger-generator--api-documentation-generator)\n    - [Running the Unit Tests](#running-the-unit-tests)\n    - [Project shorthands / aliases inside the PHP Docker container](#project-shorthands--aliases-inside-the-php-docker-container)\n- [Project Structure](#project-structure)\n- [Project Tech Stack](#built-with)\n\n## Getting Started\n\n### Environment variables setup\n\u003csub\u003e\u003csup\u003e[Return to the table of contents](#table-of-contents)\u003c/sup\u003e\u003c/sub\u003e\n\n1. Database\n\n    Definition of terms:\n    - **DB_HOST** - docker **container name** of the database\n    - **DB_PORT** - port used by the database\n    - **DB_DATABASE** - database username\n    - **DB_PASSWORD** - database password\n\n    **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.\n\n2. Cloudinary\n    - Fire up your browser and login your [Cloudinary Account](https://cloudinary.com/users/login). If you have no account yet, you can [create one](https://cloudinary.com/users/register/free) for free.\n    - After logging in, navigate to the [Cloudinary Console](https://cloudinary.com/console) to retrieve your Cloudinary URL\n    - Copy the value of `API Environment variable` to `CLOUDINARY_URL` of your ENV file\n\n\n### Running the project\n\u003csub\u003e\u003csup\u003e[Return to the table of contents](#table-of-contents)\u003c/sup\u003e\u003c/sub\u003e\n\n1. [Download](https://www.docker.com/products/docker-desktop) and install Docker.\n\n2. Clone the project, then install the dependencies\n\n    ```bash\n    git clone https://github.com/RinMinase/anidb-be.git\n    cd anidb-be\n    ```\n\n3. Run the necessary docker containers\n\n    ```bash\n    docker compose up -d\n    docker compose exec php sh\n    ```\n\n    This runs only the necessary containers. As for running the optional containers, please see the section [below](#running-the-optional-containers).\n\n4. Inside the docker image, copy the env file, install the necessary dependencies and generate the necessary key for laravel\n\n    ```bash\n    cp .env.example .env\n    composer install\n    php artisan key:generate\n    ```\n\n5. Generate the necessary API key and take note of this is as this is REQUIRED to access the API\n\n    ```bash\n    php artisan app:generate-api-key\n    ```\n    or you can generate your own from any application, and add it under `API_KEY` in your `.env` file. Example:\n    ```bash\n    openssl rand -hex 36\n    ```\n\n6. Generate the necessary root password key and take note of this is as this is REQUIRED to create admin accounts\n\n    ```bash\n    php artisan app:generate-root-password\n    ```\n    or generate your own, and add it under `APP_REGISTRATION_ROOT_PASSWORD` in your `.env` file.\n\n7. Cache the config file, then run the database migrations\n\n    ```bash\n    php artisan config:cache\n    php artisan migrate:fresh --seed\n    ```\n\n7. Fire up your browser and go to `localhost`.\n\n**Note:**\nIf you need to access the container run, `docker compose exec php sh`\n\n\n### Running the optional containers\n\u003csub\u003e\u003csup\u003e[Return to the table of contents](#table-of-contents)\u003c/sup\u003e\u003c/sub\u003e\n\nList of **optional** containers:\n\n| Name   | Description                                                                |\n| ------ | -------------------------------------------------------------------------- |\n| dbui   | GUI for postgres using [sosedoff/pgweb](https://github.com/sosedoff/pgweb) |\n\nYou can run them individually by:\n\n```bash\ndocker compose up -d \u003cname\u003e\n```\n\nOr run all of them by:\n\n```bash\ndocker compose up -d --profile optional\n```\n\n\n### Re-running the project\n\u003csub\u003e\u003csup\u003e[Return to the table of contents](#table-of-contents)\u003c/sup\u003e\u003c/sub\u003e\n\n1. Navigate inside the `php` docker container\n\n    ```bash\n    docker compose exec php sh\n    ```\n\n2. Run the migrations when necessary, then install the dependencies also when necessary\n\n    ```bash\n    php artisan migrate\n    composer install\n    ```\n\n3. Fire up your browser and go to `localhost`.\n\n\n### Running scheduled tasks\n\u003csub\u003e\u003csup\u003e[Return to the table of contents](#table-of-contents)\u003c/sup\u003e\u003c/sub\u003e\n\n1. Navigate inside the `php` docker container [[how]](#re-running-the-project)\n\n2. Run the command to run the scheduled tasks manually\n\n    ```bash\n    php artisan schedule:run\n    ```\n\nThere are a few commands specific to running tasks:\n\n| Name              | Description                                                  |\n| ----------------- | ------------------------------------------------------------ |\n| `schedule:run`    | `Runs the scheduled tasks manually` **with respect to cron** |\n| `schedule:work`   | `Runs the scheduler daemon / worker`                         |\n| `schedule:list`   | `Lists the upcoming tasks to be run`                         |\n\n\n### Running the Swagger Generator / API Documentation Generator\n\u003csub\u003e\u003csup\u003e[Return to the table of contents](#table-of-contents)\u003c/sup\u003e\u003c/sub\u003e\n\n1. Navigate inside the `php` docker container [[how]](#re-running-the-project)\n\n2. Run the command to generate the documentations inside the container\n\n    ```bash\n    docs\n    ```\n\n3. Fire up your browser and go to `localhost/docs` to open Swagger UI.\n\n### Running the Unit Tests\n\u003csub\u003e\u003csup\u003e[Return to the table of contents](#table-of-contents)\u003c/sup\u003e\u003c/sub\u003e\n\n1. Navigate inside the `php` docker container [[how]](#re-running-the-project)\n\n2. Run the command below:\n    ```bash\n    php artisan test\n    ```\n    or if you want to run a specific test module\n    ```\n    php artisan test --filter \u003cClass name of Test File | function name\u003e\n    ```\n    or if you want to run a specific single test\n    ```bash\n    php artisan test --filter test_function_name tests/Location/of/TestCase.php\n    ```\n\n### Project shorthands / aliases inside the PHP Docker container\n\u003csub\u003e\u003csup\u003e[Return to the table of contents](#table-of-contents)\u003c/sup\u003e\u003c/sub\u003e\n\nThis shortcuts were created to reduce the need to keep typing the same long commands over and over again.\n\n| Shortcut          | Long version            |\n| ----------------- | ----------------------- |\n| `pa` or `artisan` | `php artisan`           |\n| `docs`            | `composer docs`         |\n| `dump` or `da`    | `composer dumpautoload` |\n\n\n## Project Structure\n\u003csub\u003e\u003csup\u003e[Return to the table of contents](#table-of-contents)\u003c/sup\u003e\u003c/sub\u003e\n\n    .\n    ├── app/                     # Application source code\n    │   ├── docs.blade.php       # Swagger page template\n    │   ├── index.blade.php      # Landing page template\n    │   └── ...                  # Other application-related files\n    ├── bootstrap/               # Project initializers\n    │   ├── app.php              # Framework bootstrapper\n    │   ├── helpers.php          # Helper functions\n    │   └── routes.php           # Route definitions\n    ├── config/                  # Laravel configuration files\n    ├── database/                # Database migrations and seeders\n    ├── docker/                  # Docker functions\n    │   ├── php-config/          # PHP settings for docker\n    │   ├── sites/               # Nginx sites for docker\n    │   ├── nginx.dockerfile     # Nginx container docker file\n    │   ├── php.dockerfile       # PHP container docker file\n    │   └── ...                  # Other docker files\n    ├── public/                  # Project entry point\n    ├── tests/                   # Project test files\n    ├── .czrc                    # Commitizen configuration file\n    ├── docker-compose.yml       # Main docker file\n    ├── phpunit.xml              # Unit test configuration file\n    ├── Procfile                 # Heroku process file\n    └── ...                      # Other project files\n\n## Built with\n* \u003cimg width=20 height=20 src=\"https://laravel.com/img/favicon/favicon.ico\"\u003e [Laravel 11](https://laravel.com) - Core Framework\n* \u003cimg width=20 height=20 src=\"https://www.php.net/favicon.ico\"\u003e [PHP 8.4](https://php.net) - Language syntax\n* \u003cimg width=20 height=20 src=\"https://www.postgresql.org/favicon.ico\"\u003e [PostgreSQL](https://www.postgresql.org) - Database\n* \u003cimg width=20 height=20 src=\"https://www.docker.com/wp-content/uploads/2022/03/vertical-logo-monochromatic-480x411.png\"\u003e [Docker](https://www.docker.com) - Container platform\n* \u003cimg width=20 height=20 src=\"https://sentry.io/static/favicon-46f8676a36982f8eb852ac6860387755.ico\"\u003e [Sentry](https://sentry.io/) - Application Monitoring\n* \u003cimg width=20 height=20 src=\"https://static1.smartbear.co/swagger/media/assets/swagger_fav.png\"\u003e [Swagger](https://swagger.io/) - API Documentation\n* \u003cimg width=20 height=20 src=\"https://www.herokucdn.com/favicons/favicon.ico\"\u003e [Heroku](https://www.heroku.com) - Hosting and Continuous Integration (CI) service\n* \u003cimg width=20 height=20 src=\"https://phpunit.de/favicon-32x32.png\"\u003e [PHPUnit](https://phpunit.de/) - Unit Testing\n* \u003cimg width=20 height=20 src=\"https://restfulapi.net/wp-content/uploads/rest.png\"\u003e [RESTful API](https://restfulapi.net) - HTTP Requests Architecture\n\n## Deployed to\n* \u003cimg width=20 height=20 src=\"https://www.herokucdn.com/favicons/favicon.ico\"\u003e [Heroku](http://rin-anidb.herokuapp.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frinminase%2Fanidb-be","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frinminase%2Fanidb-be","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frinminase%2Fanidb-be/lists"}