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 a (self-hosted or Pro) Supabase instance or a Postgres database.

Option 1) Postgres

With Postgres, follow the setup instructions in Postgres Setup, then init the schema and start the DB with ./db/setup-postgres.sh (to import the schema.sql). You'll then just need to pass the following env vars to the app, so it can connect to your Postgres instance.

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

Option 2) 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


Architecture

Self-Hosted Version

The self-hosted app is very simple, and consists of 3 containers:

  • The app itself (client, server and optional webhooks for notifications)
  • A Postgres database (to store your data)
  • A cron service (optional, to keep domains up-to-date and trigger notifications)

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

Initializing

We're just getting everything ready for you. This shouldn't take a moment...