SoundTrack is an AI-powered application that creates a personalized soundtrack based on your mood, environment, and biomedical data. It captures your daily experiences through images, analyzes your emotional state through EEG/ECG data, and automatically selects music that matches your current state.
- Real-time Mood Detection: Uses EEG and ECG data to determine emotional state
- Environment Analysis: AI-powered image analysis to understand surroundings
- Smart Music Selection: Intelligent song recommendations via Spotify API
- Daily Video Montages: Auto-generated videos with custom soundtracks
- Beautiful Dashboard: Spotify-like interface with timeline and analytics
soundtrack/
├── backend/ # FastAPI backend application
├── frontend/ # Next.js frontend application
├── docs/ # Documentation and guides
├── scripts/ # Utility scripts
├── .env.example # Environment variables template
└── README.md # This file
-
Create Firebase Project:
- Go to https://console.firebase.google.com/
- Create a new project (or select existing)
- Enable Firestore Database
- Enable Firebase Storage
-
Download Service Account Credentials:
- Go to Project Settings > Service Accounts
- Click "Generate New Private Key"
- Save the JSON file to
HTV2025/(parent directory)
-
Note your Storage Bucket:
- Go to Storage in Firebase Console
- Copy your bucket URL (e.g.,
project-id.firebasestorage.app)
-
Navigate to backend directory:
cd backend -
Create Python virtual environment:
python -m venv venv
-
Activate virtual environment:
# On macOS/Linux in EACH NEW TERMINAL: source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Configure environment variables:
- Edit
backend/.envand update:FIREBASE_PROJECT_ID=your-project-id FIREBASE_CREDENTIALS_PATH=path-to-service-account.json STORAGE_BUCKET=your-project.firebasestorage.app SPOTIFY_CLIENT_ID=your_spotify_client_id SPOTIFY_CLIENT_SECRET=your_spotify_client_secret GEMINI_API_KEY=your_gemini_api_key
- Edit
-
Start the backend server:
uvicorn app.main:app --reload --port 8000
-
Verify backend is running:
- API: http://localhost:8000
- Docs: http://localhost:8000/docs
- Health Check: http://localhost:8000/health
-
Navigate to frontend directory:
cd frontend -
Install dependencies:
npm install
-
Configure environment variables:
- Edit
frontend/.env.local:NEXT_PUBLIC_API_URL=http://localhost:8000 PORT=3000
- Edit
-
Start the frontend server:
npm run dev
-
Access the application:
- Frontend: http://localhost:3000
-
Install Firebase CLI:
npm install -g firebase-tools
-
Login to Firebase:
firebase login
-
Install function dependencies:
cd functions npm install -
Configure backend URL:
firebase functions:config:set backend.url="http://your-backend-url:8000" -
Deploy Cloud Functions:
firebase deploy --only functions
-
Make sure backend is running (see Backend Setup step 6)
-
Update test image path in
backend/test_upload.py:local_image = "path/to/your/image.jpg"
-
Run the upload script:
cd backend source venv/bin/activate # Make sure venv is activated python test_upload.py
-
Verify:
- Check Firebase Storage for uploaded image
- Check Firestore for created media entry
- Check backend logs for processing confirmation
- Python 3.8-3.12 (NOT 3.13 - see troubleshooting below)
- Node.js 18+
- Firebase Project
- Spotify Developer Account
- Google AI Studio Account (for Gemini)
- OpenAI API Key
- Firebase: Create project at https://console.firebase.google.com/
- Spotify: Create app at https://developer.spotify.com/
- Gemini: Get key from https://aistudio.google.com/
- OpenAI: Get key from https://platform.openai.com/
- Backend README - API documentation and backend setup
- Frontend README - Frontend architecture and components
- Startup Guide - Detailed setup instructions
- Implementation Checklist - Development roadmap
This is a hackathon starter repository with basic CRUD operations. See the implementation checklist for the full feature roadmap.
Error: Failed building wheel for pydantic-core when running pip install -r requirements.txt
Cause: Python 3.13 has breaking changes that are incompatible with the current version of pydantic-core.
Solution: Use Python 3.12 or earlier
-
Check if you have Python 3.12:
python3.12 --version
-
If not installed, install Python 3.12:
# On macOS: brew install [email protected] # On Ubuntu/Debian: sudo apt install python3.12 python3.12-venv # On Windows: # Download from https://www.python.org/downloads/
-
Recreate virtual environment with Python 3.12:
cd backend rm -rf venv python3.12 -m venv venv source venv/bin/activate pip install -r requirements.txt
If you don't see detailed logs when the Cloud Function calls the backend, make sure you're running uvicorn with the --reload flag:
uvicorn app.main:app --reload --port 8000-
Check Cloud Function logs:
firebase functions:log
-
Verify the backend URL is configured:
firebase functions:config:get
-
Ensure Firebase Storage bucket matches in:
- Cloud Function deployment
- Backend
.envfile - Raspberry Pi upload script
MIT License - see LICENSE file for details