Commit Graph

5 Commits

Author SHA1 Message Date
Simone Cavalli a6ec599188 chore(01-02): generate Drizzle migration from schema (0000_pretty_typhoid_mary.sql)
- 10 tables: clients, phases, tasks, deliverables, comments, payments,
  documents, notes, service_catalog, quote_items
- UNIQUE constraint on clients.token enforced at DB level
- All FK cascades correct (deliverables->tasks->phases->clients)
- approved_at: timestamp with time zone (nullable, immutable)
- drizzle.config.ts already correct from Plan 01 (no changes needed)
2026-05-13 22:46:54 +02:00
Simone Cavalli 1bdbe7ab5d feat(01-02): create complete Drizzle schema with all 10 tables
- clients: token as separate text field (notNull, unique, nanoid) — never PK
- accepted_total denormalized on clients — client API never touches quote_items
- deliverables.approved_at immutable timestamp (TIMESTAMPTZ) — audit trail
- payments: label (Acconto 50% / Saldo 50%), status (da_saldare/inviata/saldato)
- comments: polymorphic entity_type+entity_id pattern
- service_catalog + quote_items: admin-only, never exposed to client API
- Full relations defined for all FK chains
- TypeScript types exported: Client, Phase, Task, Deliverable, etc.
- ID strategy: text + nanoid() via $defaultFn (cryptographically secure, URL-safe)
2026-05-13 22:46:30 +02:00
Simone Cavalli f8420072f4 feat(01-01): install shadcn/ui components and lucide-react icons
- components.json configured (Radix preset, CSS variables, @/ aliases)
- src/lib/utils.ts: cn() helper with clsx + tailwind-merge
- 10 shadcn/ui components: button, card, badge, progress, input, label,
  select, separator, table, textarea
- lucide-react@0.511 installed for iconography
- clsx, tailwind-merge, class-variance-authority added as dependencies
2026-05-13 15:32:19 +02:00
Simone Cavalli 6b5609b0cb feat(01-01): install Drizzle ORM, postgres-js, and configure DB client
- drizzle-orm@0.45.2 + postgres@3.4.9 installed (postgres-js driver)
- drizzle-kit@0.31.10 installed as dev dependency
- nanoid@5, zod@4, react-hook-form, @hookform/resolvers installed
- src/db/index.ts: Drizzle client initialized with postgres-js driver
- drizzle.config.ts: configured for postgresql dialect + src/db/schema.ts
- .env.example: added as public template (no secrets)
- .gitignore: allow .env.example while blocking all other .env* files
2026-05-13 15:30:53 +02:00
Simone Cavalli 9563b87c81 chore(01-01): bootstrap Next.js 16 with TypeScript, App Router, Tailwind CSS v4
- Created Next.js 16.2.6 project with App Router, src/ directory, TypeScript strict mode
- Configured Tailwind CSS v4 with postcss.config.mjs
- Simplified src/app/page.tsx to Welcome to ClientHub placeholder
- Updated layout.tsx with ClientHub metadata, Italian lang, viewport export (Next.js 16 API)
- Added .gitignore covering node_modules, .env*, .next/, build artifacts

Note: create-next-app installed Next.js 16.2.6 (latest stable) instead of 15.x — fully compatible upgrade
2026-05-13 15:28:58 +02:00