A smart playlist converter SaaS that seamlessly transfers your music playlists between different streaming platforms.
TuneSync is a modern web application that allows users to convert and transfer their music playlists between various streaming services. Built with a robust backend API and a beautiful, responsive frontend, TuneSync provides a seamless experience for music enthusiasts who want to maintain their playlists across different platforms.
- Multi-Platform Support: Connect to Spotify, Apple Music, YouTube Music, and more
- Smart Playlist Conversion: Intelligent matching of songs across different platforms
- User Authentication: Secure email/password and Google OAuth authentication
- Real-time Progress Tracking: Monitor playlist conversion progress in real-time
- Modern UI/UX: Beautiful, responsive interface built with Next.js and Tailwind CSS
- Secure OAuth Flow: Secure state management for OAuth authentication
- Redis Caching: Fast and efficient data caching with Redis
TuneSync follows a modern microservices architecture with the following components:
- Framework: NestJS with TypeScript
- Database: PostgreSQL with Prisma ORM
- Authentication: JWT tokens with Passport.js
- OAuth: Google OAuth and Spotify OAuth integration
- Caching: Redis for session management and caching
- API Documentation: Auto-generated with Swagger
- Framework: Next.js 15 with App Router
- Styling: Tailwind CSS with shadcn/ui components
- State Management: React Context and hooks
- Forms: React Hook Form with Zod validation
- Authentication: Client-side auth state management
- Database: PostgreSQL 16
- Cache: Redis 7
- Containerization: Docker and Docker Compose
- Development: Hot reload and development tools
- NestJS - Progressive Node.js framework
- TypeScript - Type-safe JavaScript
- Prisma - Modern database toolkit
- PostgreSQL - Reliable database
- Redis - In-memory data store
- JWT - JSON Web Tokens for authentication
- Passport.js - Authentication middleware
- Class Validator - Validation decorators
- Next.js 15 - React framework with App Router
- React 19 - UI library
- TypeScript - Type-safe JavaScript
- Tailwind CSS - Utility-first CSS framework
- shadcn/ui - Re-usable components
- React Hook Form - Form state management
- Zod - Schema validation
- Axios - HTTP client
- Docker - Containerization
- Docker Compose - Multi-container orchestration
- ESLint - Code linting
- Prettier - Code formatting
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher)
- Yarn or npm
- Docker and Docker Compose
- Git
git clone <repository-url>
cd playlist-projectStart the required services (PostgreSQL, Redis, pgAdmin):
cd infra
docker-compose up -dThis will start:
- PostgreSQL database on port
5432 - Redis cache on port
6379 - pgAdmin on port
5050
cd backend
# Install dependencies
yarn install
# Set up environment variables
cp .env.example .env
# Edit .env with your configuration
# Run database migrations
yarn prisma migrate dev
# Start development server
yarn start:devThe backend will be available at http://localhost:3001
cd frontend
# Install dependencies
yarn install
# Set up environment variables
cp .env.example .env
# Edit .env with your configuration
# Start development server
yarn devThe frontend will be available at http://localhost:3000
Create a .env file in the backend directory:
# Database
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/tunesync"
# JWT
JWT_SECRET="your-jwt-secret"
JWT_EXPIRES_IN="7d"
# OAuth
GOOGLE_CLIENT_ID="your-google-client-id"
GOOGLE_CLIENT_SECRET="your-google-client-secret"
GOOGLE_CALLBACK_URL="http://localhost:3001/auth/google/callback"
SPOTIFY_CLIENT_ID="your-spotify-client-id"
SPOTIFY_CLIENT_SECRET="your-spotify-client-secret"
SPOTIFY_CALLBACK_URL="http://localhost:3001/auth/spotify/callback"
# Redis
REDIS_URL="redis://localhost:6379"
# App
PORT=3001
NODE_ENV=development
# Frontend URL for OAuth redirects
FRONTEND_URL="http://localhost:3000"Create a .env file in the frontend directory:
# API
NEXT_PUBLIC_BACKEND_URL="http://localhost:3001"
# OAuth
NEXT_PUBLIC_GOOGLE_CLIENT_ID="your-google-client-id"
NEXT_PUBLIC_SPOTIFY_CLIENT_ID="your-spotify-client-id"The project uses Prisma as the ORM. To set up the database:
cd backend
# Generate Prisma client
yarn prisma generate
# Run migrations
yarn prisma migrate dev
# (Optional) Seed the database
yarn prisma db seed- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable the Google+ API
- Create OAuth 2.0 credentials
- Add authorized redirect URIs:
http://localhost:3001/auth/google/callback(development)https://yourdomain.com/auth/google/callback(production)
- Go to Spotify Developer Dashboard
- Create a new app
- Add redirect URIs:
http://localhost:3001/auth/spotify/callback(development)https://yourdomain.com/auth/spotify/callback(production)
playlist-project/
βββ backend/ # NestJS backend
β βββ src/
β β βββ auth/ # Authentication module
β β βββ users/ # User management
β β βββ playlists/ # Playlist operations
β β βββ spotify/ # Spotify integration
β β βββ state/ # OAuth state management
β β βββ common/ # Shared utilities
β βββ prisma/ # Database schema and migrations
β βββ test/ # Backend tests
βββ frontend/ # Next.js frontend
β βββ app/ # App Router pages
β βββ components/ # Reusable components
β βββ lib/ # Utility functions
β βββ types/ # TypeScript type definitions
β βββ contexts/ # React contexts
βββ infra/ # Infrastructure configuration
βββ docker-compose.yml # Docker services
cd backend
# Run unit tests
yarn test
# Run tests in watch mode
yarn test:watch
# Run e2e tests
yarn test:e2e
# Generate coverage report
yarn test:covcd frontend
# Run tests
yarn test
# Run tests in watch mode
yarn test:watch# Backend
cd backend
yarn build
yarn start:prod
# Frontend
cd frontend
yarn build
yarn start# Build and run with Docker Compose
docker-compose -f infra/docker-compose.yml up -d- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Use TypeScript for type safety
- Follow ESLint and Prettier configurations
- Write meaningful commit messages
- Add JSDoc comments for complex functions
- Use conventional commit messages
- Create feature branches for new functionality
- Keep commits atomic and focused
- Write descriptive PR descriptions
- Write unit tests for business logic
- Add integration tests for API endpoints
- Maintain good test coverage
- Test OAuth flows thoroughly
Database Connection Issues
- Ensure PostgreSQL is running:
docker compose ps - Check DATABASE_URL in .env file
- Run migrations:
yarn prisma migrate dev
Redis Connection Issues
- Ensure Redis is running:
docker compose ps - Check REDIS_URL in .env file
- Verify Redis port (6379) is not blocked
OAuth Issues
- Verify client IDs and secrets in .env
- Check redirect URIs match exactly
- Ensure HTTPS in production
Frontend Build Issues
- Clear Next.js cache:
rm -rf .next - Reinstall dependencies:
yarn install - Check TypeScript errors:
yarn lint
This project is licensed under the MIT License - see the LICENSE file for details.
- NestJS for the amazing backend framework
- Next.js for the React framework
- Prisma for the database toolkit
- shadcn/ui for the beautiful components
- Tailwind CSS for the utility-first CSS framework
Made with β€οΈ by Luiz Colman