quiz_app
v0.1.1
Laravel 10、Sail (docker-compose)、Vue 3 フロントエンドを使用した GraphQL を使用したクイズ API バックエンド。
Laravel - 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_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 ハイニ・ファーゲルランド。ライセンスは、外部で管理されているライブラリやフレームワークではない、quiz_app のすべての部分に適用されます。
Laravel フレームワークは、MIT ライセンスに基づいてライセンス供与されたオープンソース ソフトウェアです。