How lucas-free-games/github-story-map works
Purpose and Entry Points
GitHub Story Map is a Vite-built React SPA for managing GitHub Issues as label-driven story-map, Kanban, timeline, roadmap, waves, and table views. Browser startup is src/main.tsx, which mounts src/App.tsx; Firebase Hosting configuration is firebase.json.
Application Shell and View Routing
src/App.tsx composes the authenticated/setup states, header, issue dialogs, deep-linked issue reader, and active board view. src/components/Header.tsx controls repository and view selection. Primary visual projections are implemented independently in src/components/StoryMap.tsx, src/components/KanbanView.tsx, and src/components/TableView.tsx; all derive from the same issue state.
Central State and GitHub Synchronization
src/store/appStore.ts is the application control plane: it holds credentials, selected repository, issues, labels, layouts, active view, and modal/UI state. It fetches and mutates GitHub issues, applies optimistic local updates, and refreshes board projections. GitHub REST calls are encapsulated in src/lib/github.ts; issue/label shapes and view-facing domain types live in src/types/index.ts.
Label-Driven Domain Model
GitHub is the authoritative issue system. Prefix labels create board semantics: e_* defines user activities, w_* waves, s_* Kanban status, and epic contextual activities. src/components/UserActivitiesView.tsx and src/components/WavesView.tsx manage this organizational layer; src/components/LabelsManagerModal.tsx manages GitHub labels. Creation and editing flow through src/components/CreateIssueModal.tsx and src/components/EditIssueModal.tsx, translating placement choices into GitHub issue labels.
Issue Interaction Boundary
Issue cards and rows open src/components/IssueReadModal.tsx, which renders Markdown and exposes edit, close/reopen, delete, and AI actions. src/components/IssueCard.tsx provides direct board-level actions. Markdown rendering is local in src/lib/markdown.ts; image attachment behavior is isolated in src/components/ImageAttacher.tsx. URL deep links identify issue numbers and are resolved by the application shell.
Authentication, Persistence, and Runtime Infrastructure
GitHub OAuth is mediated by Firebase Auth: src/lib/auth.ts opens the GitHub provider popup and caches the returned token in browser localStorage. Firebase initialization and optional Firestore-backed layout persistence are in src/lib/firebase.ts; access restrictions are defined by firestore.rules. The frontend runs entirely in the browser, built by Vite (vite.config.ts) and deployed through Firebase Hosting. A separate Firebase Functions TypeScript project exists at functions/src/index.ts, with compiled output under functions/lib/.
Optional AI Integrations and Credential Boundary
Gemini-powered issue-description generation is client-side in src/lib/gemini.ts; Claude Managed Agent implementation sessions are client-side in src/lib/anthropic.ts. Per-user API keys and agent configuration are maintained in localStorage through src/lib/userKeys.ts and configured in src/components/SettingsView.tsx. These calls directly target external Google and Anthropic APIs; GitHub credentials and AI secrets are intentionally not persisted by the application backend.
Main entry points: App.tsx Application shell · appStore.ts App store · IssueReadModal.tsx Issue reader · auth.ts GitHub OAuth
Components 22
Browser SPA
Vite-built React application.
- Browser entry
src/main.tsx - Application shell · Composes auth states, dialogs, deep links, and active board view.
src/App.tsx - Header · Selects repository and board view.
src/components/Header.tsx - App store · Owns credentials, repository, issues, labels, layouts, views, and UI state.
src/store/appStore.ts - GitHub REST client
src/lib/github.ts - Domain types · Issue, label, and view-facing shapes.
src/types/index.ts - Board projections · Story map, Kanban, and table derive from shared issue state.
src/components/StoryMap.tsx - Activities and waves · Maps e_*, w_*, s_*, and epic labels into board organization.
src/components/UserActivitiesView.tsx - Issue cards
src/components/IssueCard.tsx - Issue reader · Deep-linked issue view with lifecycle and AI actions.
src/components/IssueReadModal.tsx - Issue create/edit · Translates placement choices into GitHub labels.
src/components/CreateIssueModal.tsx - Markdown renderer
src/lib/markdown.ts - GitHub OAuth · Caches the popup token in browser localStorage.
src/lib/auth.ts - AI settings and keys · Maintains per-user API keys and agent configuration in localStorage.
src/components/SettingsView.tsx - AI clients · Gemini generation and Claude agent sessions run directly from the browser.
src/lib/gemini.ts
Firebase
Auth, optional persistence, hosting, and functions.
- Firebase integration · Initializes Firebase and optionally persists layouts in Firestore.
src/lib/firebase.ts - Firestore layouts · Access is constrained by Firestore rules.
firestore.rules - Firebase Hosting
firebase.json - Firebase Functions · Compiled output is deployed separately from the SPA.
functions/src/index.ts
External APIs
- GitHub Issues API · Issues and prefix labels are the board source of truth.
- Google and Anthropic APIs
Other components
- Vite build
vite.config.ts
Connections 22
- Vite build → Browser entry: builds
- Browser entry → Application shell: mounts
- Application shell → Header: renders
- Application shell → App store: reads and dispatches
- Application shell → Board projections: selects active view
- App store → GitHub REST client: syncs issues and labels
- GitHub REST client → GitHub Issues API: REST calls
- App store → Domain types: uses
- App store → Board projections: supplies issue state
- Activities and waves → Board projections: organizes by labels
- Issue cards → Issue reader: opens
- Application shell → Issue reader: resolves deep links
- Issue create/edit → App store: creates and mutates issues
- Issue reader → Markdown renderer: renders issue content
- GitHub OAuth → GitHub Issues API: OAuth token authorizes
- Application shell → GitHub OAuth: authenticates
- AI settings and keys → AI clients: configures keys
- Issue reader → AI clients: invokes AI actions
- AI clients → Google and Anthropic APIs: direct client calls
- Firebase integration → Firestore layouts: persists layouts optionally
- GitHub OAuth → Firebase integration: uses Firebase Auth
- Firebase Hosting → Vite build: serves built SPA