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 installEnvironment 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:3100Then symlink it to the web app:
pnpm setupGenerating an Encryption Key
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"Database Setup
Push the Drizzle schema to your database:
pnpm db:pushOptionally seed with sample plugins (Gmail, Slack, Stripe, etc.):
pnpm db:seedRunning the Platform
Start all apps:
pnpm dev| App | URL | Description |
|---|---|---|
| Dashboard | http://localhost:3100 | Plugin Builder web app |
| Docs | http://localhost:3200 | Documentation site |
Or individually:
pnpm dev:web # Dashboard only
pnpm dev:docs # Docs onlyFirst Steps
- Sign in — open http://localhost:3100, sign in with Google
- Create an API key — API Keys → Create Key (copy the raw key)
- Create a plugin — Plugins → New Plugin → fill in name, slug, base URL
- Add auth methods — open the plugin → Auth Methods tab
- Add tools — open the plugin → Tools tab
- 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.yamlUseful Commands
| Command | Description |
|---|---|
pnpm dev | Start all apps |
pnpm build | Build all apps |
pnpm db:push | Push schema to database |
pnpm db:generate | Generate migration files |
pnpm db:migrate | Run pending migrations |
pnpm db:studio | Open Drizzle Studio (visual DB browser) |
pnpm db:seed | Seed sample data |
pnpm clean | Remove all build artifacts and node_modules |