CRA-Helper/replit.md
SylvainP1 aca76666d9 Add core features for timesheet and project management
Implement API endpoints and frontend components for creating and managing timesheets, projects, and dashboard functionalities.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 55837015-10e9-4be9-b857-7f5e6be73772
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: e5763354-5d83-482b-a89e-394e3eb5a41e
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1cc377db-7ea0-49f2-97ce-c3e87e0228cc/55837015-10e9-4be9-b857-7f5e6be73772/JpyvMwJ
Replit-Helium-Checkpoint-Created: true
2026-04-14 07:58:20 +00:00

59 lines
2.6 KiB
Markdown

# CRA Manager - Compte Rendu d'Activité
## Overview
A French timesheet management application (CRA - Compte Rendu d'Activité) built as a pnpm workspace monorepo. Consultants use it to track and report hours worked across multiple projects each month.
## Stack
- **Monorepo tool**: pnpm workspaces
- **Node.js version**: 24
- **Package manager**: pnpm
- **TypeScript version**: 5.9
- **Frontend**: React + Vite + Tailwind CSS + shadcn/ui
- **API framework**: Express 5
- **Database**: PostgreSQL + Drizzle ORM
- **Validation**: Zod (`zod/v4`), `drizzle-zod`
- **API codegen**: Orval (from OpenAPI spec)
- **Build**: esbuild (CJS bundle)
- **Charts**: Recharts
- **Routing**: Wouter
## Features
- **Dashboard**: Overview with monthly hours chart, project breakdown, active project count, timesheet status
- **Timesheet Management**: Create, view, edit monthly timesheets (CRA)
- **CRA Grid**: Interactive calendar grid where rows = projects, columns = days of month. Click cells to cycle 0 → 0.5 → 1 hours. Weekend distinction, row/column totals
- **Project Management**: CRUD for projects with code, name, client, category
- **Timesheet Workflow**: Draft → Submitted → Validated status flow
## Database Schema
- `projects` — Project definitions (code, name, client, category)
- `timesheets` — Monthly timesheet headers (year, month, status, collaborator)
- `timesheet_lines` — Project assignments within a timesheet
- `time_entries` — Daily hour entries per line (date, hours)
## 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
## API Endpoints
- `GET/POST /api/projects` — List/create projects
- `GET/PATCH/DELETE /api/projects/:id` — Project CRUD
- `GET/POST /api/timesheets` — List/create timesheets (filter by year/month)
- `GET/PATCH/DELETE /api/timesheets/:id` — Timesheet CRUD (GET returns full detail with lines and entries)
- `GET/POST /api/timesheets/:id/lines` — Timesheet lines
- `DELETE /api/timesheets/:id/lines/:lineId` — Remove a line
- `PUT /api/timesheets/:id/entries` — Batch upsert time entries
- `GET /api/dashboard/summary` — Dashboard stats
- `GET /api/dashboard/monthly-hours` — Monthly hours breakdown
- `GET /api/dashboard/project-hours` — Hours per project
See the `pnpm-workspace` skill for workspace structure, TypeScript setup, and package details.