Skip to content

Bnanan-Labs/cube-registration-admin-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cubing registration

Minimum PHP Version codecov PHPStan

About Cubing Registration

Registration system for continental sized Cubing Championships. This is the Backend running on Laravel exposing a Graphql API.

Documentation

You can find the GraphQL documentation in the GraphQL playground residing on the /graphql-playground endpoint.

Technologies

Setup

Clone this repository

git clone git@github.com:Bnanan-Labs/cube-registration-admin-service.git

1-command setup

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! 🚀

Manual setup

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! 🚀

Usage

I can highly recommend setting up following alias'

alias sail="./vendor/bin/sail"
alias stan="./vendor/bin/sail php ./vendor/bin/phpstan"

Running the application

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

Tests

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/

IDE Helper for GraphQL

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

Static Code Analysis

You can run PHPstan using

sail php ./vendor/bin/phpstan analyse

Migrations

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

Contribution

Commit messages

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

Gitmoji

For emojis in git messages, please use this as a reference gitmoji.dev

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published