Skam Docs

Shared Core

Common logic, TypeScript interfaces, and global constants used by all apps and bots.
Located in packages/shared

Why a Shared Package?

In a large monorepo, duplicating types like User or Order across the Dashboard, Web Store, and Bots leads to drift and bugs. Isolating shared code into a single package guarantees:

Single Source of Truth

If the database schema changes, the types update here once.

Consistency

The storefront and the bots format currency exactly the same way.

Type Safety

Strict TypeScript interfaces catch drift before it reaches production.

What It Contains

Types and Interfaces

Database row types generated from Supabase, internal DTOs, and strict Zod schemas for validation.

Constants

Enums for order statuses, role definitions, and default configuration values.

Utilities

Pure JavaScript functions for data manipulation, formatting, and mathematical operations. No React code lives here.

Auth Module

Shared authentication logic used by both the web storefront and admin dashboard.

Usage

Import
import { type User } from "@skam/shared"
import { ORDER_STATUS } from "@skam/shared"
import { formatCurrency } from "@skam/shared"