This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a React-based visualization tool for FINOS CALM (Common Architecture Language Model) architecture diagrams. It provides an interactive graph visualization with a JSON editor, allowing users to visualize and explore software architecture definitions.
# Install dependencies
npm i
# Start development server (runs on http://[::]:8080)
npm run dev
# Build for production
npm run build
# Build in development mode
npm run build:dev
# Lint code
npm run lint
# Preview production build
npm run preview- App.tsx: Root component that sets up routing, React Query, and toast providers
- pages/Index.tsx: Main page that orchestrates the three-panel layout using ResizablePanelGroup
- State Management: Simple React state in Index.tsx manages:
jsonContent: Raw JSON string for the editorparsedData: Parsed CALM object for visualizationselectedNode: Currently selected node for details view
JsonEditor (components/JsonEditor.tsx)
- Monaco editor for JSON input
- File upload functionality
- Validates and parses JSON on change
ArchitectureGraph (components/ArchitectureGraph.tsx)
- Uses ReactFlow for graph visualization
- Dagre algorithm for automatic layout (left-to-right, configurable spacing)
- Parses FINOS CALM format with nested
relationship-type.connectsstructure - Handles both array and object node formats
- Custom edge rendering with protocol tooltips
NodeDetails (components/NodeDetails.tsx)
- Displays selected node properties
- Replaces graph view when a node is clicked
CustomEdge (components/CustomEdge.tsx)
- Custom ReactFlow edge with hover tooltips
- Shows description and protocol information
- Uses EdgeLabelRenderer for proper z-index handling
The app expects CALM JSON with this structure:
{
"nodes": [
{
"unique-id": "node-id",
"name": "Node Name",
"node-type": "system|service|data-store",
"interfaces": [...]
}
],
"relationships": [
{
"unique-id": "rel-id",
"relationship-type": {
"connects": {
"source": { "node": "source-id", "interface": "interface-id" },
"destination": { "node": "dest-id", "interface": "interface-id" }
}
},
"protocol": "HTTPS|MCP|..."
}
]
}Graph layout uses Dagre with these settings:
rankdir: 'LR'(left to right)ranksep: 150(horizontal spacing between ranks)nodesep: 100(vertical spacing between nodes)- Node dimensions: 250x100
To modify layout, adjust parameters in getLayoutedElements() in ArchitectureGraph.tsx.
- Framework: Tailwind CSS with shadcn/ui components
- Theme: HSL-based CSS variables for colors (supports dark mode via
classstrategy) - Component library: Full shadcn/ui suite in
components/ui/ - Path alias:
@/maps tosrc/
- User inputs JSON in JsonEditor or uploads file
- onChange handler in Index.tsx updates
jsonContentand attempts parse - Valid JSON updates
parsedDatastate - ArchitectureGraph receives
parsedDataand re-renders graph - Clicking a node calls
onNodeClickwhich updatesselectedNode - NodeDetails panel replaces graph when
selectedNodeis set
CRITICAL: This repository has CLA (Contributor License Agreement) checks that require commits to be authored by @pmerrison.
- Git is already configured correctly with author: Paul Merrison paul@tetrate.io
- DO NOT modify git author configuration
- DO NOT use any other author name or email in commits
- DO NOT add "Co-Authored-By: Claude" or similar lines to commit messages (breaks CLA check)
- All commits must pass CLA checks to be accepted into the upstream repository
When creating commits, the configured git author will automatically be used. No additional action is required.
Files to Exclude from Commits:
- CLAUDE.md files should NOT be committed to the repository
- Add CLAUDE.md to .gitignore or exclude when staging changes
- Vite: SWC-based React plugin for fast builds
- TypeScript: Strict mode enabled
- Dev Server: Runs on port 8080, listens on all interfaces (
::), configured in vite.config.ts - ESLint: React hooks and refresh plugins configured
- Build Tool: Vite with production optimizations