How luisreinoso/github-stars-semantic-search works
Main Components
A. Client-Side Application (Browser Environment)
• Frontend UI Layer
• Service Layer
• Local Storage Layer (PGlite)
B. External Services
• GitHub API
• OpenAI API
Detailed Component Breakdown
A. Client-Side Components (organize in layers):
Frontend Layer:
• UI Components (represented by ui-manager.ts)
• Configuration Interface (represented by config-manager.ts)
Service Layer (based on /src/services):
• Repository Manager Service
• GitHub Service
• OpenAI Service
• Database Service
• Notification Service
Storage Layer:
• PGlite Database (browser-based SQLite)
• Browser Local Storage (for API keys)
┌─ Browser Environment ─────────────────────────────────┐
• ┌─ UI Layer ─────────────────────────────┐ │
• Search Interface │ │
• Results Display │ │
• Configuration Panel │ │
• ┘ │
• ┌─ Service Layer ──────────────────────────┐ │
• ┌─ Repository Manager ─┐ ┌─ OpenAI ─┐ │ │
• Star Management │ │ - Embeddings│ │ │
• README Processing │ └───────────┘ │ │
• ┘ │ │
• ┌─ Database Service ─┐ ┌─ GitHub ─┐ │ │
• Query Processing │ │ - API │ │ │
• Storage Management│ │ - Auth │ │ │
• ┘ └──────────┘ │ │
• ┘ │
• ┌─ Storage Layer ─────────────────────────┐ │
• ┌─ PGlite ─────┐ ┌─ Local Storage ─┐ │ │
• Embeddings │ │ - API Keys │ │ │
• Metadata │ │ - User Config │ │ │
• ┘ └────────────────┘ │ │
• ┘ │
• ┘
• ↑ ↑
• ▼ ▼
┌─ GitHub API ─┐ ┌─ OpenAI API ─┐
• ┘ └─────────────┘
Authentication Flow
• User → UI → GitHub Service → GitHub API
• Credentials storage in Local Storage
Search Flow
• User Query → UI → Repository Manager
• Repository Manager → OpenAI Service → OpenAI API
• Repository Manager → Database Service → PGlite
• Results → UI
Indexing Flow
• Repository Manager → GitHub Service → GitHub API
• Repository Manager → OpenAI Service → OpenAI API
• Repository Manager → Database Service → PGlite
Additional Notes
• Notes about privacy and security considerations
• Version/environment information
• Data flow direction indicators
• Error handling paths