Skip to content

darchoods/dh-api

Repository files navigation

Darchoods API

Working with this project locally

Working with the docker version of this project

  • docker-compose up -d

The API container should be available on 127.0.0.1:8082 and MySQL should be available on port 127.0.0.1:33060.

Arbitrary Commands

  • Bash into api container before the startup process
docker-compose run --entrypoint /bin/bash api
  • When the container is running you can attach to it using the following command
docker ps | egrep dh\-api\:latest | cut -f1 -d' ' | xargs -o -I % docker exec -it % /bin/bash
  • Run the API without triggering migrations
docker-compose up -d mysql && docker-compose run -e AUTORUN_LARAVEL_MIGRATION=false api

Manually running database seeding or migrations

Seeding

  • php artisan db:seed

Migrations

  • php artisan migrate --force --isolated

Manually verifying the PR checks

Check 1. PHP Linter

  • vendor/bin/phplint app tests

Check 2. PHP Code Style Checker - PSR12

https://www.php-fig.org/psr/psr-12/

  • vendor/bin/phpcs

If the CS Checker comes back with errors that it can automaticlly fix, run

  • vendor/bin/phpcbf

and it should fix them.

Tools used

  • asdf - Version manager

Random host dependencies

Required for building php natively on Ubuntu 22.04 / Jammy

sudo apt install -y re2c plocate libcurl4 libcurl4-doc libcurl4-gnutls-dev libxml++2.6-dev libgd-dev libonig-dev libzip-dev

Releases

No releases published

Packages

No packages published

Languages