How anvaka/map-of-github works
Purpose and entry points
Map of GitHub is a client-side explorer for a precomputed map of 690K+ GitHub repositories. Geographic proximity represents shared stargazers; map tiles and repository/search data are produced offline and consumed by the browser. Application startup flows through src/main.js, src/startVue.js, and root UI src/App.vue; Vite serves/builds the SPA via vite.config.js.
Application shell and interaction state
src/App.vue composes the map, search, repository details, and chat/label-editing surfaces. Vue components isolate major user workflows: repository lookup and selection in src/components/Typeahead.vue and src/components/GithubRepository.vue; focused-repository presentation in src/components/FocusRepository.vue; hierarchy/navigation in src/components/TreeView.vue. Cross-component events use src/lib/bus.js, while focus and group state are modeled by src/lib/FocusViewModel.js and src/lib/GroupViewModel.js.
Map rendering boundary
The central rendering boundary is between application state and map implementations. src/lib/createMap.js creates the primary map experience; src/lib/createMaplibreSubgraphViewer.js integrates MapLibre-backed visualization, and src/lib/createSubgraphViewer.js supports focused/local graph views. The browser loads pre-generated GeoJSON/vector-tile map data rather than calculating similarity, clustering, or layouts at runtime. MapLibre is the material mapping runtime; custom WebGL primitives under src/lib/gl/ provide specialized points, lines, labels, and gradients.
Repository discovery and graph retrieval
Search uses a client-side, prefix-oriented repository dump with fuzzy matching, represented by src/lib/createFuzzySearcher.js and src/components/Typeahead.vue. On selection, src/lib/fetchAndProcessGraph.js retrieves and normalizes graph/subgraph data for the map and details views. src/lib/dedupingFetch.js coordinates repeated network requests. Repository metadata and GitHub-facing links/API operations are encapsulated in src/lib/githubClient.js, separating external GitHub access from Vue presentation.
Focus, groups, and export flow
A selected repository drives a focused graph/view-model state through src/lib/focus.js and src/lib/FocusViewModel.js, then feeds src/components/FocusRepository.vue and map subgraph viewers. Group-level navigation uses src/lib/GroupViewModel.js and src/components/LargestRepositories.vue. Users can export a group graph through src/lib/downloadGroupGraph.js, keeping download serialization outside rendering components.
Community labels and AI-assisted editing
Country/community labels are editable in the browser. src/lib/label-editor/createLabelEditor.js and src/lib/label-editor/createDOMMarkerEditor.js attach editing UI to map markers; src/lib/label-editor/labelsStorage.js persists edits for later contribution. src/lib/openAIClient.js forms the boundary to OpenAI for generating or assisting label content. public/oauth.html is a dedicated OAuth callback surface, likely supporting authenticated contribution workflows.
Runtime, deployment, and assets
This is a Vue SPA built with Vite and deployed as static content; deploy.sh is the repository deployment entry point. Static browser assets, including manifest, fonts, and OAuth callback page, live under public/. No server-side graph-computation pipeline is present here: BigQuery star-event extraction, AWS-scale Jaccard computation, Leiden clustering, force layouts, and Tippecanoe tile generation are upstream/offline infrastructure described by the project, with their outputs consumed by this frontend.
Main entry points: App.vue Application shell · createLabelEditor.js Label editor · Typeahead.vue Repository search · FocusViewModel.js Focus state
Components 22
Vue SPA
- Browser entry
src/main.js - Vue bootstrap
src/startVue.js - Application shell · Composes map, search, details, and editing surfaces.
src/App.vue - Repository search
src/components/Typeahead.vue - Repository details
src/components/GithubRepository.vue - Focused repository
src/components/FocusRepository.vue - Group navigation
src/components/LargestRepositories.vue - Focus state
src/lib/FocusViewModel.js - Group state & export · Supports group navigation and graph download.
src/lib/GroupViewModel.js
Map rendering
- Primary map
src/lib/createMap.js - MapLibre viewer
src/lib/createMaplibreSubgraphViewer.js - Local graph viewer
src/lib/createSubgraphViewer.js - Custom WebGL primitives · Renders specialized points, lines, labels, and gradients.
Data & external services
- Fuzzy repository index · Client-side prefix-oriented repository lookup.
src/lib/createFuzzySearcher.js - Graph retrieval · Fetches and normalizes selected repository graphs.
src/lib/fetchAndProcessGraph.js - Request deduplication
src/lib/dedupingFetch.js - Precomputed map data · Offline similarity, clustering, and layout outputs consumed in the browser.
Community labels
- Label editor · Edits map marker labels and persists contributions.
src/lib/label-editor/createLabelEditor.js - Label storage
src/lib/label-editor/labelsStorage.js - OpenAI assistance
src/lib/openAIClient.js - OAuth callback
public/oauth.html
Other components
- Vite build · Serves and builds the static SPA.
vite.config.js
Connections 23
- Vite build → Browser entry: builds/serves
- Browser entry → Vue bootstrap: starts
- Vue bootstrap → Application shell: mounts
- Application shell → Repository search: search UI
- Application shell → Repository details: details UI
- Application shell → Focused repository: focus UI
- Application shell → Primary map: creates map
- Repository search → Fuzzy repository index: queries
- Repository search → Graph retrieval: selection
- Graph retrieval → Request deduplication: coordinates requests
- Request deduplication → Precomputed map data: loads graph data
- Primary map → MapLibre viewer: uses
- Primary map → Local graph viewer: uses
- MapLibre viewer → Custom WebGL primitives: renders with
- MapLibre viewer → Precomputed map data: loads tiles
- Graph retrieval → Focus state: updates
- Focus state → Focused repository: drives
- Focus state → Local graph viewer: drives local graph
- Group state & export → Group navigation: drives
- Application shell → Label editor: hosts editing
- Label editor → Label storage: persists edits
- Label editor → OpenAI assistance: requests assistance
- OAuth callback → Label editor: supports contribution auth