Learn by Directing AI
All materials

CLAUDE.md

Sahel Noix Production Tracking System

Client

Aminata Kone, Operations Director at Sahel Noix SARL -- a cashew processing and export company in Korhogo, Cote d'Ivoire. 45 employees. Processes raw cashew nuts (shelling, grading, roasting, packaging) and exports kernels to Europe and Asia.

What you're building

A CI/CD pipeline (GitHub Actions) that automatically tests and deploys changes to the existing production tracking system, plus an MCP connection so Claude can read the PostgreSQL database directly.

Tech stack

  • Frontend: Next.js 14 (Pages Router)
  • Backend: Express.js API routes
  • Database: PostgreSQL with Prisma ORM
  • Language: TypeScript (strict mode)
  • Testing: Jest/Vitest for unit and integration tests
  • Linting: ESLint with TypeScript rules
  • CI/CD: GitHub Actions (you're building this)
  • AI tools: Claude Code with PostgreSQL MCP server (you're connecting this)

Repository structure

.github/
  workflows/
    ci.yml              # CI/CD pipeline (you build this)
prisma/
  schema.prisma         # Database schema
  seed.ts               # Seed data
src/
  server/               # Express API routes
    batches.ts          # Batch CRUD
    cooperatives.ts     # Cooperative endpoints
    quality-checks.ts   # Quality check endpoints
    shipments.ts        # Shipment management
    export-certificates.ts  # Certificate generation
  pages/                # Next.js pages
    index.tsx           # Dashboard
    batches/            # Batch tracking
    quality/            # Quality control
    shipments/          # Shipment management
    reports/            # Daily/weekly reports
  lib/
    db.ts               # Prisma client
    auth.ts             # Session-based auth
tests/
  batches.test.ts       # API route tests
  cooperatives.test.ts
  quality-checks.test.ts

Key constraints

  • Processing hours: 6AM-7PM WAT. No deployments should risk downtime during these hours.
  • Database naming: Mix of French and English column names (historical). Don't rename -- the frontend depends on the current names.
  • Export certificates: Generated from the tracking system. System downtime during shipment windows means missed vessels and storage fees.

Tickets

  1. Set up GitHub Actions CI/CD pipeline with lint, test, build steps
  2. Configure pipeline to block on test failure (quality gate)
  3. Add GitHub Secrets for database credentials and deploy tokens
  4. Add database migration check step to pipeline
  5. Connect PostgreSQL MCP server to Claude Code
  6. Add deployment notifications and staging environment

Verification targets

  • Pipeline blocks on test failure (no continue-on-error: true on test/lint steps)
  • No secrets in pipeline logs (all sensitive values masked)
  • MCP connection reads schema correctly (column names match actual database)
  • All existing tests pass in CI
  • Deployment notifications sent on success and failure

Commit convention

Conventional commits: feat:, fix:, chore:, ci:, docs:. Commit after each meaningful change. Push to trigger pipeline.