NIN Connect Docs
Platform (Self-Host)

Self-Host Setup

Prerequisites, environment variables, database setup, and running the platform locally.

Prerequisites

  • Node.js 18+
  • pnpm 9+
  • PostgreSQL database (Neon recommended)
  • Firebase project with Google sign-in enabled

Installation

Clone the repository and install dependencies:

git clone <your-repo-url>
cd plugin-builder
pnpm install

Environment Variables

Create a .env.local file at the monorepo root:

# Neon PostgreSQL
DATABASE_URL=postgresql://user:password@ep-xxx.region.aws.neon.tech/neondb?sslmode=require

# Firebase Client (for Google sign-in on the dashboard)
NEXT_PUBLIC_FIREBASE_API_KEY=
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=
NEXT_PUBLIC_FIREBASE_PROJECT_ID=
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=
NEXT_PUBLIC_FIREBASE_APP_ID=

# Firebase Admin (server-side token verification)
FIREBASE_ADMIN_PROJECT_ID=
FIREBASE_ADMIN_CLIENT_EMAIL=
FIREBASE_ADMIN_PRIVATE_KEY=

# Encryption key for credential vault (32 bytes = 64 hex chars)
ENCRYPTION_KEY=

# Platform URL (used for OAuth callback URLs)
NEXT_PUBLIC_APP_URL=http://localhost:3100

Then symlink it to the web app:

pnpm setup

Generating an Encryption Key

node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"

Database Setup

Push the Drizzle schema to your database:

pnpm db:push

Optionally seed with sample plugins (Gmail, Slack, Stripe, etc.):

pnpm db:seed

Running the Platform

Start all apps:

pnpm dev
AppURLDescription
Dashboardhttp://localhost:3100Plugin Builder web app
Docshttp://localhost:3200Documentation site

Or individually:

pnpm dev:web    # Dashboard only
pnpm dev:docs   # Docs only

First Steps

  1. Sign in — open http://localhost:3100, sign in with Google
  2. Create an API key — API Keys → Create Key (copy the raw key)
  3. Create a plugin — Plugins → New Plugin → fill in name, slug, base URL
  4. Add auth methods — open the plugin → Auth Methods tab
  5. Add tools — open the plugin → Tools tab
  6. Point the SDK at your instance:
const nin = new Nin({
  apiKey: "nk_live_...",
  baseUrl: "http://localhost:3100",
});

Monorepo Structure

plugin-builder/
├── apps/
│   ├── web/         # Dashboard + runtime API (Next.js 15)
│   └── docs/        # Documentation site (Fumadocs + Next.js 16)
├── packages/
│   └── sdk/         # @nin.in/core TypeScript SDK
├── turbo.json       # Turborepo config
└── pnpm-workspace.yaml

Useful Commands

CommandDescription
pnpm devStart all apps
pnpm buildBuild all apps
pnpm db:pushPush schema to database
pnpm db:generateGenerate migration files
pnpm db:migrateRun pending migrations
pnpm db:studioOpen Drizzle Studio (visual DB browser)
pnpm db:seedSeed sample data
pnpm cleanRemove all build artifacts and node_modules

On this page