How pcottle/learngitbranching works
LearnGitBranching is a client-side Git visualizer and learning game. A learner enters commands in the sandbox or a lesson; command handling applies simulated Git operations to an in-memory repository, and the visualization reflects the resulting commit graph. Lessons add goals, solution checking, progress, and level-building; the app also supports Mercurial mode, localization, and shareable command/tree state. Edges are limited to README workflow statements and relationships visible in the supplied excerpts or SOURCE INDEX; unsampled implementation details are not assumed.
Main entry points: level/index.js Lesson controller · app/index.js Application shell · commands/index.js Command routing · git/index.js Git engine
Components 20
App interaction
- Application shell
src/js/app/index.js - Command interface
src/js/views/commandViews.js - Sandbox mode
src/js/sandbox/index.js
Command simulation
- Command routing
src/js/commands/index.js - Option parsing
src/js/commands/optionParser.js - Git commands
src/js/git/commands.js - Git engine
src/js/git/index.js - Graph algorithms
src/js/graph/treeCompare.js - Mercurial commands
src/js/mercurial/commands.js
Lessons and progress
- Lesson controller
src/js/level/index.js - Level and progress store
src/js/stores/LevelStore.js - Lesson sequences
src/levels/sequenceInfo.js - Level builder
src/js/level/builder.js
Visualization and support
- Commit visualization
src/js/visuals/visualization.js - Graph drawing
src/js/visuals/index.js - Dialogs and views
src/js/views/index.js - Completion certificates
src/js/views/certificateView.js - Localization
src/js/intl/index.js - Permalink sharing
src/js/util/sharing.js
Other components
- Learner
Connections 22
- Learner → Application shell: opens
README.md - Application shell → Sandbox mode: initializes
src/js/app/index.js - Application shell → Command interface: loads
src/js/app/index.js - Learner → Command interface: enters commands
README.md - Command interface → Command routing: submits commands
- Command routing → Option parsing: parses options
src/js/commands/index.js - Command routing → Git commands: routes Git
src/js/commands/index.js - Command routing → Mercurial commands: routes Mercurial
src/js/commands/index.js - Git commands → Git engine: applies operations
- Git engine → Graph algorithms: uses graph logic
src/js/git/index.js - Git engine → Commit visualization: updates repository view
- Commit visualization → Graph drawing: draws graph
- Learner → Lesson controller: starts lessons
README.md - Lesson controller → Level and progress store: loads progress and levels
src/js/level/index.js - Level and progress store → Lesson sequences: reads sequences
src/js/stores/LevelStore.js - Lesson controller → Commit visualization: creates lesson view
src/js/level/index.js - Lesson controller → Dialogs and views: shows lesson dialogs
src/js/level/index.js - Learner → Level builder: builds levels
README.md - Level builder → Dialogs and views: presents builder flow
- Lesson controller → Completion certificates: offers completion
src/js/level/index.js - Learner → Permalink sharing: shares permalinks
README.md - Application shell → Localization: loads strings
src/js/app/index.js