Insolitum Developers

Quick Start β€” Build Your First Module

Create, configure, and run an Insolitum Universe module in under 5 minutes. Step-by-step guide from zero to working module.

Quick Start

Build your first Insolitum Universe module in 5 minutes.

Prerequisites

Before you begin, make sure you have:

  • Node.js >= 18.0
  • pnpm >= 8.0 (recommended) or npm
  • Access to a Supabase instance (shared with Universe Shell)
  • A running Universe Shell instance (for testing iframe integration)

Create a New Module

Scaffold with CLI

The fastest way to create a new module:

npx create-insolitum-module my-analytics

The CLI will ask for:

  • Module name β€” slug format (lowercase, hyphens)
  • Display name β€” human-readable name
  • Description β€” short description for the marketplace
  • Category β€” hr, iot, production, finance, analytics, ai, or other
  • Supabase URL β€” your shared Supabase project URL
  • Supabase anon key β€” public anonymous key

If you prefer manual setup, copy the template from templates/module-starter/ in the monorepo.

Install Dependencies

cd my-analytics
pnpm install

Configure Environment

Edit .env.local with your Supabase credentials:

.env.local
# Supabase (shared with Universe Shell)
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIs...
 
# Module identity
NEXT_PUBLIC_MODULE_ID=my-analytics
NEXT_PUBLIC_MODULE_VERSION=1.0.0

Start Development Server

pnpm dev

Your module is running at http://localhost:3010.

Test Health Endpoint

Verify your module is properly configured:

curl http://localhost:3010/api/health

Expected response:

{
  "status": "ok",
  "module": "my-analytics",
  "version": "1.0.0",
  "timestamp": "2026-02-13T12:00:00.000Z",
  "uptime_since": "2026-02-13T11:55:00.000Z",
  "checks": {
    "supabase": true
  }
}

The health endpoint at /api/health is mandatory. Universe Shell uses it to monitor module status, and the marketplace validation will check it during review.

Test in Universe Shell

  1. Start Universe Shell on its default port
  2. Log in as an admin
  3. Go to Admin Panel β†’ Modules
  4. Add a new module with URL: http://localhost:3010
  5. Your module loads in the Shell's iframe with automatic authentication

The Shell sends your module an auth session via postMessage. The ShellAuthProvider in your module handles this automatically β€” no configuration needed.

Project Structure

After scaffolding, your module has this structure:

my-analytics/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ layout.tsx              # Root layout with ShellAuthProvider
β”‚   β”‚   β”œβ”€β”€ page.tsx                # Main dashboard page
β”‚   β”‚   β”œβ”€β”€ globals.css             # Tailwind styles
β”‚   β”‚   β”œβ”€β”€ settings/
β”‚   β”‚   β”‚   └── page.tsx            # Settings page
β”‚   β”‚   └── api/
β”‚   β”‚       └── health/
β”‚   β”‚           └── route.ts        # Health endpoint (required)
β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   β”œβ”€β”€ useNats.ts              # Real-time events hook
β”‚   β”‚   └── useModuleApi.ts         # Tenant-scoped DB queries
β”‚   └── lib/
β”‚       β”œβ”€β”€ shell-auth.tsx          # Auth provider (postMessage)
β”‚       β”œβ”€β”€ shell-navigation.ts     # Shell navigation helpers
β”‚       └── nats-events.ts          # NATS event types & subjects
β”œβ”€β”€ package.json
β”œβ”€β”€ next.config.ts                  # CSP headers for iframe
β”œβ”€β”€ tailwind.config.ts              # Tailwind with dark theme
β”œβ”€β”€ tsconfig.json
β”œβ”€β”€ .env.example
└── .env.local                      # Your credentials (gitignored)

Adding a New Page

Create pages using Next.js App Router conventions:

src/app/reports/page.tsx
'use client';
 
import { useShellAuth } from '@/lib/shell-auth';
 
export default function ReportsPage() {
  const { user, organizationId, isAuthenticated } = useShellAuth();
 
  if (!isAuthenticated) {
    return <p className="p-6 text-gray-400">Loading...</p>;
  }
 
  return (
    <div className="p-6">
      <h1 className="text-2xl font-bold text-white">Reports</h1>
      <p className="text-gray-400 mt-2">
        Analytics for org: {organizationId}
      </p>
    </div>
  );
}

Access it at http://localhost:3010/reports.

Deploy to Vercel

Push your module to a Git repository.

Create a new project on Vercel and connect the repository.

Add environment variables in Vercel project settings:

  • NEXT_PUBLIC_SUPABASE_URL
  • NEXT_PUBLIC_SUPABASE_ANON_KEY
  • NEXT_PUBLIC_MODULE_ID
  • NEXT_PUBLIC_MODULE_VERSION

Deploy. Your module is now available at https://my-analytics.vercel.app.

What's Next?

On this page