Basic boilerplate to quickly and easy get started with a Laravel API and a Vue SPA frontend. Nothing has been done, so everything is possible! This is just a scaffolding to avoid a lot of copypasting in the beginning of projects.
A few notes on backend:
- Laravel 8
- API is headless and by default separated on a subdomain, i.e. api.yourapp.test
- Authentication is handled by Laravel Sanctum and Laravel Fortify
- Only a simple seeder is provided to create a test user
A few notes on frontend:
- Vue 3 + Vue Router + Vuex with TailwindCSS/PostCSS
- ESLint with Babel+Vue extensions
- A few basic views are supplied, auth (login, forgot/reset password) and a home view, to illustrate the authentication flow
vue-routeris implemented with support for middleware. See examples inresources/js/router/middlewarevuexis implemented with modules. The only present module at first is auth, but is fully extendable for all needs.- A simple "layout" manager is implemented. This allows for defining the
layoutproperty in any Vue routed components base properties, such as:
export default {
components: {
PrimaryButton
},
layout: 'basic',
props: {
...Clone this repo, and run:
composer install
cp .env.example .envEdit the .env to reflect your setup in regards of DB and APP_URL (Using Laravel Valet is highly recommended), then run:
php artisan key:generate
php artisan migrate --seed
yarn && yarn productionSee package.json for Laravel Mix-scripts for development.