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.
- 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
The project follows a layered architecture with clear separation of concerns:
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
Implements the Command Design Pattern for extensible functionality:
CreateUserCommand- Creates new user profilesCreatePlayListCommand- Creates custom playlistsModifyPlayListCommand- Add/remove songs from playlistsDeletePlayListCommand- Remove playlistsPlayPlayListCommand- Play songs from a playlistPlaySongCommand- Play individual songsLoadDataCommand- Load song data from CSV files
Core domain models representing the system's data:
User- User profile informationSong- Song metadata (name, genre, album, artist)PlayList- Collection of songs belonging to a userPlayListStatus- Enumeration for playlist states
Business logic layer implementing core functionality:
UserService- User management operationsSongService- Song catalog managementPlayListService- Playlist operations and playback
Data access layer with CRUD operations:
- Generic
CRUDRepositoryinterface - Concrete implementations for Users, Songs, and Playlists
- Java 8 or higher
- Gradle 6.x or higher
-
Clone the repository
git clone <repository-url> cd jukebox
-
Build the project
./gradlew build
-
Run the application
./gradlew run
Or run directly:
java -jar build/libs/jukebox.jar
The application supports the following commands:
LOAD-DATA <csv-file-path>
Load songs from a CSV file into the system.
CREATE-USER <user-name>
Create a new user profile.
CREATE-PLAYLIST <user-id> <playlist-name> <song-id-1> <song-id-2> ...
Create a new playlist for a user with specified songs.
MODIFY-PLAYLIST <playlist-id> <ADD/DELETE> <song-id>
Add or remove songs from an existing playlist.
DELETE-PLAYLIST <user-id> <playlist-id>
Delete a user's playlist.
PLAY-PLAYLIST <user-id> <playlist-id>
Play songs from a specific playlist.
PLAY-SONG <user-id> <song-id>
Play a specific song.
Songs CSV format:
id,name,genre,album,artist
1,Song Name,Pop,Album Name,Artist NameRun the test suite:
./gradlew testRun with coverage:
./gradlew test jacocoTestReportThe application can be configured through the AppConfig.java file:
- Default data file paths
- Repository implementations
- Service configurations
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a 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
- 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
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
This project is part of Crio.Do's learning platform.
Developed as part of the Object Modeling module at Crio.Do
- Crio.Do for the project framework
- Java community for best practices guidance
Last Updated: October 2025