Skam Docs

Admin Dashboard

The internal control panel for managing the Skam ecosystem. Located in apps/dashboard.
Runs on port 3001.

Security Requirement

This application uses elevated Supabase privileges (Service Role Keys). Always fetch privileged data on the server via RSCs and pass only sanitized data to Client Components. Never expose service keys as props.

Core Features

Tenant Management

Provision, configure, and analyze data for multi-tenant Shopier stores.

Bot Control

Configure Discord and Telegram bot behavior, trigger announcements, and view error logs.

Analytics Overview

Aggregated business metrics, financial health from Shopier, and user statistics.

Admin Auth

Secure login via OTP or Google OAuth. Admin users managed through a dedicated table.

Audit Logs

Track all admin actions with timestamps and metadata for compliance and debugging.

Transactional Emails

Send order confirmations, status updates, and announcements via Resend.

Directory Structure

app/App Router pages and layouts for the admin interface
actions/Server Actions for admin mutations (tenant CRUD, bot config)
lib/Admin-specific utilities, Supabase admin client, Shopier balance service
components/Dashboard-specific UI components (charts, tables, forms)
__tests__/Unit and integration tests for admin services and routes

Running Locally

Terminal
# Start the dashboard on port 3001
pnpm dev:dashboard

# Or start the full dev environment
pnpm dev