How ryanlegler/git-graph works
Main System Components
a) Client-Side (Frontend):
• Next.js Application Layer
• Component Layer
• State Management (indicated by atoms.ts)
• UI Components Library
• Data Visualization Layer (Graph component)
b) Server-Side:
• Next.js Server Components
• API Routes
• Data Fetching Layer
Detailed Component Breakdown
a) Page Components:
• Main Page (/)
• Preview Page (/preview/[username])
• Embed Page (/embed/[username])
• Theme Page (/theme)
b) Core Feature Components (show as interconnected modules):
• Builder Component
• Graph Component
• Controls Component
• Header Component
• EmbedCodeModal Component
c) Data Flow Layer:
• Data Fetching (dataLayer folder)
• Contribution Processing
• State Management
Interaction Flows
User Input → Controls → Builder → Graph
Data Layer → Contributions Data → Graph
Theme Settings → Builder → Graph
Technical Implementation Details
A section showing:
• Next.js App Router Architecture
• Server/Client Component Split
• Data Fetching Pattern
• State Management Flow
Specific Implementation Notes
• React Server Components (RSC)
• Client Components
• Data Fetching Boundaries
• State Management Boundaries
1. The app's modular architecture with clear separation between builder, controls, and visualization components
The theme customization system
Key Relationships to Highlight:
• Builder → Graph (visualization rendering)
• Controls → Builder (user input handling)
• DataLayer → Components (data flow)
• Theme → Builder (styling system)
Remember to:
• Keep components grouped by functionality
• Clear boundaries between client/server code
• State management flow
• Embedding feature's architecture