1.6 KiB
1.6 KiB
Why
The monorepo needs a single source of truth for business schema (database tables, validation rules, and shared types) that both the API and web apps can import. Currently packages/schema is an empty placeholder with no package.json or source files, forcing each app to duplicate type definitions and validation logic.
What Changes
- Populate
packages/schemawith a private npm package (@workspace/schema) includingpackage.json,tsconfig.json, and source entry points - Add Drizzle ORM schema definitions for PostgreSQL (tables, relations, enums)
- Add Superstruct-based runtime validators for request/response shapes
- Export shared TypeScript types derived from both Drizzle and Superstruct definitions
- Add
packages/schemaas a workspace dependency in bothapps/apiandapps/web - Update Turborepo pipeline so
schemabuild runs before dependent apps
Capabilities
New Capabilities
database-schema: Drizzle ORM table definitions, relations, and enums targeting PostgreSQLvalidation: Superstruct schema definitions for runtime validation of data shapesshared-types: TypeScript type exports re-exported from Drizzle and Superstruct schemas
Modified Capabilities
None — this is the first real content in packages/schema.
Impact
packages/schemawill get apackage.jsonand build output; its contents become importable by other workspace packagesapps/apiandapps/webgain a new workspace dependencyturbo.jsonneeds no changes —^buildalready handles topological build order- No existing code is removed or modified; this is purely additive