https://github.com/anant-saini/me_object_modeling_jukebox
Jukebox is a sophisticated music playlist management system built using object-oriented design principles in Java. The application allows users to create, manage, and play custom playlists with an intuitive command-based interface. This project demonstrates clean architecture, command pattern implementation, and robust exception handling.
https://github.com/anant-saini/me_object_modeling_jukebox
clear-exception-handling command-design-pattern command-line-tool core-java-application dependency-injection gradle jukebox-player object-oriented-programming singleton-design-pattern solid-design-principles
Last synced: about 1 month ago
JSON representation
Jukebox is a sophisticated music playlist management system built using object-oriented design principles in Java. The application allows users to create, manage, and play custom playlists with an intuitive command-based interface. This project demonstrates clean architecture, command pattern implementation, and robust exception handling.
- Host: GitHub
- URL: https://github.com/anant-saini/me_object_modeling_jukebox
- Owner: Anant-Saini
- Created: 2025-10-28T20:26:59.000Z (about 1 month ago)
- Default Branch: master
- Last Pushed: 2025-10-28T20:48:19.000Z (about 1 month ago)
- Last Synced: 2025-10-28T22:31:59.689Z (about 1 month ago)
- Topics: clear-exception-handling, command-design-pattern, command-line-tool, core-java-application, dependency-injection, gradle, jukebox-player, object-oriented-programming, singleton-design-pattern, solid-design-principles
- Language: Java
- Homepage:
- Size: 168 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ต Jukebox - Music Playlist Management System



## ๐ Project Overview
Jukebox is a sophisticated music playlist management system built using object-oriented design principles in Java. The application allows users to create, manage, and play custom playlists with an intuitive command-based interface. This project demonstrates clean architecture, command pattern implementation, and robust exception handling.
## โจ Features
- **User Management**: Create and manage multiple user profiles
- **Playlist Operations**: Create, modify, delete, and play playlists
- **Song Management**: Load songs from CSV, search and play individual tracks
- **Command Pattern**: Extensible command-based architecture for easy feature addition
- **Data Persistence**: Load song data from CSV files
- **Exception Handling**: Comprehensive custom exceptions for better error management
## ๐๏ธ Architecture
The project follows a layered architecture with clear separation of concerns:
### Core Packages
```
com.crio.jukebox/
โโโ appConfig/ # Application configuration
โ โโโ AppConfig.java
โโโ commands/ # Command pattern implementations
โ โโโ ICommand.java
โ โโโ CommandInvoker.java
โ โโโ CreateUserCommand.java
โ โโโ CreatePlayListCommand.java
โ โโโ ModifyPlayListCommand.java
โ โโโ DeletePlayListCommand.java
โ โโโ PlayPlayListCommand.java
โ โโโ PlaySongCommand.java
โ โโโ LoadDataCommand.java
โโโ entities/ # Domain models
โ โโโ BaseEntity.java
โ โโโ User.java
โ โโโ Song.java
โ โโโ PlayList.java
โ โโโ PlayListStatus.java
โโโ repositories/ # Data access layer
โ โโโ CRUDRepository.java
โ โโโ UserRepository.java
โ โโโ SongRepository.java
โ โโโ PlayListRepository.java
โโโ services/ # Business logic layer
โ โโโ UserService.java
โ โโโ SongService.java
โ โโโ PlayListService.java
โโโ exceptions/ # Custom exceptions
โโโ UserNotFoundException.java
โโโ SongNotFoundException.java
โโโ PlayListNotFoundException.java
โโโ PlayListIsEmptyException.java
โโโ ActivePlayListNotFoundException.java
โโโ SongNotFoundInPlayListException.java
โโโ CommandNotFoundException.java
โโโ InvalidCommandException.java
โโโ CSVFileLoadingException.java
```
## ๐ฏ Key Components
### Commands
Implements the **Command Design Pattern** for extensible functionality:
- `CreateUserCommand` - Creates new user profiles
- `CreatePlayListCommand` - Creates custom playlists
- `ModifyPlayListCommand` - Add/remove songs from playlists
- `DeletePlayListCommand` - Remove playlists
- `PlayPlayListCommand` - Play songs from a playlist
- `PlaySongCommand` - Play individual songs
- `LoadDataCommand` - Load song data from CSV files
### Entities
Core domain models representing the system's data:
- `User` - User profile information
- `Song` - Song metadata (name, genre, album, artist)
- `PlayList` - Collection of songs belonging to a user
- `PlayListStatus` - Enumeration for playlist states
### Services
Business logic layer implementing core functionality:
- `UserService` - User management operations
- `SongService` - Song catalog management
- `PlayListService` - Playlist operations and playback
### Repositories
Data access layer with CRUD operations:
- Generic `CRUDRepository` interface
- Concrete implementations for Users, Songs, and Playlists
## ๐ Getting Started
### Prerequisites
- Java 8 or higher
- Gradle 6.x or higher
### Installation
1. **Clone the repository**
```bash
git clone
cd jukebox
```
2. **Build the project**
```bash
./gradlew build
```
3. **Run the application**
```bash
./gradlew run
```
Or run directly:
```bash
java -jar build/libs/jukebox.jar
```
## ๐ Usage
The application supports the following commands:
### Load Data
```
LOAD-DATA
```
Load songs from a CSV file into the system.
### Create User
```
CREATE-USER
```
Create a new user profile.
### Create Playlist
```
CREATE-PLAYLIST ...
```
Create a new playlist for a user with specified songs.
### Modify Playlist
```
MODIFY-PLAYLIST
```
Add or remove songs from an existing playlist.
### Delete Playlist
```
DELETE-PLAYLIST
```
Delete a user's playlist.
### Play Playlist
```
PLAY-PLAYLIST
```
Play songs from a specific playlist.
### Play Song
```
PLAY-SONG
```
Play a specific song.
## ๐ Sample Data Format
Songs CSV format:
```csv
id,name,genre,album,artist
1,Song Name,Pop,Album Name,Artist Name
```
## ๐งช Testing
Run the test suite:
```bash
./gradlew test
```
Run with coverage:
```bash
./gradlew test jacocoTestReport
```
## ๐ง Configuration
The application can be configured through the `AppConfig.java` file:
- Default data file paths
- Repository implementations
- Service configurations
## ๐ค Contributing
Contributions are welcome! Please follow these steps:
1. Fork the repository
2. Create a feature branch (`git checkout -b feature/AmazingFeature`)
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request
## ๐ Design Patterns Used
- **Command Pattern**: Encapsulates commands as objects for flexible execution
- **Repository Pattern**: Abstracts data access logic
- **Service Layer Pattern**: Separates business logic from presentation
- **Singleton Pattern**: Used in repository and service management
## ๐ Learning Outcomes
This project demonstrates:
- Clean code principles and SOLID design
- Object-oriented programming best practices
- Design pattern implementation
- Layered architecture design
- Exception handling strategies
- CSV data processing
- Command-line interface design
## ๐ License
This project is part of Crio.Do's learning platform.
## ๐ฅ Authors
Developed as part of the Object Modeling module at Crio.Do
## ๐ Acknowledgments
- Crio.Do for the project framework
- Java community for best practices guidance
---
**Built with โค๏ธ using Java and Gradle**
=====================================
*Last Updated: October 2025*