Skip to main content
Normalized for Mintlify from knowledge-base/aiconnected-business-platform/legacy-platform-redesign-spec.mdx.

SecureChat Admin Redesign - Full Context Handoff

Project Overview

Project: SecureChat - White-label AI Chat Platform
Location: /root/securechat.sec-admn
Repo: https://github.com/oxfordpierpont/securechat.sec-admn
Production URL: securechat.sec-admn.com
Supabase: securechat-supabase.sec-admn.com
From the start, the Secure Chat system will be a white label product, intended to be sold to agencies, and resold to business owners.
First for the settings page, you will need to add seven types of user account pairs:
  1. Super Admin (me/Oxford Pierpont)
  2. Super Admin Staff
  3. Agency Admin (white label client)
  4. Agency Staff
  5. Business Admin (end user clients) white-label-domain.com/secure-login
  6. Business Admin Staff
  7. Business Customers (end users)
In the Admin interface, you will also need to create a sidebar for the admin tabs so that it can be uncluttered. Different user types will see different tabs.
Super Admin tabs might include Dashboard, Agencies (with feature access toggles & settings access), Sub-Accounts, Business Information, Integrations (webhooks, API keys, tokens, licenses, etc.), Branding & Styling, Email Settings, Embed Snippets, Billing, Reporting, Switch Services (Grayed Out), Sign Out
Agency Admin tabs might include Dashboard, Clients (with feature access toggles & Settings Access), Business Information, Integrations (webhooks, API keys, tokens, licenses, etc.), Branding & Styling, Email Settings, Embed Snippets, Billing, Reporting, Switch Services (grayed out), Sign Out
Business Admin tabs might include Dashboard, Live Sessions, Session History, Leads, Business Information, Integrations (webhooks, API keys, tokens, licenses, etc.), Branding & Styling, Chat Settings, Prompts & Training, Knowledge Base, Email Settings, Embed Snippets, Billing, Reporting, Switch Services (Grayed Out)
For each of these tabs, obviously there will be a variety of fields and components, for example, Billing would have things like usage, invoices, payment methods, etc.
I think you can handle that part without me, and my main concern is the granular control of the chat interface. Users can choose simple edits where they only need to choose primary and secondary colors, or advanced edits where nearly every component can be changed individually. No layout structural layout changes.
Customizations should be broken down by section (Sidebar, Header, Chat Window, Chat Input), and then into components, like backgrounds, buttons, fonts, and finally granular changes like component color, stroke, corner radius, thickness, weight. Last, users should be able to upload logos, custom CSS. All of these settings should be separately customizable for light mode and dark mode. Users can only modify surface level aesthetics, not structural layout changes. They should also be an option to enable/disable emoji icons. Google Fonts also need to be integrated. If a color picker can be integrated, let’s do that. Otherwise, HEX and RGB fields will be fine.
Widgets and icons should also be customizable, as well as all headings and labels.
Agency admins should be able to access these theming settings for their clients, as many clients may choose to skip this process. The default setting for all interfaces should be black/white/grayscale. It would also be nice to have premade themes for the major colors, like red, green, blue, yellow, etc.
Moving on, I want all users to have an Account ID, and this can be used to access the live chat without embedding. So the link would be “domain/chat/Account-ID”.
Agencies should also have the option to set agency-level branding, custom domains, add/remove clients, customize billing options, provide API keys to clients
Knowledge base content should be editable with red warnings that modifying the prompts can degrade performance. There should also be an option to periodically crawl the business’s website for new pages or content.
No user should ever see another user’s chat history on the front end. The Account ID and Session ID should prevent this.
User Hierarchy
  • 7 user levels from Super Admin → Customer
  • 2 separate login routes
    • Unbranded
    • Custom Whitelabel Domain
  • Staff roles inherit parent permissions
Database
  • Full schema with RLS policies
  • Agencies → Businesses → Sessions → Messages chain
  • Knowledge bases stored per business
  • Encrypted API keys
Styling System (Section 6)
  • Simple mode: Just 2 colors + logo
  • Advanced mode: 100+ customizable properties
  • Organized by section: Sidebar, Header, Chat Window, Chat Input
  • Separate light/dark mode configs
  • Google Fonts integration
  • Custom CSS upload
  • 8 premade color themes (grayscale default)
  • All labels/headings editable
Admin Sidebar
  • Role-based tab visibility
  • All tabs you specified are mapped
  • “Switch Services” grayed out for future
Route Structure
  • /chat/[account_id] for public access
  • /admin/* for all admin functions
  • Session-based chat (no customer login)
Implementation Phases
  • 7 phases from core platform → billing

securechat Platform Specification

Product Requirements Document v1.0

Platform Name: securechat Staging URL: staging.authAPI.net Production URL: securechat.sec-admn.com Product Type: White-label AI Chat Platform for Agencies

1. PLATFORM OVERVIEW

1.1 Business Model

securechat is a B2B2B white-label platform:
  • Oxford Pierpont (Super Admin) operates the platform
  • Agencies purchase white-label access and resell to their clients
  • Businesses are the end clients who use the AI chat for their customers
  • Customers interact with the chat interface (no account required)

1.2 Core Value Proposition

Agencies can offer branded AI chat solutions to their clients without building the technology. Each business gets a customized chat interface powered by their own knowledge base.

2. USER HIERARCHY & AUTHENTICATION

2.1 User Types (7 Levels)

2.2 Authentication Routes

2.3 Account Identification

  • Every account (Agency, Business) has a unique account_id
  • Chat access via: [domain]/chat/[account_id]
  • Session tracking via session_id (UUID, no login required)
  • No user can access another user’s chat history

3. DATABASE SCHEMA

3.1 Core Tables

3.2 Row Level Security


4. ROUTE STRUCTURE

4.1 Authentication Routes

4.2 Admin Routes (Role-Based Access)

4.3 Public Routes


5. ADMIN SIDEBAR NAVIGATION

5.1 Super Admin Tabs

5.2 Agency Admin Tabs

5.3 Business Admin Tabs


6. BRANDING & STYLING SYSTEM

6.1 Customization Modes

Simple Mode

  • Primary color
  • Secondary color
  • Logo upload
  • (Auto-generates compatible theme)

Advanced Mode

Full granular control over every component.

6.2 Styling Structure

6.3 Advanced Styling Schema

6.4 Premade Themes

6.5 Styling Inheritance


7. KNOWLEDGE BASE MANAGEMENT

7.1 Generation Flow

7.2 Editing Interface

  • View mode: Read-only display of generated content
  • Edit mode: Editable with warnings

Warning System

7.3 Crawl Settings


8. CHAT SETTINGS

8.1 Behavior Settings


9. INTEGRATIONS

9.1 AI Provider

9.2 Webhooks

9.3 Email (SMTP)


10. BILLING

10.1 Metrics Tracked

  • Messages sent (AI API calls)
  • Active sessions
  • Leads captured
  • sc generations
  • Storage used

10.2 Billing Levels

  • Platform → Agency: Usage-based or flat monthly
  • Agency → Business: Agency controls pricing

11. SECURITY

11.1 Data Isolation

  • Row Level Security on all tables
  • Account ID + Session ID prevents cross-user access
  • API keys encrypted at rest
  • Audit logging for admin actions

11.2 Session Security

  • Chat sessions are anonymous (no PII required)
  • Session ID is UUID, not guessable
  • Sessions expire after inactivity
  • No session can access another session’s data

12. IMPLEMENTATION PHASES

Phase 1: Core Platform

  • Database schema
  • Authentication (all user types)
  • Admin sidebar navigation
  • Basic dashboard for each role
  • Business management (CRUD)

Phase 2: Knowledge Base

  • sc generator integration
  • sc storage and retrieval
  • sc editing interface
  • Crawl scheduling

Phase 3: Chat Interface

  • Public chat route
  • Session management
  • Message storage
  • Lead capture

Phase 4: Styling System

  • Simple mode
  • Advanced mode
  • Premade themes
  • Live preview

Phase 5: Agency Features

  • Agency management
  • Client management
  • Custom domains
  • Agency-level branding

Phase 6: Integrations

  • Webhook system
  • Email notifications
  • Multi-provider AI

Phase 7: Billing & Reporting

  • Usage tracking
  • Stripe integration
  • Analytics dashboard

13. FILE STRUCTURE


14. NEXT STEPS

  1. Review this spec - Confirm structure and features
  2. Set up Supabase project - New project for securechat
  3. Implement database schema - Run migrations
  4. Build auth system - All login routes
  5. Create admin layout - Sidebar + role-based tabs
  6. Build first admin pages - Dashboard, Business Info
  7. Integrate styling system - Simple mode first
  8. Connect chat interface - Public route with styling

Document Version: 1.0 Created: January 10, 2026 Author: Claude + Bob (Oxford Pierpont)

Business Model

  • Oxford Pierpont (Super Admin) operates the platform
  • Agencies purchase white-label access and resell to clients
  • Businesses are end clients who use the AI chat
  • Customers interact with chat (no account required)

What Was Accomplished This Session

1. Supabase Troubleshooting

Fixed the new securechat-supabase.sec-admn.com instance:
  • Connected Traefik to the Supabase network
  • Fixed missing ENABLE_ANONYMOUS_USERS env var
  • Cloned data from sbms-supabase (192 conversations, 1 lead, 1 settings, 1 auth user)
  • Updated .env.local to point to new Supabase URL
Note: Production Dokploy env vars still point to old sbms-supabase.sec-admn.com - needs manual update in Dokploy dashboard.

2. Installed Claude Design Skill

3. Multi-Tenant Admin System

Built the foundation for a 7-tier user system:

User Hierarchy (7 Levels)


Files Created

Database Migrations

  • Creates tables: agencies, businesses, users, knowledge_bases, integrations, chat_sessions, chat_messages, new_leads, audit_log, themes
  • Defines enums: user_role, subscription_status, sc_status, crawl_frequency
  • Inserts 8 premade themes (grayscale, midnight, forest, ocean, sunset, lavender, coral, gold)
  • Creates helper functions: generate_account_id(), get_user_permissions()
  • Creates update triggers for updated_at columns
  • Enables RLS on all tables
  • Creates auth.get_current_user_info() helper function
  • Defines policies for each table based on user role
  • Super admins see all, agency admins see their clients, business admins see own data

Auth System

  • Defines USER_ROLES and ROLE_GROUPS constants
  • Permission definitions (PERMISSIONS object)
  • Helper functions: isSuperAdmin(), isAgencyUser(), isBusinessUser(), hasPermission(), canAccessRoute(), getUserContext(), getTenantContext()
  • Defines NAV_ITEMS with icons, labels, hrefs, and allowed roles
  • Defines NAV_STRUCTURE per role (which tabs each role sees)
  • Functions: getNavigationForRole(), isNavItemVisible(), getBreadcrumbs(), getPageTitle()

Login Pages

  • Reusable login form component with split-panel design
  • Accepts config prop for theming (accent color, title, features, pattern)
  • Accepts allowedRoles prop for role validation
  • Handles Supabase auth + user profile lookup

Admin Layout & Sidebar

  • Collapsible sidebar with role-based navigation
  • Inline SVG icons (Phosphor-style)
  • Shows user email and role in footer
  • Sign out button with red hover state
  • “Switch Services” grayed out (future feature)
  • Wraps all /admin/* routes
  • Checks auth session, fetches user profile from users table
  • Falls back to default business_admin role if user not in database (backwards compatibility)
  • Renders Sidebar + top header with page title
  • Responsive margin adjustment when sidebar collapsed

Admin Pages Created

Middleware

  • Defines LOGIN_ROUTES, PROTECTED_ROUTES, PUBLIC_ROUTES
  • Redirects unauthenticated users from /admin/* to /login
  • Redirects authenticated users from login pages to /admin/dashboard
  • Root path redirects based on auth state

Empty Directories Created


Design Direction

Following /design-principles skill:
  • Direction: Sophistication & Trust (enterprise B2B)
  • Colors: Slate palette (slate-50 bg, slate-200 borders, slate-900 text)
  • Depth: Subtle borders, minimal shadows
  • Typography: System fonts, 4px grid spacing
  • Layout: Collapsible sidebar, clean cards with rounded-xl corners

Super Admin Tabs

Dashboard, Agencies, Sub-Accounts, Business Information, Integrations, Branding & Styling, Email Settings, Embed Snippets, Billing, Reporting, [Switch Services - grayed], Sign Out

Agency Admin Tabs

Dashboard, Clients, Business Information, Integrations, Branding & Styling, Email Settings, Embed Snippets, Billing, Reporting, [Switch Services - grayed], Sign Out

Business Admin Tabs

Dashboard, Live Sessions, Session History, Leads, Business Information, Integrations, Branding & Styling, Chat Settings, Prompts & Training, Knowledge Base, Email Settings, Embed Snippets, Billing, Reporting, [Switch Services - grayed], Sign Out

Styling System Requirements (Not Yet Built)

Two Modes

Simple Mode:
  • Primary color picker
  • Secondary color picker
  • Logo upload
  • Auto-generates theme
Advanced Mode:
  • Organized by section: Sidebar, Header, Chat Window, Chat Input
  • Each component: background, fonts, borders, radius, colors
  • Separate light/dark mode configs
  • Google Fonts integration
  • Custom CSS upload
  • Emoji enable/disable
  • All labels/headings editable

Styling Schema (JSONB)

Premade Themes (Already in DB migration)

grayscale (default), midnight, forest, ocean, sunset, lavender, coral, gold

API Routes Needed

Existing routes to update for multi-tenant:
  • /api/settings - Per-business settings
  • /api/leads - Per-business leads

Public Chat Route

New route: /chat/[accountId]
  • Account ID identifies the business
  • Loads business-specific styling from database
  • Session-based (no login for customers)
  • Session ID prevents cross-user chat access

Database Migration Status

NOT YET RUN - Migrations are in /supabase/migrations/ but have not been applied to the database.
To run:
  1. Go to Supabase dashboard for securechat-supabase.sec-admn.com
  2. SQL Editor → Run 001_multi_tenant_schema.sql
  3. Then run 002_rls_policies.sql
  4. Create super_admin user linking to existing auth.users

Environment Variables

.env.local (updated this session):
Dokploy production still has old URL - update manually:
  • Change NEXT_PUBLIC_SUPABASE_URL from sbms-supabase.sec-admn.com to securechat-supabase.sec-admn.com

Known Issues / Backwards Compatibility

  1. User table fallback: If user exists in auth.users but not in users table, layout.jsx creates a temporary object with role: ‘business_admin’. This is for backwards compatibility until migration is complete.
  2. Old settings page: Backed up as page.jsx.old. Contains the 7-section settings form that needs to be migrated to individual pages (business-info, integrations, branding, email-settings, embed, chat-settings).
  3. Existing data: Current settings, leads, conversations tables still work. New tables (businesses, new_leads, chat_sessions, chat_messages) are for the new multi-tenant structure.

Git Status

Last commit: df524cf - “feat: Add multi-tenant admin system with role-based sidebar”
All changes pushed to origin/main. Dokploy should auto-deploy.

Remaining Work Summary

  1. Run database migrations on Supabase
  2. Create remaining 12 admin pages (most are empty directories)
  3. Build branding/styling system (most complex feature)
  4. Create API routes for multi-tenant operations
  5. Refactor chat route for account-based access
  6. Connect knowledge base to sc generator
  7. Add billing (Stripe integration)
  8. Add reporting (analytics dashboard)
  9. Test everything

Quick Start for Continuation

Then continue building from the plan at:
/root/.claude/plans/rippling-meandering-swan.md

Here’s a comprehensive list of everything remaining to complete the project:


Remaining Tasks

1. Database Setup

  • Run 001_multi_tenant_schema.sql migration on Supabase
  • Run 002_rls_policies.sql migration on Supabase
  • Create initial super_admin user in the users table (link to existing auth.users)
  • Migrate existing settings data to new businesses table structure
  • Migrate existing leads data to new new_leads table
  • Migrate existing conversations to new chat_sessions + chat_messages tables

2. Remaining Admin Pages (12 pages)

  • /admin/sub-accounts/page.jsx - Super admin view of all businesses
  • /admin/session-history/page.jsx - Past chat sessions
  • /admin/integrations/page.jsx - Webhooks, API keys, AI provider config
  • /admin/branding/page.jsx - Complex - Full styling system (see Section 6 below)
  • /admin/chat-settings/page.jsx - Quiz, lead capture, conversation starters
  • /admin/prompts/page.jsx - System prompt, training content
  • /admin/knowledge-base/page.jsx - sc editor with crawl settings
  • /admin/email-settings/page.jsx - SMTP configuration
  • /admin/embed/page.jsx - Embed code snippets
  • /admin/billing/page.jsx - Usage, invoices, Stripe integration
  • /admin/reporting/page.jsx - Analytics dashboard
  • /admin/agencies/[id]/page.jsx - Individual agency detail/edit
  • /admin/clients/[id]/page.jsx - Individual client detail/edit

3. Branding & Styling System (Complex Feature)

  • /src/components/branding/StyleEditor.jsx - Main editor component
  • /src/components/branding/ColorPicker.jsx - Color picker with HEX/RGB
  • /src/components/branding/FontSelector.jsx - Google Fonts integration
  • /src/components/branding/ThemePreview.jsx - Live preview component
  • /src/components/branding/SectionEditor.jsx - Per-section editing (Sidebar, Header, Chat Window, Chat Input)
  • /src/lib/themes.js - 8 premade theme definitions
  • /src/lib/styling.js - Style application utilities
  • Simple mode implementation (2 colors + logo)
  • Advanced mode implementation (100+ properties)
  • Light/dark mode separate configs
  • Custom CSS upload
  • Emoji enable/disable toggle
  • Labels/headings customization

4. Public Chat Route Refactor

  • /src/app/chat/[accountId]/page.jsx - Account-based chat
  • /src/app/chat/[accountId]/layout.jsx - Layout with dynamic styling
  • Load business-specific styling from database
  • Session-based anonymous chat (no login)
  • Session ID generation and tracking

5. Knowledge Base Integration

  • Connect to existing /tools/sc-generator
  • sc content display with edit mode
  • Warning system for content modification
  • Crawl scheduling (manual, daily, weekly, monthly)
  • Website URL configuration
  • Crawl status and logs display

6. API Routes (New/Updated)

  • /api/agencies/route.js - CRUD for agencies
  • /api/businesses/route.js - CRUD for businesses
  • /api/users/route.js - User management
  • /api/branding/route.js - Save/load styling
  • /api/themes/route.js - Premade themes
  • /api/knowledge-base/route.js - sc operations
  • /api/chat/[accountId]/route.js - Account-specific chat
  • /api/sessions/route.js - Session management
  • Update /api/settings/route.js for multi-tenant
  • Update /api/leads/route.js for multi-tenant

7. Authentication Enhancements

  • /src/app/forgot-password/page.jsx - Password reset request
  • /src/app/reset-password/page.jsx - Password reset confirmation
  • Server-side role verification in middleware (currently client-side)
  • User onboarding flow for new users without profile

8. Billing Integration

  • Stripe customer creation for agencies/businesses
  • Usage tracking (messages, sessions, leads, sc generations)
  • Invoice display
  • Payment method management
  • Subscription tier management

9. Reporting & Analytics

  • Session metrics (count, duration, completion)
  • Lead metrics (capture rate, source breakdown)
  • Usage charts and graphs
  • Export functionality (CSV)
  • Date range filtering

10. Testing & Validation

  • Test all 3 login routes with different user roles
  • Verify RLS policies work correctly
  • Test sidebar shows correct tabs per role
  • Verify role-based route protection
  • Test chat with account-based routing
  • Build verification (npm run build)

11. Missing Utility Files

  • Ensure /src/lib/ai-providers.js exists (referenced in old admin page)
  • Update /src/lib/supabase-server.js for multi-tenant queries
  • Update /src/lib/supabase-client.js if needed

12. UI Components (Shared)

  • /src/components/ui/Card.jsx - Reusable card component
  • /src/components/ui/Button.jsx - Consistent button styles
  • /src/components/ui/Input.jsx - Form input component
  • /src/components/ui/Select.jsx - Custom select dropdown
  • /src/components/ui/Toggle.jsx - Toggle switch
  • /src/components/ui/Modal.jsx - Modal dialog
  • /src/components/ui/Table.jsx - Data table with sorting/pagination

  1. Database migrations - Foundation for everything
  2. Remaining admin pages - Complete the UI structure
  3. Branding system - High-value feature
  4. API routes - Connect UI to database
  5. Chat route refactor - Enable account-based chat
  6. Knowledge base - Connect sc generator
  7. Billing - Revenue-critical
  8. Reporting - Analytics
  9. Testing - Verify everything works

Files Created So Far


This represents approximately 60-70% of the total project completed. The branding/styling system is the most complex remaining feature.

Here are additional critical details the next Claude Code session will need:


Additional Context

Existing Files NOT Modified (But Important)

Original Settings Page Structure (in page.jsx.old)

The old admin page had 7 collapsible sections that need to be migrated to individual pages:
  1. API Configuration → /admin/integrations
    • Provider selector (Anthropic, OpenRouter, Gemini)
    • API key input
    • Model selector
    • Test connection button
  2. Business Information → /admin/business-info ✅ (created)
    • Name, phone, address, city/state/zip, email, website, booking URL
  3. Branding → /admin/branding
    • Logo URLs (sidebar, start page, mobile)
    • Primary/accent color pickers
  4. Lead Webhook → /admin/integrations
    • Enable toggle
    • Destination (GoHighLevel, n8n, custom)
    • Webhook URL
    • Test button
  5. Email Settings → /admin/email-settings
    • Enable toggle
    • SMTP host, port, security
    • Username, password
    • From name/email
    • Notification email
    • Test button
  6. Chat Interface → /admin/chat-settings
    • Welcome heading/subheading
    • Input placeholder
    • Quiz toggle
    • Quiz/booking button text
  7. Embed Snippets → /admin/embed
    • Full-page iframe code
    • Floating widget script
    • Copy buttons

Current Database Schema (Old - Still Active)

Encryption Pattern

API keys and SMTP passwords are encrypted using AES-256:
  • Key: ENCRYPTION_KEY env var (32 chars)
  • Functions in /src/lib/supabase-server.js: encrypt/decrypt helpers
  • Fields: ai_api_key_encrypted, smtp_password_encrypted

Chat Interface Components (Existing)

The chat UI in /src/app/chat/page.jsx has:
  • Sidebar with logo, welcome message, conversation starters
  • Quiz flow with progress bar
  • Lead capture form
  • Message bubbles (user/assistant)
  • Typing indicator
  • Booking button
These need to be styled dynamically based on business branding settings.

Webhook Presets

Test Connection Functions

The old admin page has test functions for:
  • AI connection (sends test prompt)
  • SMTP (sends test email)
  • Webhook (sends test payload)

These should be preserved in the new integrations page.

Component Patterns Used

Card Pattern

Form Input Pattern

Button Patterns

Empty State Pattern


Icons Reference

Sidebar uses inline SVGs (Phosphor-style). The Icons object in Sidebar.jsx contains:
  • LayoutDashboard, Building2, Users, Briefcase, Radio, History, UserPlus
  • Building, Plug, Palette, MessageSquare, Sparkles, BookOpen
  • Mail, Code, CreditCard, BarChart3, ArrowLeftRight, LogOut
  • Menu, ChevronLeft

Copy these when creating new pages that need consistent icons.

Tailwind Classes Reference

The project uses Tailwind CSS. Key color classes:
  • Backgrounds: bg-slate-50, bg-white
  • Borders: border-slate-200, border-slate-100
  • Text: text-slate-900 (primary), text-slate-600 (secondary), text-slate-500 (muted), text-slate-400 (faint)
  • Accent: bg-slate-900 (buttons), hover:bg-slate-800
  • Status: bg-emerald-50 text-emerald-700 (success), bg-red-50 text-red-600 (error)

Port Configuration

  • Dev server: Port 3002 (3000 used by Docker)
  • Command: npm run dev — -p 3002
  • VS Code port forwarding required for remote access

Dokploy Deployment

  • Auto-deploys on push to main
  • Container: software-applications-securechatsecadmncom-tkxads
  • Env vars configured in Dokploy dashboard (not in repo)
  • Build command: npm run build

Plan File Location

The implementation plan is saved at:

This contains the full phase breakdown and file structure.

User Preferences Noted

  1. Custom domains are for end-client businesses, not agencies
  2. Billing: Stripe only
  3. sc Generator: Use existing /tools/sc-generator
  4. API access: No programmatic API for businesses (admin UI only)
  5. Default theme: Grayscale (black/white/gray)

That should be everything needed to continue the project seamlessly.

Connecting Local Build to Self-Hosted Supabase

Supabase Instance Details

API Keys

Local .env.local File

Create this file in your local project root:

Verify Connection

Test the connection works:

Existing Auth User

There’s one auth user already in the database:

Running Database Migrations

The migrations have NOT been run yet. To apply them:
  1. Option A: Supabase Studio
    • Go to https://securechat-supabase.sec-admn.com
    • Login with dashboard credentials
    • Go to SQL Editor
    • Paste and run supabase/migrations/001_multi_tenant_schema.sql
    • Then run supabase/migrations/002_rls_policies.sql
  2. Option B: Direct psql

After Running Migrations

Create the super admin user linking to existing auth user:

SSL Certificate Note

The Supabase instance uses Let’s Encrypt SSL. If you get certificate errors locally, the cert may still be provisioning. You can temporarily bypass with:
Or just wait a few minutes for the cert to fully provision.

Local Development