Skip to content

kabirgaire0/music247

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Music247 🎵

A Spotify clone built with Next.js, FastAPI, and PostgreSQL.

Next.js FastAPI PostgreSQL TypeScript

Features

  • 🎨 Spotify-themed dark UI with Tailwind CSS
  • 🔐 JWT Authentication (register, login, protected routes)
  • 🎵 Audio Player with play/pause, skip, volume controls
  • 📚 Browse songs, albums, and artists
  • 🔍 Search with live results
  • ❤️ Liked Songs and playlists
  • 📱 Responsive design

Tech Stack

Layer Technology
Frontend Next.js 14, TypeScript, Tailwind CSS, Zustand
Backend FastAPI, SQLAlchemy (async), Pydantic v2
Database PostgreSQL 16 (Docker)
Auth JWT (python-jose), bcrypt

Quick Start

Prerequisites

  • Docker Desktop
  • Python 3.10+
  • Node.js 18+

1. Start PostgreSQL

cd backend
docker-compose up -d

2. Run Backend

cd backend
python -m venv venv
.\venv\Scripts\activate  # Windows
pip install -r requirements.txt
uvicorn app.main:app --reload

The API will be at http://localhost:8000 (Swagger docs at /docs)

3. Run Frontend

cd frontend
npm install
npm run dev

Open http://localhost:3000

Project Structure

music247/
├── backend/
│   ├── app/
│   │   ├── main.py          # FastAPI app
│   │   ├── database.py      # SQLAlchemy async
│   │   ├── seed.py          # Sample data
│   │   ├── models/          # Database models
│   │   ├── schemas/         # Pydantic schemas
│   │   ├── routers/         # API endpoints
│   │   └── auth/            # JWT utilities
│   ├── docker-compose.yml
│   └── requirements.txt
│
└── frontend/
    ├── src/
    │   ├── app/             # Next.js pages
    │   ├── components/      # React components
    │   ├── store/           # Zustand stores
    │   └── utils/           # API client, types
    ├── package.json
    └── tailwind.config.js

API Endpoints

Endpoint Method Description
/api/auth/register POST Create account
/api/auth/login POST Login (returns JWT)
/api/songs GET List songs
/api/songs/featured GET Popular tracks
/api/albums/{id} GET Album with tracks
/api/artists/{id} GET Artist discography
/api/playlists GET/POST User playlists
/api/library/liked GET/POST Liked songs

Sample Data

The database is seeded with demo content:

Artist Album
The Midnight Endless Summer
ODESZA A Moment Apart
Tycho Dive
Bonobo Migration
Flume Hi This Is Flume

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors