Click the "Deploy with Vercel" button above for instant deployment to Vercel's serverless platform.
Click the "Deploy to DigitalOcean" button above for deployment to DigitalOcean's managed platform.
# Vercel
npm run deploy:vercel
# DigitalOcean Droplet
curl -fsSL https://raw.githubusercontent.com/dzp5103/Spotify-echo/main/scripts/deploy-digitalocean-droplet.sh | sudo bash
# DigitalOcean App Platform
npm run deploy:digitalocean:appcp .env.example .env
# Edit .env and set at least:
# JWT_SECRET, SESSION_SECRET, SPOTIFY_CLIENT_ID, SPOTIFY_CLIENT_SECRET
# Optional: MONGODB_URI, REDIS_URL, PERPLEXITY_API_KEY# Build
docker build --build-arg BUILD_SHA=$(git rev-parse --short HEAD) \
--build-arg BUILD_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ") -t echotune-ai:latest .
# Run
docker run --env-file .env -p 3000:3000 --name echotune echotune-ai:latest
# Health
curl -fsS http://localhost:3000/health# Production-like stack (app + redis, optional mongo)
docker compose up -d
# Logs
docker compose logs -f app
# Dev override (hot reload)
docker compose -f docker-compose.yml -f docker-compose.override.yml --profile dev up app-dev vite redis# Create app from spec
#doctl auth init
#doctl apps create --spec app.yaml
# Important: In Spotify Dashboard set redirect:
# https://YOUR_DO_DOMAIN/auth/callback- This repo builds a Vite frontend to
dist/. If you deploy on Vercel but host API elsewhere, set the API proxy invercel.jsonrewrites to your backend domain. - Add environment variables via Vercel dashboard (no secrets in code).
- Spotify redirect to configure in Spotify Dashboard:
- https://YOUR_VERCEL_DOMAIN/auth/callback
- Dev: http://localhost:3000/auth/callback
- DigitalOcean: https://YOUR_DO_DOMAIN/auth/callback
- Vercel: https://YOUR_VERCEL_DOMAIN/auth/callback
If mismatched, Spotify will return: INVALID_CLIENT: Invalid redirect URI.
- GET
/healthbasic JSON status - GET
/api/healthquick API health - GET
/api/health/detailedcomprehensive report
See DEPLOY_CHECKLIST.md before going live.
EchoTune AI is an advanced music discovery platform that combines AI-powered recommendations, conversational music search, and comprehensive analytics. Built with modern technologies including React 19, Node.js, MongoDB, and Redis, it provides a seamless music experience powered by multiple AI providers.
- AI-Powered Recommendations: Advanced algorithms for personalized music suggestions
- Conversational Search: Natural language music queries and discovery
- Playlist Generation: Intelligent playlist creation based on mood, genre, and preferences
- Spotify Integration: Full Spotify OAuth and API integration
- Multi-Provider Support: OpenAI, Google AI, Perplexity AI, XAI (Grok)
- Conversational AI: Natural language music chat and recommendations
- Explainable AI: Transparent reasoning for music suggestions
- Continuous Learning: Adaptive algorithms that improve over time
- Listening Analytics: Comprehensive music listening statistics
- Performance Metrics: Real-time system monitoring and optimization
- User Behavior Analysis: Deep insights into music preferences
- Recommendation Quality: Metrics for AI suggestion accuracy
- Modern Stack: React 19 + Vite, Node.js, MongoDB, Redis
- Real-time Updates: WebSocket integration for live features
- Responsive Design: Mobile-first, cross-platform compatibility
- API-First Architecture: RESTful APIs with comprehensive documentation
- Security: JWT authentication, rate limiting, CORS protection
src/frontend/
βββ components/ # Reusable UI components
βββ contexts/ # React context providers
βββ styles/ # CSS and styling
βββ App.jsx # Main application component
βββ index.jsx # Application entry point
src/
βββ api/ # API routes and middleware
βββ auth/ # Authentication and authorization
βββ database/ # Database models and connections
βββ ml/ # Machine learning algorithms
βββ spotify/ # Spotify integration
βββ utils/ # Utility functions
βββ server.js # Main server file
mcp-servers/
βββ perplexity-mcp/ # Perplexity AI integration
βββ browserbase/ # Browser automation
βββ filesystem/ # File system operations
βββ memory/ # Memory management
βββ enhanced-mcp/ # Enhanced MCP capabilities
Best for: Frontend + API, rapid deployment, cost-effective scaling
Features:
- β Automatic deployments from Git
- β Built-in SSL certificates
- β Global CDN
- β Serverless functions
- β Zero configuration
Quick Start:
# Clone repository
git clone https://github.com/dzp5103/Spotify-echo.git
cd Spotify-echo
# Setup environment
npm run vercel:setup
# Deploy
npm run deploy:vercelEnvironment Variables:
# Required
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/database
JWT_SECRET=your_very_long_random_jwt_secret_key
SESSION_SECRET=your_very_long_random_session_secret
# Optional
REDIS_URL=redis://username:password@host:port
SPOTIFY_CLIENT_ID=your_spotify_client_id
SPOTIFY_CLIENT_SECRET=your_spotify_client_secret
OPENAI_API_KEY=your_openai_api_key
PERPLEXITY_API_KEY=your_perplexity_api_keyBest for: Production applications, managed infrastructure, cost optimization
Features:
- β Fully managed platform
- β Automatic scaling
- β Built-in monitoring
- β SSL certificates
- β Container deployment
Quick Start:
# Setup environment
npm run do:setup-env
# Deploy to App Platform
npm run deploy:digitalocean:appBest for: Full control, custom configurations, cost optimization
Features:
- β Complete server control
- β Docker containerization
- β Custom SSL setup
- β Advanced monitoring
- β Cost-effective
Quick Start:
# One-command deployment
curl -fsSL https://raw.githubusercontent.com/dzp5103/Spotify-echo/main/scripts/deploy-digitalocean-droplet.sh | sudo bashBest for: Enterprise applications, microservices, advanced orchestration
Features:
- β Enterprise-grade orchestration
- β Advanced scaling
- β Multi-service architecture
- β Production-ready
- β Advanced monitoring
Quick Start:
# Deploy to DOKS
npm run deploy:digitalocean:k8s- Node.js 20+ and npm 10+
- MongoDB (local or Atlas)
- Redis (local or cloud)
- Git
# Clone repository
git clone https://github.com/dzp5103/Spotify-echo.git
cd Spotify-echo
# Install dependencies
npm install
# Setup environment
cp .env.example .env
# Edit .env with your configuration
# Start development servers
npm run dev # Frontend (Vite)
npm run dev:backend # Backend (Node.js)# Copy example environment file
cp .env.example .env
# Required variables
MONGODB_URI=mongodb://localhost:27017/echotune
JWT_SECRET=your_development_jwt_secret
SESSION_SECRET=your_development_session_secret
# Optional variables
REDIS_URL=redis://localhost:6379
SPOTIFY_CLIENT_ID=your_spotify_client_id
SPOTIFY_CLIENT_SECRET=your_spotify_client_secret
OPENAI_API_KEY=your_openai_api_key
PERPLEXITY_API_KEY=your_perplexity_api_keyGET /api/health- Health checkGET /api/spotify/*- Spotify integrationPOST /api/chat- AI chat interfaceGET /api/recommendations- Music recommendationsPOST /api/playlists- Playlist management
# JWT token required for protected endpoints
Authorization: Bearer <your_jwt_token>- API endpoints: 100 requests per 15 minutes
- Authentication: 5 requests per 15 minutes
- Spotify endpoints: 50 requests per minute
# All tests
npm test
# Specific test suites
npm run test:unit # Unit tests
npm run test:integration # Integration tests
npm run test:e2e # End-to-end tests
npm run test:performance # Performance tests
# Watch mode
npm run test:watch# Generate coverage report
npm run test:coverage
# Coverage targets
- Statements: 80%
- Branches: 80%
- Functions: 80%
- Lines: 80%- Health Checks:
/api/healthendpoint - Performance Metrics: Response time, memory usage, CPU
- Error Tracking: Automatic error logging and reporting
- Request Logging: All API requests logged with metadata
- Sentry: Error tracking and performance monitoring
- AgentOps: AI agent monitoring and optimization
- Custom Dashboards: Grafana or similar for advanced metrics
# View application logs
npm run logs
# View specific service logs
npm run logs:api
npm run logs:frontend
npm run logs:database- JWT Tokens: Secure token-based authentication
- Session Management: Redis-backed session storage
- Rate Limiting: Protection against abuse and DDoS
- CORS Protection: Configurable cross-origin resource sharing
- Input Validation: Comprehensive input sanitization
- SQL Injection Protection: Parameterized queries
- XSS Protection: Content Security Policy headers
- HTTPS Enforcement: SSL/TLS encryption
// Automatic security headers
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Strict-Transport-Security: max-age=31536000; includeSubDomains
Content-Security-Policy: default-src 'self'- Code Splitting: Dynamic imports for better loading
- Lazy Loading: Components loaded on demand
- Image Optimization: WebP format with fallbacks
- Service Worker: Offline capabilities and caching
- Database Indexing: Optimized MongoDB queries
- Redis Caching: Session and data caching
- Connection Pooling: Database connection optimization
- Gzip Compression: Response compression
- Static Asset Optimization: Minification and compression
- CDN Integration: Global content delivery
- Cache Headers: Optimized caching strategies
- Bundle Analysis: Webpack bundle optimization
# Automated testing and deployment
name: CI/CD Pipeline
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- run: npm ci
- run: npm test
- run: npm run build- Automatic Testing: Tests run on every commit
- Build Verification: Automated build validation
- Deployment Triggers: Automatic deployment on main branch
- Health Checks: Post-deployment verification
- Load Balancing: Multiple instance support
- Auto-scaling: Automatic resource scaling
- Database Sharding: MongoDB cluster support
- Redis Clustering: Distributed caching
- Resource Optimization: Memory and CPU tuning
- Database Optimization: Query optimization and indexing
- Caching Strategies: Multi-layer caching
- CDN Integration: Global content delivery
- API Reference: Complete API documentation
- Deployment Guides: Step-by-step deployment instructions
- Troubleshooting: Common issues and solutions
- Performance Tuning: Optimization guidelines
- GitHub Issues: Bug reports and feature requests
- Discussions: Community discussions and help
- Wiki: Additional documentation and guides
- Examples: Code examples and tutorials
- Check Documentation: Start with the deployment guides
- Search Issues: Look for similar problems in GitHub issues
- Create Issue: Report bugs or request features
- Community Support: Ask questions in discussions
- Fork Repository: Create your own fork
- Create Branch: Make changes in feature branch
- Write Tests: Ensure all tests pass
- Submit PR: Create pull request with description
- Code Review: Address feedback and suggestions
- ESLint: JavaScript/TypeScript linting
- Prettier: Code formatting
- Jest: Testing framework
- TypeScript: Type safety (optional)
- Unit Tests: 80% coverage minimum
- Integration Tests: API endpoint testing
- E2E Tests: User workflow testing
- Performance Tests: Load and stress testing
This project is licensed under the MIT License - see the LICENSE file for details.
- Spotify: Music API and integration
- OpenAI: AI language models
- Perplexity AI: Research and analysis capabilities
- DigitalOcean: Infrastructure and hosting
- Vercel: Serverless deployment platform
- Community: Contributors and users
- Version: 2.1.0
- Status: Production Ready
- Last Updated: January 2025
- Maintenance: Active Development
- Support: Community + Documentation
- Choose Platform: Vercel (easiest) or DigitalOcean (full control)
- Click Deploy: Use the deployment buttons above
- Configure Environment: Set required environment variables
- Deploy: Automatic deployment and configuration
- Customize: Add your domain, configure SSL, set up monitoring
Ready to deploy? Click one of the deployment buttons above to get started! π΅
For detailed instructions, see: