How johnvic211/song-chords works
Project type and purpose
• This is a single‑page application (SPA) built with React and Vite.
• It serves as a music/playlist viewer and manager, presenting song metadata and lyrics, with UI features like dark‑mode toggling, playlist creation, and key transposition.
File structure
• Top‑level artifacts:
• index.html & public/ → static HTML entry and public assets
• src/ → all React source code
• vite.config.js, package.json, eslint.config.js → build, dependency, and lint configuration
• Within src/:
• main.jsx & App.jsx → application entry point and root component
• src/assets/ → images or static assets (if any)
• src/data/ → static data modules (artist.jsx, songBank.jsx) and JSON (youth_service.json)
• src/components/ → reusable UI components, grouped by domain:
– app/ (Header, Footer, UseDarkMode)
– playlist/ (PlaylistManager, PlaylistSong, PlaylistSongManager)
– song/ (SongPage, SongLyrics, AutoScrollLyrics, MusicInformation, SongTransposer, TransposeKey, SettingsModal, Url, SongSelector)
README for additional insights
• Confirms the use of Vite’s fast‑refresh plugins for React
• Minimal setup, no backend—purely front‑end toolchain
a. Main components to include
• Browser / User Agent
• Dev Server (Vite) or Production Server (serving static files)
• React Application (JS bundle produced by Vite)
• Component Layers:
– App Shell (App.jsx → Header, Footer, UseDarkMode)
– Playlist Domain (PlaylistManager, PlaylistSong, PlaylistSongManager)
– Song Domain (SongPage, Lyrics, Transposer, SettingsModal, etc.)
• Data Layer (static modules in src/data and youth_service.json)
• Build & Tooling (Vite, Babel/SWC plugin, ESLint)
b. Relationships & interactions
• User → Browser → React App entry point
• React App ↔ Component hierarchy (parent→child)
• Components → Data modules (import) for song/artist info and JSON
• SongTransposer & TransposeKey → internal logic altering lyrics pitch
• UseDarkMode → toggles CSS class on document root
• Dev environment: Vite Dev Server ↔ Browser via HMR; Production: static host → Browser
c. Architectural patterns & design principles
• Component-based UI (React)
• Unidirectional data flow (props/state drilling from App → subcomponents)
• Separation of concerns (data modules vs. presentation components)
• Build‑time tooling (Vite & plugins) decoupled from runtime
d. Key technologies & libraries
• React (component rendering, hooks)
• Vite (bundling, dev server, HMR)
• ESLint (code quality)
• Babel or SWC via @vitejs/plugin‑react for fast refresh