A modern, full-stack web-based music player built with Node.js, Express, MongoDB, and EJS.
MyMusic Player is a full-stack web application that serves as a modern online music player with an interface inspired by popular platforms like Spotify. This project is a proof-of-concept for building a complete web application from scratch, including a backend, database, API, and user authentication system.
- Modern & Responsive UI: A clean, intuitive interface that works smoothly on both desktop and mobile devices.
- Full-Featured Music Player: Includes play/pause, progress bar, volume control, shuffle, repeat modes, and a synchronized fullscreen "Now Playing" view.
- Native OS Integration: Utilizes the Media Session API for lock screen and hardware media controls.
- Dynamic Content: Browse dynamically-loaded playlists, artists, and song libraries fetched from the server.
- Secure Authentication: User registration and login system with server-side password hashing (bcrypt) and JWT-based session management.
- Personalization:
- Liked Songs: Save your favorite tracks to a personal collection.
- Account Settings: Update your profile info, change your password, and upload a custom avatar.
- Dynamic Interactions: Liking songs and other personalized actions are handled instantly via API calls without page reloads.
Area | Technologies |
---|---|
Backend | Node.js, Express.js |
Database | MongoDB (with Mongoose ODM) |
Frontend | HTML5, CSS3, JavaScript (ES6+) |
View Engine | EJS (Embedded JavaScript templating) |
Authentication | JSON Web Tokens (JWT), bcrypt.js |
File Uploads | Multer |
Environment | dotenv, nodemon |
Homepage | Playlist / Artist Page | Fullscreen Player |
---|---|---|
![]() |
![]() |
|
Login Page | Account Settings | Change Avatar |
![]() |
![]() |
![]() |
Click to view installation guide
To run this project on your local machine, follow these steps.
- Node.js (v16.x or later)
- MongoDB (local installation) or a MongoDB Atlas account (recommended)
-
Clone the repository:
git clone https://github.com/TranHuuDat2004/mymusic.git cd mymusic
-
Install backend dependencies:
cd backend npm install
-
Create a
.env
file in thebackend
directory and add the following:PORT=5001 MONGO_URI=your_mongodb_connection_string JWT_SECRET=your_super_secret_jwt_key
- Replace the placeholder values with your actual configuration.
-
Import initial data (Optional):
node backend/importData.js
-
Start the server:
npm run dev
-
Open your browser and navigate to
http://localhost:5001
.
Contributions are welcome! If you'd like to contribute to the project, please fork the repository and create a Pull Request.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.
This project was developed by Trần Hữu Đạt.
- GitHub: @TranHuuDat2004
- Portfolio: tranhuudat2004.github.io
Thank you for checking out MyMusic Player!