CLAUDE.md
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
A personal portfolio website built with React, TypeScript, and Vite, deployed to GitHub Pages. Features interactive data visualizations including GDELT analysis, network graphs with Cytoscape, event analysis, and situational awareness visualizations.
Build and Development Commands
Development
npm run dev # Start dev server with hot reload
npm run preview # Preview production build locally
Building
npm run build # Vite build (TypeScript compilation included)
Linting
npm run lint # Run ESLint on all files
Deployment
npm run deploy # Deploy to GitHub Pages (runs predeploy build automatically)
Architecture
Project Structure
- src/pages/: Page components
HomePage.tsx: Main landing page with hero, about, expertise sectionsProjectsPage.tsx: Projects listing with inline project dataNotFoundPage.tsx: 404 page
- src/components/: React components
layout/Layout.tsx: Main layout wrapper with navigation and footerui/: shadcn/ui components (button, etc.)projects/: Project-specific components, each in its own subdirectorygdelt/GdeltRecordViewer.tsx: GDELT data viewergdelt-kb/GdeltKnowledgeBase.tsx: GDELT knowledge base viewercytoscape/CytoscapeViewer.tsx: Network visualizationevent-analyzer/EventAnalyzer.tsx: Event analysis componentsituational-awareness/SituationalAwareness.tsx: Situational awareness graphadvanced-retrieval/AdvancedRetrieval.tsx: Advanced retrieval strategies component
- src/data/: JSON data files for visualizations
- src/lib/: Utility functions (utils.ts)
- src/assets/: Static assets
Routing
Simple React Router setup in App.tsx:
/- HomePage/assets/projects- ProjectsPage/assets/projects/gdelt- GdeltRecordViewer/assets/projects/gdelt-knowledge-base- GdeltKnowledgeBase/assets/projects/cytoscape- CytoscapeViewer/assets/projects/event-analyzer- EventAnalyzer/assets/projects/situational-awareness- SituationalAwareness/assets/projects/advanced-retrieval- AdvancedRetrieval*- NotFoundPage (404)
No lazy loading is used - all components are directly imported.
Project Data Management
Projects are defined inline as a simple array in ProjectsPage.tsx (lines 130-205). Each project has:
- title
- description
- tags (with color mapping defined in tagColorMap at lines 24-70)
- Optional: demoUrl, codeUrl, huggingFaceUrl, detailUrl
The ProjectCard component is also defined inline in ProjectsPage.tsx (lines 15-127).
Layout Component
The Layout component (src/components/layout/Layout.tsx) wraps all pages and provides:
- Navigation bar with links to sections (About, Expertise, Certifications, Projects, Teaching, Contact, Graph Demos)
- Active link highlighting using hash-based navigation for sections and pathname for Projects
- Footer with social links (GitHub, LinkedIn, Graph Visualizations)
Styling
- Tailwind CSS for styling
cn()utility from lib/utils.ts for conditional class names (using clsx and tailwind-merge)- shadcn/ui components for reusable UI elements
Utility Functions
The src/lib/utils.ts file provides project-specific utilities:
cn(): Combines class names with Tailwind CSS conflict resolutionformatGdeltDate(): Formats GDELT date strings (YYYYMMDDHHMMSS) to readable formattruncateString(): Truncates strings with ellipsisstringToColor(): Generates consistent colors from strings for visualizationshexToRgb(): Converts hex colors to RGB for opacity operations
Path Alias
TypeScript path alias configured:
@/*→src/*
Used throughout for clean imports (e.g., import Layout from '@/components/layout/Layout')
Technical Configuration
Vite:
- Base URL commented out / set to
/for deployment flexibility - Path alias resolution for
@
TypeScript:
- Strict mode enabled
- ES2020 target
- Bundler module resolution
- JSX transform: react-jsx
ESLint:
- Uses flat config format
Key Dependencies
- react & react-dom: v19.0.0
- react-router-dom: v7.2.0 for routing
- cytoscape: Network visualization
- echarts & echarts-for-react: Charting for situational awareness
- leaflet & react-leaflet: Map visualization for GDELT
- lodash: Utility functions
- lucide-react: Icon library
- class-variance-authority, clsx, tailwind-merge: Styling utilities
Working with Projects
To add a new project:
- Add project metadata to the
projectsarray insrc/pages/ProjectsPage.tsx - Create project component in
src/components/projects/[project-name]/ - Add route in
src/App.tsx - Add data files (if needed) to
src/data/
Data Files
Located in src/data/:
gdelt-gkg.json: GDELT knowledge graph datasituational-awareness-graph.json: Situational awareness graph datastring.json: Network data for Cytoscape
Notes
- No testing framework is currently configured
- No formatter (like Prettier) is configured in package.json
- Project uses direct imports (no code splitting/lazy loading)
- Some project components include their own types (e.g., situational-awareness/types.ts)