Raypx

Packages Reference

Detailed documentation for each internal package.

Raypx is organized as a pnpm monorepo with 11 internal packages under packages/. Each package is published under the @raypx/ scope and linked via the workspace:* protocol, so consuming packages always resolve to the local source.

Import Convention

All internal packages follow a consistent import pattern:

import { createDb } from "@raypx/database"
import { logger } from "@raypx/logger"
import { getAuth } from "@raypx/auth"

Package Categories

The 11 packages are grouped into three layers:

Blocks

Infrastructure

Low-level packages that provide shared foundations for the rest of the codebase.

Puzzle

Feature

Packages that encapsulate a specific product capability such as authentication, billing, or email.

Palette

Presentation

Packages that provide UI components, theming, and internationalization.

All Packages

Infrastructure

PackageDescription
@raypx/envType-safe environment variable validation with Zod and Standard Schema support
@raypx/loggerStructured JSON logging built on Pino
@raypx/databaseDrizzle ORM integration with PostgreSQL connection pooling

Feature

PackageDescription
@raypx/authBetter Auth integration with lazy initialization and social providers
@raypx/rpcType-safe API layer with oRPC procedures and routers
@raypx/storageObject storage abstraction backed by unstorage
@raypx/emailEmail sending with Resend and React Email templates
@raypx/otpOne-time password service for verification flows
@raypx/billingPlan limits and billing logic for free and pro tiers

Presentation

PackageDescription
@raypx/i18nInternationalization with use-intl and locale routing
@raypx/uiShared UI components powered by shadcn/ui

Dependency Rules

  • Infrastructure packages must not import feature or presentation packages.
  • Feature packages may depend on infrastructure packages but not on other feature packages (with few exceptions).
  • The main app (src/) may import from any package.
  • Presentation packages are the only layer that may export React components.

On this page