Skip to content

Dev Setup

my.awesomeBible is a Nuxt app that uses SurrealDB as its database.

Requirements

You will need:

SurrealDB Setup

To start the SurrealDB server, run the following command:

Terminal window
# ram based
surreal start memory -A --user root --pass root

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.

Surrealist Database view

If you use the CLI, you can import the file with the following command:

surreal import --conn http://localhost:8000 --user root --pass root --ns test --db test <path_to_surql_file>

Kinde setup

Click on the “Add application” button on the Kinde Dashboard:

Kinde Dashboard

Then, choose “Back-end web” as the application type.

"Add application" screen

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.

NUXT_KINDE_AUTH_DOMAIN=
NUXT_KINDE_CLIENT_ID=
NUXT_KINDE_CLIENT_SECRET=
NUXT_KINDE_REDIRECT_URL=
NUXT_KINDE_LOGOUT_REDIRECT_URL=
NUXT_KINDE_POST_LOGIN_REDIRECT_URL=

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.

CommandAction
npm installInstalls dependencies
npm run devStarts local dev server at localhost:3000
npm run buildBuild your production site to ./output/
npm run previewPreview your build locally, before deploying