# Workspace

## Overview

pnpm workspace monorepo using TypeScript. Each package manages its own dependencies.

## Stack

- **Monorepo tool**: pnpm workspaces
- **Node.js version**: 24
- **Package manager**: pnpm
- **TypeScript version**: 5.9
- **API framework**: Express 5
- **Database**: PostgreSQL + Drizzle ORM
- **Validation**: Zod (`zod/v4`), `drizzle-zod`
- **API codegen**: Orval (from OpenAPI spec)
- **Build**: esbuild (CJS bundle)
- **Frontend**: React + Vite (artifacts/pm-dashboard)
- **Charts**: Recharts

## Artifacts

- **pm-dashboard** (`artifacts/pm-dashboard`) — CEO Project Management Dashboard. React + Vite frontend at `/`.
- **api-server** (`artifacts/api-server`) — Express 5 REST API at `/api`.

## Features

- CEO Dashboard with KPIs (total, active, completed, on hold, avg progress)
- Designer & Worker workload charts
- Stage breakdown pie chart
- Full project CRUD (create, update, delete)
- Per-project detail with 8 production stages: Design → Manufacturing → Inspection & Kitting → Assembly → Trial → Sample Validation → Pilot Run → Handover
- Project filtering by status (Active, Hold, Completed)

## Database Schema

- `projects` table: id, name, number, status, progress, designer, leader, workers (text[]), current_stage, stages (jsonb), created_at, updated_at

## Key Commands

- `pnpm run typecheck` — full typecheck across all packages
- `pnpm run build` — typecheck + build all packages
- `pnpm --filter @workspace/api-spec run codegen` — regenerate API hooks and Zod schemas from OpenAPI spec
- `pnpm --filter @workspace/db run push` — push DB schema changes (dev only)
- `pnpm --filter @workspace/api-server run dev` — run API server locally

See the `pnpm-workspace` skill for workspace structure, TypeScript setup, and package details.
