Dev Setup
my.awesomeBible is a Nuxt app that uses SurrealDB as its database.
Requirements
You will need:
- NodeJS
- (p)npm
- the SurrealDB CLI (optionally: Surrealist GUI)
- a Kinde account
SurrealDB Setup
To start the SurrealDB server, run the following command:
The database can be imported using the SurrealQL script. To do that, either open Surrealist, connect to your database and click on Import Data
. Then choose the “surql` file.
If you use the CLI, you can import the file with the following command:
Kinde setup
Click on the “Add application” button on the Kinde Dashboard:
Then, choose “Back-end web” as the application type.
Under Quick start, choose Nuxt as the SDK.
Under Details, fill in the homepage URI, the login URI, the allowed callback URLs, and the allowed logout redirect URLs.
The homepage URI is the domain where you installed the app.
The login URI is your domain + /api/login
.
The Callback URL is your domain + /api/callback
.
The logout redirect URL is the same as the homepage URI.
Under the Authentication tab, enable Email + code and if you want, the social connections for Discord and Google. You can get the tokens for Auth in the Google cloud console and the Discord Developer portal respectively.
App setup
The credentials for Kinde auth are configured via environment variables.
Start by copying the .env.example
file to .env
and fill in the credentials.
Now we can run (p)npm install
in the folder we cloned my.awesomeBible into and then run npm run dev
to start the dev server.
Command | Action |
---|---|
npm install | Installs dependencies |
npm run dev | Starts local dev server at localhost:3000 |
npm run build | Build your production site to ./output/ |
npm run preview | Preview your build locally, before deploying |