quiz_app
v0.1.1
Laravel 10, Sail(docker-compose), GraphQL과 Vue 3 프런트 엔드를 사용하는 퀴즈 API 백엔드입니다.
라라벨 - v10.10.0
PHP-v8.2.5
PHPUnit - v10.1.2
노드 - v18.16.0
npm-v9.6.4
(위 내용에 대한 모든 저작권은 해당 소유자에게 있습니다.)
# clone this project
$ git clone https://github.com/hfagerlund/quiz_app.git
$ cd quiz_app
$ cp .env.example .env
# ...and create .env.testing, customize .env and /config/database.php for your db
$ composer install --ignore-platform-reqs
# start Sail (leave this running in its own terminal tab)
$ ./vendor/bin/sail up
# in a new terminal tab:
$ ./vendor/bin/sail npm install
$ ./vendor/bin/sail artisan key:generate
$ ./vendor/bin/sail artisan migrate:fresh --seed
$ ./vendor/bin/sail npm run dev
# browse to 0.0.0.0
# stop Sail
$ ./vendor/bin/sail down
# check state of services
$ docker-compose ps
.env | .env.테스트 |
---|---|
APP_ENV=로컬 | APP_ENV=테스트 중 |
DB_CONNECTION=mysql | DB_CONNECTION=test1 (phpunit.xml의 에 해당) |
DB_DATABASE=db_for_application | DB_DATABASE=db_for_testing (phpunit.xml의 , 에 해당) |
# run all tests (feature, unit, database etc.)
$ ./vendor/bin/sail artisan test
# run all tests (for front-end, Vue components)
$ ./vendor/bin/sail npm run test
# run a specific test
$ ./vendor/bin/sail test --testsuite Feature --filter=DatabaseTest
# generate (feature) test
$ ./vendor/bin/sail php artisan make:test HTTPResponseTest
# generate (unit) test
$ ./vendor/bin/sail php artisan make:test MyUnitTest --unit
# output code coverage stats to terminal
$ ./vendor/bin/sail php artisan test --coverage
# install Dusk (end-to-end testing, browser automation)
$ ./vendor/bin/sail composer require --dev laravel/dusk
$ ./vendor/bin/sail php artisan dusk:install
# generate model, migration
$ ./vendor/bin/sail artisan make:model -m Question
# generate model, migration, factory
$ ./vendor/bin/sail artisan make:model Question -m -f
# generate GraphQL type
$ ./vendor/bin/sail artisan make:graphql:type QuestionType
# install Laravel 10 app (including Sail, MySQL, Redis, Selenium)
$ curl -s https://laravel.build/new-sail-application | bash
# install library for GraphQL
$ ./vendor/bin/sail composer require rebing/graphql-laravel
## publish config file (from /vendor dir to /config/graphql.php)
$ ./vendor/bin/sail php artisan vendor:publish --provider= " RebingGraphQLGraphQLServiceProvider "
# cache configuration
$ ./vendor/bin/sail php artisan config:cache --env=testing
# clear configuration cache
$ ./vendor/bin/sail php artisan config:clear
# run migrations
$ ./vendor/bin/sail artisan migrate
# drop all tables, migrate, seed db
$ ./vendor/bin/sail artisan migrate:fresh --seed
# dump database schema (ie. ' squash ' migrations into a single SQL file)
$ ./vendor/bin/sail php artisan schema:dump
# access MySQL command-line client
$ ./vendor/bin/sail mysql
# Node, npm versions
$ ./vendor/bin/sail node -v
$ ./vendor/bin/sail npm -v
# run Vite development server (provides Hot Module Replacement for Laravel application)
$ ./vendor/bin/sail npm run dev
저작권 © 2023 Heini Fagerlund. 라이선스는 외부에서 유지관리되는 라이브러리, 프레임워크가 아닌 퀴즈앱의 모든 부분에 적용됩니다.
Laravel 프레임워크는 MIT 라이선스에 따라 라이선스가 부여된 오픈 소스 소프트웨어입니다.