A starter kit for setting up a Laravel backend and GraphQL API coupled with a ReactJS frontend using Apollo and the Bootstrap UI framework.
- React SPA frontend (served through a Laravel web route)
- GraphQL API
- Bootstrap UI
- JWT Authentication
- Register/login forms
- Form validation
- Server side and client side tests
- Repository design pattern
- GraphQL API
- JWT authentication
- Pre-commit git hooks for CI
- phpcs for PSR-2 code compliance
- eslint Javascript linter using Airbnb styleguide
For detailed Laravel setup instructions, visit their documentation.
-
Clone the repo
$ git clone git@github.com:alexnord/materialize-boilerplate.git
-
Install PHP dependencies
$ composer install
-
Copy the example .env file
$ cp .env.example .env
-
Create SQLite DB for testing
$ touch database/database.sqlite
-
Generate application keys
$ php artisan key:generate $ php artisan jwt:secret
-
Run migrations and seed DB
$ php artisan migrate $ php artisan db:seed
-
Use the Node version provided by .nvmrc
nvm use
-
Install frontend dependencies
$ npm i
-
Compile frontend assets
$ npm run prod
-
Run website
$ php artisan serve
Compile assets for development (hot module reloading enabled)
$ npm run hot
Run backend and frontend tests
$ npm run test
Run linters
$ npm run lint
Get list of users
GET /graphql?query=query+FetchUsers{users{id,name,email}}