MusicApp
A full-stack music web application with user authentication, media uploads, real-time chat, and admin tools. The project includes an Express + MongoDB backend and a React + Vite frontend with Clerk for authentication and Socket.IO for real-time features.
- User registration and authentication (Clerk)
- Upload and serve songs and album cover images (Cloudinary)
- Real-time messaging between users (Socket.IO)
- Notifications and admin endpoints
- Usage tracking and basic stats
- Error monitoring with Sentry
- Backend: Node.js, Express, MongoDB (Mongoose), Socket.IO, Cloudinary, Sentry, Clerk
- Frontend: React, Vite, TypeScript, Zustand, Clerk, Tailwind CSS, Socket.IO client
- Dev / tooling: Nodemon, ESLint, Vite
Add the following variables to the backend .env file (backend/.env) and the frontend .env file (frontend/.env). Do NOT commit secrets to source control.
PORT— Port the backend server listens on (e.g. 5000)MONGO_URL— MongoDB connection string (mongodb+srv://...)ADMIN_EMAIL— Admin account emailCLOUDINARY_CLOUD_NAME— Cloudinary cloud nameCLOUDINARY_API_KEY— Cloudinary API keyCLOUDINARY_API_SECRET— Cloudinary API secretNODE_ENV—developmentorproductionCLERK_PUBLISHABLE_KEY— Clerk publishable key for server-side usage (if used)CLERK_SECRET_KEY— Clerk secret key (server-side)SENTRY_DSN— Sentry DSN for error reporting
Example (do NOT use real secrets in repo):
PORT=5000
MONGO_URL=mongodb+srv://username:password@cluster0.example.mongodb.net/musicapp
ADMIN_EMAIL=admin@example.com
CLOUDINARY_CLOUD_NAME=your-cloud-name
CLOUDINARY_API_KEY=your-api-key
CLOUDINARY_API_SECRET=your-api-secret
NODE_ENV=development
CLERK_PUBLISHABLE_KEY=pk_test_...
CLERK_SECRET_KEY=sk_test_...
SENTRY_DSN=https://example@sentry.io/12345
VITE_CLERK_PUBLISHABLE_KEY— Clerk publishable key used by the frontend
Example:
VITE_CLERK_PUBLISHABLE_KEY=pk_test_...
Place screenshots and images in the frontend public/ folder. Example placeholders:
frontend/public/albums/— album cover imagesfrontend/public/cover-images/— app cover imagesfrontend/public/songs/— static songs (if any)
Add images to the README using relative paths, for example:
- Backend
cd backend
npm install
# create .env with the keys above
npm run dev- Frontend
cd frontend
npm install
# create frontend/.env with VITE_CLERK_PUBLISHABLE_KEY
npm run devOpen the frontend URL from Vite (usually http://localhost:5173) and the backend (http://localhost:5000) depending on your PORT.
- If real-time chat or online user status is not working, ensure both frontend and backend are using the same Socket.IO protocol version and the frontend is connecting to the correct backend URL.
- Ensure Clerk keys are configured for both frontend and backend, and the Authorization header is set for API calls.
- Check browser console and backend logs for socket connect events and errors.
