Sukhraj Singh
All projects

Software · 2025

Moodify

A team-built music experience with mood at its centre.

Team project · Controlled local demoThree-person team project

My contribution

My documented contribution covers project documentation, an authentication readability change and four local frontend build repairs for the demo.

Evidence

Shared repository history and a 26-second controlled recording of the repaired dashboard state flow.

Scope & limitations

Spotify, Gemini, MongoDB and webcam calls use clearly labelled local fixtures in the portfolio demo.

  • Next.js
  • TypeScript
  • Flask
  • Python
  • Spotify API
  • MongoDB

See it in action.

00:26 · Local recording
Repository frontend -> controlled authentication -> webcam state -> situation analysis -> mood filter -> playback change.
About this demonstration

This is a real 1080p screen recording of the repository's Next.js dashboard after the local build repairs described above. For repeatability and privacy, requests to Spotify, Gemini, MongoDB and webcam services are intercepted with controlled contract-shaped fixtures. The recording verifies the dashboard state flow, filtering and playback controls; it does not claim live external services or model inference.

Repository frontend -> controlled authentication -> webcam state -> situation analysis -> mood filter -> playback change.

The problem & approach

The problem

Static playlists do not respond to the context around a listening session. Our project explored how text sentiment, facial emotion and listening reactions could become signals for selecting, playing and re-ranking music without making the interface feel like a collection of disconnected AI features.

The approach

Moodify is a team-built full-stack prototype that turns a typed situation or webcam emotion signal into a music context. The repository connects a Next.js dashboard to a Flask API for Spotify OAuth and playback, Gemini-assisted text analysis, webcam state, song reaction scoring and real-time database updates.

How it works
  1. 01Next.js dashboard
  2. 02Flask REST API
  3. 03Gemini text analysis
  4. 04Spotify OAuth + playback
  5. 05DeepFace webcam signal
  6. 06MongoDB reaction scores
  7. 07SSE dashboard updates
  • We created a Next.js dashboard with Spotify authentication state, a situation input, mood filters, ranked songs, webcam controls and a persistent playback surface.
  • We implemented Flask endpoints for text analysis, Spotify playback controls, webcam lifecycle, face-distance volume recommendations and enjoyed-song retrieval.
  • We modelled per-track reactions with total scores and an emotion breakdown for happy, sad, angry, surprise, fear, disgust, neutral and skipped states.
  • We used Server-Sent Events for database notifications while retaining periodic refreshes as a fallback for the song-ranking view.
  • The Git history credits my account with the project documentation and a later Spotify authentication readability change; the application itself is presented as shared team work.
  • For the portfolio recording, I repaired the frontend's path alias, component import, JSX class string and missing Spotify color tokens so the repository dashboard could build and run locally.
Technical decisions & lessons

Next.js

We used it for the dashboard, client-side state and the interaction surface around mood, songs and playback.

Flask

We used a Python API boundary to coordinate AI, webcam, database and Spotify integrations.

Spotify Web API

It provides the OAuth, search, queue and playback controls needed for a real listening workflow.

Gemini + DeepFace

The design separates text context from visual emotion so each signal can contribute without becoming the whole recommendation.

MongoDB

The flexible track documents store total preference scores beside emotion-specific reaction counts.

SSE + polling

The dashboard can react to new scoring data while retaining a simple recovery path if the event stream closes.

Challenges

  • The application coordinates several stateful external boundaries: Spotify OAuth and device playback, Gemini responses, webcam processing and MongoDB availability.
  • Mood detection, playback polling and database events can update the same interface at different intervals, so stale or contradictory state is a practical concern.
  • The public repository does not include service credentials or a fully self-contained backend environment, so the recorded demo uses clearly labelled local API fixtures instead of presenting external integrations as live.
  • The frontend required four small local build repairs before it could be recorded; those capture-only corrections are not claimed as changes to the shared upstream repository.

What I learned

  • I learned how a frontend and Python API divide responsibility in a full-stack application.
  • I learned that OAuth, playback devices and rate-limited APIs create product states the interface must explain clearly.
  • I learned to treat text and camera outputs as replaceable signals rather than letting one model control the complete experience.
  • I learned that a credible demo must separate verified interface behavior from integrations that still require credentials, hardware or external services.

Dashboard contracts · http

POST /api/analyze-situation
  -> { sentiment, keyword }

GET  /api/current-playback
  -> { track, device, is_playing }

GET  /api/db-updates
  -> text/event-stream