Registration system for continental sized Cubing Championships. This is the Backend running on Laravel exposing a Graphql API.
You can find the GraphQL documentation in the GraphQL playground residing on the /graphql-playground
endpoint.
- Language: PHP
^8.1
(PHP documentation) - Framework: Laravel (Laravel documentation)
- API: GraphQL (GraphQL documentation) using Lighthouse (Lighthouse Website)
- Test: PHPUnit (Laravel's test documentation)
- Docker Orchestration: Laravel Sail (Laravel Sail documentation)
- Static Code Analysis: PHPStan (PHPStan website) through Larastan
- Database: MySQL
- Queue DB: AWS SQS
- Emails: AWS SES
Clone this repository
git clone [email protected]:Bnanan-Labs/cube-registration-admin-service.git
DOES NOT WORK WITH NEW MACBOOKS
If you just want to get going, you can setup the application with
bash ./setup.sh
That's it, you should be ready to go now! 🚀
Same as the setup.sh, but here you get to run the commands yourself.
Install dependencies through Docker
docker run --rm \
-u "$(id -u):$(id -g)" \
-v $(pwd):/var/www/html \
-w /var/www/html \
laravelsail/php81-composer:latest \
composer install --ignore-platform-reqs
Create a local .env file
cp -p .env.example .env
Set application key
./vendor/bin/sail artisan key:generate
Starting up Sail
./vendor/bin/sail up -d
Setting up Database
./vendor/bin/sail artisan migrate --seed EuroSeeder
That's it, you should be ready to go now! 🚀
I can highly recommend setting up following alias'
alias sail="./vendor/bin/sail"
alias stan="./vendor/bin/sail php ./vendor/bin/phpstan"
You can start up the application through Sail. You can decide whether you want the docker-compose to run in the foreground (log entries will be directed to StdOut for you to see) or let it run in the background to continue using your terminal
# runs in the foreground
sail up
# runs in the background
sail up -d
You can run the full test suite with
sail artisan test
You can also specify specific tests filtered by a search string with the --filter
option
sail artisan test --filter staff
If you want to generate a code coverage report you can use
sail artisan test --coverage-html reports/
For GraphQL support you also want to run Lighthouse's IDE helper, just be aware that PHPStorm's GraphQL plugin does not
support the syntax within this generated GraphQL file, thus you have to remove all occurences of the wordrepeatable
in the generated schema.directives.graphql
file
sail artisan lighthouse:ide-helper
You can run PHPstan using
sail php ./vendor/bin/phpstan analyse
You can run migrations with
sail artisan migrate
or if you want to build the database from scratch
sail artisan migrate:fresh
If you want to create a new migration use
sail artisan make:migration create_{table_name}_table
Please use following commit message template
{gitmoji} {message} ({issues affected})
Examples
:broom: Cleaning up staff tests (#31)
:sparkles: Added new awesome feature! (#32 #42 #89)
:memo: Added contribution section to README.md
For emojis in git messages, please use this as a reference gitmoji.dev