Skip to content

Starter of AdonisJs framework with Vue SPA and Auth prebuilt

Notifications You must be signed in to change notification settings

IvanAquino/adonis-vuetify-starter

Repository files navigation

Adonis Vuetify starter with prebuilt auth pages

Features

  • Single Page Application
  • Vue and Vue router configured with Auth restricted pages
  • Two Dashboard page examples
  • Prebuilt auth with JWT
  • UI with Vuetify
  • Powered by AdonisJS

Installation

adonis new myapp --blueprint=IvanAquino/adonis-vuetify-starter

Vue App

Vue app it's in the folder vue_app/, you can modify the different components and compile

Watch changes on components

npm run watch

Compile production version

npm run production

Vue Router History Mode

Modify myapp/vue_app/router/index.js

let router = new VueRouter({
    mode: 'history',
    ....

And next modify myapp/start/routes.js

// Route.on('/').render('frontend')

// At the end of the file
Route.any('*', ({ view }) => view.render('frontend'))

AdonisJS documentation - Routing for SPAs

Run adonis serve dev mode

adonis serve --dev

Http Request

You can use this.$http to access all methos of Axios

Headers on authorized routes

Use this.$auth.getToken() to access Bearer Token

let headers = { 'Authorization': this.$auth.getToken() }

this.$http.get(`${window.basePath}/auth/user`, {headers})

About

Starter of AdonisJs framework with Vue SPA and Auth prebuilt

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published