A Spotify-like music streaming application built with Next.js and Cosmic CMS.
- Music library with artists, albums, and tracks
- Playlist creation and management
- A music player with playback controls
- Responsive design for all devices
- Node.js 18.x or later (if using npm)
- Bun runtime (if using bun)
- A Cosmic CMS account and bucket
-
Set up Cosmic:
- Sign up for a free account at https://www.cosmicjs.com/signup
- After signing up, create a new project by clicking "Create Bucket"
- Choose the "Empty Bucket" option and give your project a name
- Once created, find your bucket credentials by going to Project Settings > API Access
- Copy your bucket slug and API keys for the next steps
-
Clone the repository:
git clone https://github.com/cosmicjs/cosmic-spotify-clone
cd spotify-clone
- Install dependencies:
Using bun (recommended):
bun install
Using npm:
npm install
- Create a
.env.local
file in the root directory with your Cosmic credentials:
COSMIC_BUCKET_SLUG=your-bucket-slug
COSMIC_READ_KEY=your-read-key
COSMIC_WRITE_KEY=your-write-key
- Set up the Cosmic object types by running the seed script:
Using bun:
bun scripts/seed-cosmic.ts
Using npm:
npm run seed
- Start the development server:
Using bun:
bun dev
Using npm:
npm run dev
- Open http://localhost:3000 in your browser.
If you have an existing project using npm and want to convert to bun, follow these steps:
- Install bun globally (if you haven't already):
curl -fsSL https://bun.sh/install | bash
- Remove the existing node_modules folder and package-lock.json:
rm -rf node_modules package-lock.json
- Install dependencies using bun:
bun install
-
Update your scripts to use bun:
- Replace
npm run
withbun run
- For TypeScript scripts, you can run them directly with bun (e.g.,
bun scripts/seed-cosmic.ts
)
- Replace
-
Start the development server with bun:
bun dev
/app
- Next.js app router pages and layouts/components
- React components/lib
- Utility functions and configurations/types
- TypeScript type definitions/scripts
- Utility scripts
- Next.js 15
- TypeScript
- Tailwind CSS
- Cosmic CMS
- React Audio Player
- Fork the repository
- Create your 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
This project is licensed under the MIT License - see the LICENSE file for details.