How yuniruyuni/streamtaginventory works
Project Type & Purpose
• This is a *frontend-only* Single‐Page Application (SPA) for Twitch streamers to manage and apply streaming templates (title/category/tag sets) via the Twitch API.
• It uses React + TypeScript, Bun as the build/runtime, Tailwind CSS for styling, and is ultimately served as static assets (Docker + Nginx).
Core Components
a. User’s Browser (SPA)
• React components (CategorySelector, InputTags, MainScreen, TemplateCard, etc.)
• Contexts & Hooks (TwitchAuth context/provider, useTemplateOperations, useStorage)
• Local storage persistence layer (useStorage.ts → browser’s localStorage)
• i18n layer for locale switching
b. Static Asset Server
• Docker container running Nginx (Dockerfile + conf.d/default.conf)
• Serves index.html, JS bundle, CSS, assets
c. Build & Dev Toolchain (optional inset)
• Bun (bun.lock, bunfig.toml) for build/dev server (bin/local.ts)
• Lint/format (biome), TypeScript compilation (tsconfig.json)
d. External Service
• Twitch API endpoints
• OAuth2 authentication & token issuance
• Category (game) search endpoint
• Channel settings PATCH (title/category/tag)
• Stream markers POST
Relationships & Data Flows
• Browser SPA ←(HTTP/HTTPS)→ Static Server (Nginx)
• SPA → TwitchAuth (OAuth redirect / token management)
• SPA → Twitch API
• GET /helix/games (category search)
• PATCH /helix/channels (apply template)
• POST /helix/stream_markers
• SPA ↔ localStorage (template CRUD via templateIO.ts & useStorage.ts)
Architectural Patterns & Design Principles
• Component‐Based UI (presentational vs. container hooks)
• Context API for cross‐cutting concerns (auth, notifications, i18n)
• Custom hooks for data‐fetching & side‐effects (useTemplateSearch, useTemplateOperations)
• Local persistence abstraction (templateIO.ts, useStorage)
• Static hosting with containerized reverse proxy (Docker + Nginx)