Developing

Development Setup

App Setup

Development Environment

git clone git@github.com:Lissy93/domain-locker.git
cd domain-locker
npm install
cp .env.example .env
npm run dev

Build for Production

To build for production, use npm run build, then npm start. Or to build for a particular platform, use the build:vercel, build:netlify commands.


Database Setup

While running in dev, you will be automatically connected to our public development Supabase instance, so there is no need to setup or configure a database. (Note that the dev database is frequently wiped).

Alternatively, you can deploy your own database, either SQLite, Postgres, or a (self-hosted or Pro) Supabase instance.

Option 1) SQLite

There's nothing to set up. With no Postgres or Supabase env vars set, the app creates a SQLite database at ./data/domain-locker.db on first use. See SQLite Setup.

Option 2) Postgres

Create a database and user, following the setup instructions in Postgres Setup.

You'll then just need to pass the following env vars to the app, so it can connect to your Postgres instance. The schema is applied automatically on first start.

DL_PG_HOST='localhost'
DL_PG_PORT='5432'
DL_PG_USER='postgres'
DL_PG_PASSWORD='supersecret'
DL_PG_NAME='domain_locker'

Option 3) Supabase

Deploy a new Supabase instance, apply the config from dl-sb-iac and set the following environmental variables:

SUPABASE_URL=xxx
SUPABASE_ANON_KEY=xx
Schema

The schema can be downloaded from here.

Below is a high-level class-diagram.

Schema


Resolving Issues

If you run into issues, see our Debugging Guide.


Architecture

Self-Hosted Version

The self-hosted app is very simple, and runs in a single container:

  • The app itself (client, server, scheduled jobs and optional webhooks for notifications)
  • Your data, in a SQLite file, or in Postgres if you'd rather run one

Managed Version

This differs slightly from the managed instance, which has the same core web app, but is reliant upon some non-free services for extra features and security.

Why the difference? Running a SaaS app requires some additional components/layers in order to offer users the best possible experience. For example, the managed app also needs to cover the following areas:

  • Multiple environments, automated CI/CD
  • An ORM between client and server
  • Feature flagging and role-based features
  • Domain name, DNS, Captcha, WAF, cache, SSL
  • Billing and user plan management
  • Authentication, authorization and SSO
  • STMP mailer service, and Twilio SMS
  • Notification channels for WhatsApp, SMS, Signal, etc
  • Backups for database, config, logs, assets
  • Observability for bugs, payments, availability, traces
  • User support for queries, billing, bugs, feedback, etc