How mahessh9848/swaram-music works
Swaram is a mood-based music web app: users choose a mood and language, browse its playlist, and play tracks; they can also import and manage local MP3s. The frontend owns the main experience, playback, demo authentication, and preferences. An optional Express API exposes mood, playlist, history, and favorite operations backed by Oracle when configured, with fallback data for some reads. The README documents broader database capabilities, but database scripts are not present in this tree. Unsampled frontend modules are included where the tree and README establish their role; uncertain connections are omitted or marked dashed.
Main entry points: Home.jsx Home orchestration · MoodSelector.jsx Mood selection · usePlayer.js Player state and queue · App.jsx React app entry
Components 27
Mood experience
- React app entry
frontend/src/App.jsx - Home orchestration
frontend/src/pages/Home.jsx - Mood catalog
frontend/src/data/moods.js - Mood selection
frontend/src/components/MoodSelector.jsx - Mood card
frontend/src/components/MoodCard.jsx - Mood artwork
frontend/src/components/MoodHero.jsx - Mood playlist
frontend/src/components/PlaylistSection.jsx - Song card
frontend/src/components/SongCard.jsx
Playback and library
- Local music library
frontend/src/components/MusicLibrary.jsx - Imported track storage
frontend/src/storage/musicStorage.js - Player controls
frontend/src/components/MusicPlayer.jsx - Player state and queue
frontend/src/hooks/usePlayer.js - HTML audio engine
frontend/src/player/audioEngine.js - Playback adapter
frontend/src/player/playbackAdapter.js - Player controller
frontend/src/player/playerController.js
API and data
- Express API app
backend/src/app.js - API routes
backend/src/routes/index.js - Music API controller
backend/src/controllers/musicController.js - Music service
backend/src/services/musicService.js - Oracle connection layer
backend/src/db/index.js - Frontend API client
frontend/src/services/api.js
User preferences
- Demo login modal
frontend/src/components/LoginModal.jsx - Demo authentication
frontend/src/hooks/useAuth.js - Language preferences
frontend/src/data/languages.js - Theme preference
frontend/src/hooks/useTheme.js
Other components
- Listener
- Oracle database
Connections 24
- Listener → React app entry: opens
- React app entry → Home orchestration: renders
frontend/src/App.jsx - Home orchestration → Mood catalog: selects mood
frontend/src/pages/Home.jsx - Home orchestration → Mood selection: renders
frontend/src/pages/Home.jsx - Home orchestration → Mood artwork: renders
frontend/src/pages/Home.jsx - Home orchestration → Mood playlist: renders
frontend/src/pages/Home.jsx - Mood selection → Mood card: renders
frontend/src/components/MoodSelector.jsx - Mood selection → Language preferences: selects language
frontend/src/components/MoodSelector.jsx - Mood playlist → Song card: renders
frontend/src/components/PlaylistSection.jsx - Home orchestration → Player state and queue: manages playback
frontend/src/pages/Home.jsx - Home orchestration → Local music library: renders
frontend/src/pages/Home.jsx - Home orchestration → Demo login modal: renders
frontend/src/pages/Home.jsx - Home orchestration → Demo authentication: manages login
frontend/src/pages/Home.jsx - Home orchestration → Theme preference: manages theme
frontend/src/pages/Home.jsx - Local music library → Imported track storage: manages tracks
frontend/src/components/MusicLibrary.jsx - Player controls → Player state and queue: controls playback
- Player state and queue → HTML audio engine: controls audio
frontend/src/hooks/usePlayer.js - Player controller → Playback adapter: uses adapter
frontend/src/player/playerController.js - Express API app → API routes: mounts routes
backend/src/app.js - API routes → Music API controller: routes requests
backend/src/routes/index.js - Music API controller → Music service: calls service
backend/src/controllers/musicController.js - Music service → Oracle connection layer: queries database
backend/src/services/musicService.js - Oracle connection layer → Oracle database: executes SQL
backend/src/db/index.js - Frontend API client → Express API app: calls API