NHost Template for Nuxt
For detailed explanation on how things work, check out Nuxt.js docs.
NHost is cool. It's a PostgreSQL database with GraphQL, file storage, and authentication built in. You should check it out.
Preconfiguration
- GraphQL support from
@nuxtjs/apollo
- Authentication support from
@nuxtjs/auth
Apollo configuration
There is a configuration for apollo in plugins/apollo.js
which adds the bearer token to websocket requests (for subscriptions).
Auth configuration
The authentication has a custom configuration provided by plugins/refreshScheme.js
. This adds support for the JWT refresh scheme used by NHost.
There is also an auth configuration in plugins/auth.js
which handles whether a user should be able to access a page.
Style configuration
This project is preconfigured with Tailwind. It's pretty awesome, but if you want to use something else, remove the tailwind dependencies and add something new.
Template setup
From Github, you can click on Use this template
to create…