Skip to content

kayla0409/datafy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Listening Log Analytics Friends

Datafy

Datafy is a web application that allows users to log and analyze their Spotify listening history. Users can rate songs, attach moods and notes, browse listening history, view analytics such as listening streaks and genre distribution, search their listening history, and see recent activity from friends.

Features

  • Rate songs out of 10 with notes and moods
  • View recently played Spotify tracks
  • Dashboard analytics (listening streak, top artists, genre distribution)
  • Mood trends and average song ratings
  • Advanced search and filtering by mood, genre, rating, and date range
  • Friends activity feed

Prerequisites

  • Node.js
  • Spotify developer account (for.env credentials)
  • Spotify application created in the Spotify Developer Dashboard (for.env credentials)
  • MongoDB database (for.env credentials)

Installation

  1. Clone the repository
git clone git@github.com:ashleybelshe/datafy.git
cd datafy
  1. Install server dependencies
cd server
npm install
  1. Install client dependencies
cd ../client
npm install
  1. Create a .env file inside the server directory:
SPOTIFY_CLIENT_ID=your_client_id
SPOTIFY_CLIENT_SECRET=your_client_secret
PORT=5050
SPOTIFY_REDIRECT_URI=your_spotify_redirect
MONGODB_URI= your_database
  1. Run the application

In one terminal, start the server:

cd server
npm run dev

In another terminal, start the client:

cd client
npm run dev
  1. Open your browser and go to https://127.0.0.1:5173

API Endpoints

Listening Entries (Built by Jokebed)

Method Endpoint Description
POST /api/listening-entries Save a new listening entry
GET /api/listening-entries Retrieve entries with optional filters
PUT /api/listening-entries/:id Update an existing entry
GET /api/listening-entries/analytics Get analytics for a user

Search Filters (GET /api/listening-entries)

Parameter Type Description
userId String Required - the user's ID
mood String Filter by mood (happy, sad, energetic, calm, focused, nostalgic)
genre String Filter by genre
minRating Number Minimum rating (0-10)
maxRating Number Maximum rating (0-10)
startDate Date Start of date range
endDate Date End of date range

Spotify Auth

Method Endpoint Description
GET /auth/login Redirect to Spotify login
GET /auth/callback Handle Spotify OAuth callback
GET /auth/recent Fetch recently played tracks
GET /auth/me Fetch user profile
GET /auth/streak Calculate listening streak

Tech Stack

  • Frontend: React + TypeScript + Vite
  • Backend: Node.js + Express
  • Database: MongoDB (Mongoose)
  • External API: Spotify Web API

About

UCLA CS 35L group project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors