A Next.js frontend for JukeboxDuo, a real-time synchronized music listening application.
- Real-time synchronization - Listen to music in perfect sync with friends
- Room-based listening - Create and join music rooms
- Queue management - Add, remove, and reorder songs
- YouTube integration - Search and play YouTube videos
- Responsive design - Works on desktop and mobile
All these features are powered by the WebSocket server for real-time communication and synchronization.
This repository contains the frontend only. The WebSocket server is in a separate repository for better scalability and deployment flexibility.
- Frontend: Next.js 15 with TypeScript, Tailwind CSS, and Socket.IO client
- WebSocket Server: JukeboxDuo-Websocket - Separate repository with TypeScript and Socket.IO server
- Database: PostgreSQL with Prisma ORM
- Authentication: NextAuth.js
- Node.js 18+
- npm or yarn
- PostgreSQL database
- YouTube API key
-
Clone the repository:
git clone https://github.com/your-username/jukebox-duo.git cd jukebox-duo -
Install dependencies:
npm install
-
Set up environment variables:
cp .env.example .env.local
See
.env.examplefor required keys. -
Set up the database:
npx prisma generate npx prisma db push
-
Run the development server:
npm run dev
-
Open http://localhost:3000 in your browser.
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLint
For local development, you'll need to run the WebSocket server separately:
- Clone the WebSocket server repository:
git clone https://github.com/ashwaniverma-github/Jukebox-Duo-Websocket.git
- Follow its setup instructions
- Set
NEXT_PUBLIC_SOCKET_URL=http://localhost:3001in your.env.local
-
Deploy to Vercel:
npx vercel
-
Set environment variables in Vercel dashboard:
DATABASE_URLNEXTAUTH_SECRETNEXTAUTH_URLYOUTUBE_API_KEYNEXT_PUBLIC_SOCKET_URL(your deployed WebSocket server URL)
Deploy the WebSocket server to Railway, Render, or DigitalOcean following the instructions in the JukeboxDuo-Websocket repository. See jukebox-duo-websocket/DEPLOYMENT.md for detailed steps.
src/
├── app/ # Next.js App Router pages
│ ├── api/ # API routes
│ ├── dashboard/ # Dashboard page
│ └── room/ # Room pages
├── components/ # React components
├── hooks/ # Custom React hooks
├── lib/ # Utility libraries
└── types/ # TypeScript type definitions
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT License