Prood
ApplicationsDashboard

Dashboard

The merchant admin dashboard — products, orders, integrations, domains, and team management.

apps/dashboard is the merchant admin application. Merchants sign in, select an active organization (their store), and manage products, orders, customers, payment integrations, and custom domains.

Port: 3002 · Framework: Next.js 16 · Auth: Better Auth + organization plugin

Architecture

Drag to pan · Scroll to zoom

Most data operations go through the Commerce API. Integration credentials and domain records are managed directly via Drizzle (encrypted at rest).

Features

SectionRouteStatusDescription
Overview/LiveDashboard stats — revenue, orders, customers
Products/productsLiveList, create, edit products with variants and images
Orders/ordersLiveList, detail, fulfill, refund
Customers/customersLiveCustomer list and detail
Integrations/integrationsLivePayment and service provider configuration
Domains/domainsLiveCustom domain setup with Vercel + DNS
Team/teamLiveOrganization members and invitations
Settings/settingsLiveStore name, currency, contact info
API Keys/settings/api-keysPlaceholderAPI keys are issued by Better Auth/API today; in-dashboard creation is not wired yet
Analytics/analyticsPlaceholderFuture analytics dashboard
Billing/billingPlaceholderShows current plan from DB; Stripe subscription billing is not wired yet

Auth & organization

Merchants authenticate with email/password. Better Auth's organization plugin enables multi-store management:

  • Registration creates a user + first organization
  • session.activeOrganizationId determines which store's data is shown
  • Organization switching updates the active org in the session
  • All admin API calls are scoped to the active organization
// lib/admin.ts
export async function withActiveOrg<T>(fn: (orgId: string) => Promise<T>) {
  const orgId = await requireActiveOrg()
  return withTenant(orgId, fn)
}

Sidebar groups defined in lib/nav.ts:

GroupItems
StoreOverview, Products, Orders, Customers
PlatformDomains, Integrations, Analytics
AccountTeam, Settings, API Keys, Billing

Configuration

VariablePurpose
DATABASE_URLAuth + integration_config + tenant_domain tables
COMMERCE_API_URLAdmin API client base URL
BETTER_AUTH_SECRETSession validation on SSR (same secret as API)
NEXT_PUBLIC_AUTH_URLBrowser auth client → apps/api (default http://localhost:3005)
INTEGRATION_ENCRYPTION_KEYEncrypt provider credentials at rest
VERCEL_TOKEN, STOREFRONT_VERCEL_PROJECT_ID, VERCEL_TEAM_IDCustom domain provisioning
NEXT_PUBLIC_PLATFORM_DOMAINShown on domains page for subdomain preview

On this page