Dera Backend is a NestJS web service.
In addition to the npm dependencies in package.json
, Dera Backend uses
- Postgres for its application database
- Flyway to handle database migrations
- Clerk for user authentication
- Neon for its users' embeddings
Make sure you have Postgres installed. Create a database for Dera application. The following values are the defaults that have been coded in the sample environment and Flyway configuration files. If you choose to use different values, remember to update those files. Default values:
DERA_DB_HOST=localhost
DERA_DB_PORT=5432
DERA_DB_NAME=dera
DERA_DB_USER_NAME=dera
DERA_DB_USER_PW=dera
Login to the database and create a schema for the user: create schema dera authorization dera;
. Also make sure you enabled the uuid-ossp
extension: CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
.
- Install Flyway CLI tool.
- Make a copy of sample.flyway.conf and update the values if necessary.
Refer to Dera FE's README for instructions on setting up Clerk Auth.
- Create an account at https://neon.tech/.
- Go to https://console.neon.tech/app/settings/api-keys and generate an API key. Note down the API key which you will need as the environment variable.
Make a copy of sample.env and name it .env
. Update the values in .env
accordingly.
Run yarn --frozen-lockfile
.
Run flyway migrate
.
- In development:
yarn start:dev
. - In production: First, build the app with
yarn build
. Next, run it withyarn start:prod
.