Hanzo
Hanzo Skills Reference

Hanzo Dataroom

Hanzo Dataroom is a self-hostable document sharing platform — analytics on every view, custom domains, secure link-based access, and structured data rooms for due diligence. Next.js 15, Prisma on PostgreSQL, Hanzo IAM SSO.

Overview

Hanzo Dataroom is a self-hostable document sharing platform -- share a document as a link, then see exactly who opened it, which pages they read and for how long. Custom domains, granular access controls, and structured data rooms for due diligence. Built with Next.js 15, Prisma ORM on PostgreSQL, and Tinybird for analytics. Supports S3/Vercel Blob storage, Stripe billing, SAML SSO (BoxyHQ), and Hanzo IAM OAuth. Enterprise features live in ee/ under a separate license.

What it actually is

  • Next.js 15 full-stack app (pages router + app router)
  • Prisma ORM with PostgreSQL (multi-schema: prisma/schema/)
  • Document storage: AWS S3 or Vercel Blob (configurable)
  • Analytics: Tinybird (page-by-page view tracking)
  • Auth: NextAuth.js with Hanzo IAM OAuth, passkeys (Hanko)
  • Email: Resend (transactional) + react-email templates
  • Payments: Stripe (in ee/stripe/)
  • Background jobs: Trigger.dev v3
  • Rich text: Tiptap editor
  • PDF rendering: react-pdf, mupdf, pdf-lib
  • AI features: OpenAI + Google Vertex AI SDKs for document AI
  • Notion import: react-notion-x
  • Enterprise: SAML SSO, custom branding, datarooms (in ee/)
  • Deployed at dataroom.hanzo.ai

Licensing

AGPLv3 for the core; enterprise features under ee/ carry a separate licence (ee/LICENSE.md).

When to use

  • Sharing documents with per-page view analytics
  • Building a branded document portal with custom domains
  • Investor datarooms with NDA/email verification gates
  • Self-hosting a DocSend alternative

Quick reference

ItemValue
Repogithub.com/hanzoai/dataroom
Packagehanzo-dataroom (private)
Version0.1.0
Branchmain
StackNext.js 15, React 18, TypeScript, Tailwind CSS
ORMPrisma 6.5 on PostgreSQL
AuthNextAuth.js + Hanzo IAM OAuth + passkeys (Hanko)
AnalyticsTinybird
StorageAWS S3 or Vercel Blob
PaymentsStripe
EmailResend + react-email
JobsTrigger.dev v3
AIOpenAI, Google Vertex AI
LicenseAGPLv3 (core), enterprise license (ee/)
Livedataroom.hanzo.ai
Node>= 22

Quickstart

git clone https://github.com/hanzoai/dataroom.git
cd dataroom
npm install

# Configure
cp .env.example .env
# Required: POSTGRES_PRISMA_URL, NEXTAUTH_SECRET, BLOB_READ_WRITE_TOKEN or S3 creds
# Auth: IAM_URL, IAM_CLIENT_ID, IAM_CLIENT_SECRET
# Email: RESEND_API_KEY
# Analytics: TINYBIRD_TOKEN

# Initialize database
npm run dev:prisma

# Development
npm run dev     # http://localhost:3000

# Production
npm run build
npm start

Architecture

dataroom.hanzo.ai
       |
  Next.js 15 App
       |
  ┌────┼────────┬──────────┬──────────┐
  │    │        │          │          │
PostgreSQL  S3/Blob   Tinybird    Stripe
(Prisma)   (docs)   (analytics) (billing)

  ├── Hanzo IAM (OAuth)
  ├── Resend (email)
  ├── Trigger.dev (jobs)
  └── Hanko (passkeys)

Directory structure

hanzoai/dataroom/
  package.json          # hanzo-dataroom v0.1.0
  Dockerfile            # Container build
  middleware.ts         # Auth + custom domain routing
  next.config.mjs       # Image domains, rewrites, redirects
  app/                  # Next.js app router pages
  pages/                # Next.js pages router (API routes)
  components/           # React UI (shadcn/ui based)
    emails/             # react-email templates
  lib/                  # Shared utilities
    tinybird/           # Analytics datasources and endpoints
  prisma/
    schema/             # Multi-file Prisma schema
    migrations/         # Database migrations
    add-migration.sh    # Migration helper script
  ee/                   # Enterprise features
    features/           # Datarooms, SAML SSO, advanced analytics
    emails/             # Enterprise email templates
    stripe/             # Billing integration
    limits/             # Plan-based feature gates
    LICENSE.md          # Enterprise license
  context/              # React context providers
  styles/               # Global CSS
  public/               # Static assets
  components.json       # shadcn/ui config
  trigger.config.ts     # Trigger.dev v3 config
  vercel.json           # Vercel deployment config

Key environment variables

VariablePurpose
POSTGRES_PRISMA_URLPostgreSQL connection (pooled)
POSTGRES_PRISMA_URL_NON_POOLINGPostgreSQL connection (migrations)
NEXTAUTH_SECRETNextAuth session secret
IAM_URLHanzo IAM URL (https://hanzo.id)
IAM_CLIENT_IDHanzo IAM OAuth client ID
IAM_CLIENT_SECRETHanzo IAM OAuth client secret
BLOB_READ_WRITE_TOKENVercel Blob token (if using Vercel storage)
NEXT_PRIVATE_UPLOAD_BUCKETS3 bucket name (if using S3)
RESEND_API_KEYResend email API key
TINYBIRD_TOKENTinybird analytics token
STRIPE_*Stripe keys (enterprise billing)
TRIGGER_SECRET_KEYTrigger.dev API key
NEXT_PRIVATE_DOCUMENT_PASSWORD_KEYEncryption key for document passwords

Database

Prisma multi-schema setup in prisma/schema/. Run migrations:

npm run dev:prisma              # Generate client + deploy migrations
npx prisma migrate dev          # Create new migration
bash prisma/add-migration.sh    # Helper for adding migrations

Tinybird analytics

cd lib/tinybird
tb push datasources/*
tb push endpoints/get_*

Docker

docker build -t hanzo-dataroom .
docker run -p 3000:3000 --env-file .env hanzo-dataroom
  • hanzo/hanzo-iam.md -- OAuth provider (Hanzo IAM at hanzo.id)
  • hanzo/hanzo-platform.md -- PaaS deployment
  • hanzo/hanzo-sql.md -- PostgreSQL database

How is this guide?

On this page