DLRSDLRS
Getting Started

Installation Guide

Complete step-by-step setup for DLRS Personal OS — from prerequisites to running locally.

Prerequisites

Before You Start

Required: Node.js 20+, PostgreSQL 14+, Redis 7+
Optional but recommended: Docker, an AI API key (Anthropic/OpenAI/Gemini/Azure), Google Cloud project for OAuth
# Install via Homebrew
brew install node@20 postgresql@14 redis

# Start services
brew services start postgresql@14
brew services start redis

# Verify
node --version   # v20.x.x
psql --version   # 14.x
redis-cli ping   # PONG

1. Clone Repository & Environment

Clone the repository

git clone https://github.com/your-org/DLRS_web.git
cd DLRS_web

Copy environment template

cp .env.example .env

Generate required secrets

# Run these commands to generate 32-byte hex secrets
node -e "console.log('SESSION_SECRET=' + require('crypto').randomBytes(32).toString('hex'))"
node -e "console.log('SECRET_ENCRYPTION_KEY=' + require('crypto').randomBytes(32).toString('hex'))"  # For vault encryption
node -e "console.log('WEBHOOK_SECRET=' + require('crypto').randomBytes(32).toString('hex'))"      # For inbox webhooks

Copy each output into your .env file.

2. Database Setup (PostgreSQL)

Create database

# Connect to PostgreSQL
psql -U postgres

# Create database and user
CREATE DATABASE dlrs_os;
CREATE USER dlrs_user WITH ENCRYPTED PASSWORD 'your_password';
GRANT ALL PRIVILEGES ON DATABASE dlrs_os TO dlrs_user;
q

Update DATABASE_URL in .env

DATABASE_URL="postgresql://dlrs_user:your_password@localhost:5432/dlrs_os?schema=public"

Generate Prisma Client

npm run db:generate
# Output: Prisma Client generated to ./node_modules/.prisma/client

Run Migrations

npm run db:migrate
# Creates all tables: users, workspaces, tasks, projects, clients, emails, etc.

(Optional) Seed Demo Data

npm run db:seed
# Creates demo workspace with sample tasks, projects, clients

3. Redis Setup (Live Sync)

Redis powers real-time features: live badges, notifications, inbox/task updates across tabs.

Verify Redis is running

redis-cli ping
# Should return: PONG

Set REDIS_URL in .env

# Local default (if empty, defaults to this)
REDIS_URL="redis://localhost:6379"

# Or Upstash (serverless Redis)
# REDIS_URL="rediss://default:[email protected]:6379"
# UPSTASH_REDIS_REST_URL="https://..."
# UPSTASH_REDIS_REST_TOKEN="..."

4. AI Provider Configuration

DLRS supports multiple AI providers. At least one is required for AI extraction. The system auto-detects if AI_PROVIDER is not set.

AI_PROVIDER="anthropic"
ANTHROPIC_API_KEY="sk-ant-..."
AGENT_MODEL="claude-3-5-sonnet-20241022"  # or claude-3-haiku for cost savings

5. Google Workspace OAuth (Optional but Powerful)

Enables Gmail ingestion, Drive indexing, Calendar sync.

Create Google Cloud Project

  1. Go to Google Cloud Console
  2. Create new project or select existing
  3. Enable APIs: Gmail API, Google Drive API, Google Calendar API

Configure OAuth Consent Screen

  • User Type: External (for personal use)
  • App name: "DLRS Personal OS"
  • Scopes: .../auth/gmail.readonly, .../auth/drive.readonly, .../auth/calendar.readonly
  • Test users: Add your email

Create OAuth Credentials

  • Application type: Web application
  • Authorized redirect URIs:
    http://localhost:3000/api/integrations/gmail/callback
    http://localhost:3000/api/integrations/drive/callback
    http://localhost:3000/api/integrations/calendar/callback

Add to .env

GMAIL_CLIENT_ID="your-client-id.apps.googleusercontent.com"
GMAIL_CLIENT_SECRET="GOCSPX-..."
GOOGLE_DRIVE_CLIENT_ID="same-or-different-client-id"
GOOGLE_DRIVE_CLIENT_SECRET="..."
GOOGLE_CALENDAR_CLIENT_ID="same-or-different-client-id"
GOOGLE_CALENDAR_CLIENT_SECRET="..."

# SECRET_ENCRYPTION_KEY already generated in step 1 - encrypts OAuth tokens

6. Install Dependencies & Run

Install npm packages

npm install
# Installs ~1000 packages including Next.js, Prisma, Fumadocs, AI SDKs

Start development server

npm run dev
# Starts at http://localhost:3000

Start background worker (separate terminal)

npm run worker
# Processes: email ingestion, AI extraction, reminders, subscriptions

7. Verify Installation

# TypeScript check
npm run typecheck

# Unit tests
npm run test

# Database integration tests
npm run test:db

# Tenancy isolation check (CI gate)
npm run check:tenancy

# All checks
npm run check

Docker Deployment (Production)

Production Checklist

  • Use strong unique secrets (SESSION_SECRET, SECRET_ENCRYPTION_KEY)
  • Use managed PostgreSQL (Neon, Supabase, Prisma Postgres, RDS)
  • Use managed Redis (Upstash, Redis Cloud, ElastiCache)
  • Set NODE_ENV=production
  • Configure reverse proxy (nginx/Traefik) with SSL
  • Run npm run build && npm start (not npm run dev)
# Dockerfile (multi-stage)
FROM node:20-alpine AS base
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production

FROM base AS builder
COPY . .
RUN npm run build

FROM base AS runner
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next/static ./.next/static
ENV NODE_ENV=production
EXPOSE 3000
CMD ["node", "server.js"]

# docker-compose.prod.yml
services:
  app:
    build: .
    ports:
      - "3000:3000"
    env_file: .env.production
    depends_on:
      - postgres
      - redis

  postgres:
    image: postgres:16
    env_file: .env.production
    volumes:
      - pgdata:/var/lib/postgresql/data

  redis:
    image: redis:7
    volumes:
      - redisdata:/data

volumes:
  pgdata:
  redisdata:

Troubleshooting

On this page