Musicia is a Java-based web music streaming platform developed using Java Servlets, JDBC, and MySQL.
The application allows users to stream music online and artists to upload and manage their songs, demonstrating core concepts of server-side web development and MVC architecture.
The project fully implements all required core functionalities as per project requirements:
- Secure user registration and login
- Session-based authentication for logged-in users
- Artist registration
- Song upload with cover image support
- Users can browse and stream uploaded songs
- Real-time audio playback using JavaScript
- Separate permissions for artists and users
- Secure access control handled via Java Servlets
All modules are fully developed, integrated, and functional, providing a smooth user experience.
| Layer | Technology |
|---|---|
| Frontend | HTML, CSS, JavaScript |
| Backend | Java Servlets |
| Database | MySQL |
| Build Tool | Maven |
| Server | Apache Tomcat |
Musicia follows the Model–View–Controller (MVC) architecture:
User.javaSong.java
- HTML, CSS, JavaScript files
AuthServletSongServlet
This architecture ensures clean code, modularity, and easy scalability.
- Servlets act as controllers and handle HTTP requests
- DAO classes (
UserDAO,SongDAO) manage database operations using JDBC - Utility classes handle database connectivity
- Frontend communicates with backend through HTTP requests
- All components are smoothly integrated for seamless data flow
- JavaScript files (
auth.js,player.js) manage user interactions - Event listeners handle:
- Login & registration
- Play / pause music
- Song uploads
- Optimized event handling improves performance and responsiveness
- Client-side validation
- Implemented using JavaScript to prevent empty or invalid inputs
- Server-side validation
- Implemented in Servlets to ensure data integrity
- Invalid data is rejected before database insertion
- Try-catch blocks handle database and server exceptions
- Invalid login credentials are handled gracefully
- Upload and streaming errors do not crash the application
- User-friendly error messages improve system robustness
- Clean and modular code structure
- Proper package separation:
dao,model,servlet,util - Reusable database utility class
PreparedStatementused to prevent SQL injection
- Real-time music streaming
- Artist-based song uploads
- Scalable architecture for future enhancements
src/
├── main/
│ ├── java/
│ │ └── com/musicia/
│ │ ├── dao/
│ │ │ ├── UserDAO.java
│ │ │ └── SongDAO.java
│ │ ├── model/
│ │ │ ├── User.java
│ │ │ └── Song.java
│ │ ├── servlet/
│ │ │ ├── AuthServlet.java
│ │ │ └── SongServlet.java
│ │ └── util/
│ │ └── DatabaseUtil.java
│ ├── resources/
│ │ ├── db.properties
│ │ └── database.sql
│ └── webapp/
│ ├── css/
│ ├── js/
│ ├── WEB-INF/
│ │ └── web.xml
│ ├── index.html
│ ├── login.html
│ ├── register.html
│ └── upload.html
- Java 11 or higher
- MySQL 8.0 or higher
- Maven 3.6+
- Apache Tomcat 9+
- Clone the repository:
git clone <repository-url>- Create the database:
mysql -u root -p < src/main/resources/database.sql- Configure database connection in db.properties:
db.url=jdbc:mysql://localhost:3306/musicia
db.username=your_username
db.password=your_password
db.driver=com.mysql.cj.jdbc.Driver- Build the project:
mvn clean package- Deploy the generated WAR file to Apache Tomcat
- Access the application in your browser:
http://localhost:8080/musicia- Register as a user or artist
- Login using valid credentials
- Artists can upload songs with cover images
- Users can browse and stream music
- Logout securely after use
- Playlist creation
- Like & recommendation system
- Admin dashboard
- Cloud-based music storage
Team Name: Team KDK
- Kartik Kumar – Team Leader
- Dev Kaushik – Member
- Keshav Gehlot – Member