How codelovingcat/github-snake-remix works
GitHub Snake Remix fetches a contribution calendar, normalizes it into a grid, plans and simulates a deterministic snake animation, renders SVG frames, and encodes them as a GIF artifact. The graph includes the core domain, color, animation, rendering, and quality responsibilities. The README documents the overall workflow and product features; source excerpts establish several internal calls. Some orchestration details are not excerpted, so only documented or directly evidenced relationships are shown.
Main entry points: animation-timeline.ts Animation Timeline · generate.ts Generation Orchestrator · gif-output.ts GIF Encoder · contribution-grid.ts Grid Normalizer
Components 15
Contribution Data
- GraphQL Provider
src/github-graphql.ts - Calendar Contract
src/github-contributions.ts - Grid Normalizer
src/contribution-grid.ts
Snake Simulation
- Snake Path Planner
src/snake-path.ts - Snake Engine
src/snake-engine.ts - Animation Timeline
src/animation-timeline.ts
Rendering and Output
- Generation Orchestrator
src/generate.ts - SVG Frame Renderer
src/svg-renderer.ts - GIF Encoder
src/gif-output.ts - Artifact Quality Guards
src/quality.ts - GIF Artifact
Shared Domain
- Grid and Point Types
src/domain.ts - Contribution Colors
src/colors.ts
Other components
- Generator Operator
- GitHub GraphQL API
Connections 23
- Generator Operator → Generation Orchestrator: runs generation
README.md - Generation Orchestrator → GraphQL Provider: requests calendar
README.md - GraphQL Provider → GitHub GraphQL API: queries calendar
src/github-graphql.ts - GraphQL Provider → Calendar Contract: returns calendar
src/github-graphql.ts - Generation Orchestrator → Grid Normalizer: normalizes calendar
README.md - Grid Normalizer → Calendar Contract: reads calendar
src/contribution-grid.ts - Grid Normalizer → Contribution Colors: uses empty-cell color
src/contribution-grid.ts - Generation Orchestrator → Animation Timeline: creates animation
README.md - Animation Timeline → Snake Path Planner: plans route
src/animation-timeline.ts - Animation Timeline → Snake Engine: simulates movement
src/animation-timeline.ts - Animation Timeline → Grid Normalizer: reads cells
src/animation-timeline.ts - Generation Orchestrator → GIF Encoder: encodes animation
README.md - GIF Encoder → Animation Timeline: reads frames
src/gif-output.ts - GIF Encoder → SVG Frame Renderer: renders frames
src/gif-output.ts - SVG Frame Renderer → Snake Engine: reads snake state
src/svg-renderer.ts - SVG Frame Renderer → Contribution Colors: colors cells
src/svg-renderer.ts - SVG Frame Renderer → Animation Timeline: reads heart particles
src/svg-renderer.ts - GIF Encoder → Artifact Quality Guards: validates output
src/gif-output.ts - GIF Encoder → GIF Artifact: writes GIF
src/gif-output.ts - Grid Normalizer → Grid and Point Types: uses cell types
src/contribution-grid.ts - Snake Path Planner → Grid and Point Types: uses point helpers
src/snake-path.ts - Snake Engine → Grid and Point Types: uses cell helpers
src/snake-engine.ts - Contribution Colors → Grid and Point Types: uses contribution levels
src/colors.ts