# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Project Overview
This is an OCaml web application for Fiordland Packs backpack ordering system, compiled to JavaScript using Dune and the `fmlib_browser` library. The application generates an interactive pack customization form that outputs to `form.js` for web deployment.
## Build System
This project uses Dune build system with OCaml-to-JavaScript compilation:
### Core Commands
- `dune build` - Build the project
- `dune clean` - Clean build artifacts
- `ocamlformat *.ml` - Format OCaml source files (uses .ocamlformat config)
### Build Configuration
- `dune-project` - Main project file (Dune 3.13)
- `dune` - Build rules defining executable `form` compiled to JavaScript
- Main executable: `form` (modules: form, svg, data)
- Output: `form.js` (automatically copied from `form.bc.js`)
## Architecture
### Module Structure
1. **`form.ml`** - Main application logic and UI components
   - Defines product types (pack, volume, torso, waist, shipping, etc.)
   - Contains form state management and UI rendering
   - Uses `fmlib_browser` for DOM manipulation
2. **`data.ml`** - Configuration and business data
   - Pricing information (pack prices, shipping costs)
   - Fabric definitions with colors and stock status
   - Email templates and business messages
   - Core type: `fabric_data = { fabric : string; colour : string; in_stock : bool }`
3. **`svg.ml`** - SVG rendering functions
   - Generates dynamic pack visualizations
   - Functions like `a45_view` take color parameters for different pack components
   - Uses `fmlib_browser.Html` for SVG DOM creation
### Key Types
- Product variants: `pack`, `volume`, `torso`, `waist`, `shipping`, `goal`
- `fabric_data` record type for fabric specifications
- `style` enum for Classic vs Alpine variants
### Dependencies
- `fmlib_browser` - Primary library for web DOM manipulation and HTML generation
- No package.json - pure OCaml project
### Deployment
- `index.html` - Entry point that loads `form.js`
- Uses Pico CSS framework for styling
- Includes Plausible analytics
- Custom `.pumpkin-button` styling