vibechain-api

ML-powered playlist recommendation API that predicts what song you want to hear next.

Built with TypeScript, Express, and TensorFlow.js, VibeChain analyzes Spotify track features—like danceability, energy, and valence— to predict the vibe of the next track. Trained on 32K Spotify tracks for realistic recommendations.

Key Features

  • • REST API for music vibe prediction
  • • Health check endpoint
  • • Model training and retraining scripts
  • • Optional Spotify integration via environment variables

API Examples

# Health check
curl http://localhost:8080/health

# Predict next track vibe
curl -X POST http://localhost:8080/analyze   -H "Content-Type: application/json"   -d '{"tracks":[{"danceability":0.8,"energy":0.9,"valence":0.7}]}'

Scripts

  • • npm run dev – start dev server
  • • npm run start – production build + run
  • • npm run train – retrain the model
  • • npm run health – check if api is up

Config

# .env (optional)
SPOTIFY_CLIENT_ID=your_client_id
SPOTIFY_CLIENT_SECRET=your_secret
PORT=8080

Tech Stack

  • • TypeScript, Express
  • • TensorFlow.js for ML
  • • Docker, Vercel for deploy