GuidesDevelopersShared packages
Shared packages
These packages are imported from apps/* and crons/*. They stay free of product-specific UI and avoid reading process.env except where a file is an explicit CLI entry point (see docs/architecture.md).
| Package | Role |
|---|---|
@surplus/contracts | ORPC procedure definitions consumed by client and server |
@surplus/types | Zod schemas + inferred TypeScript types for domain entities |
@surplus/postgres | Drizzle schema, query helpers, Neon client factory |
@surplus/services | Domain service classes (business rules, transactions) |
@surplus/utils | Pure utilities and shared constants |
@surplus/redis | Redis / Upstash client factory |
@surplus/sharedDeps | Curated re-exports to keep dependency versions aligned |
Child pages document types and postgres in a bit more depth.