An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

          

# ๐ŸŽต Jukebox - Music Playlist Management System

![Java](https://img.shields.io/badge/Java-ED8B00?style=for-the-badge&logo=java&logoColor=white)
![Gradle](https://img.shields.io/badge/Gradle-02303A?style=for-the-badge&logo=gradle&logoColor=white)
![Build Status](https://img.shields.io/badge/build-passing-brightgreen?style=for-the-badge)

## ๐Ÿ“‹ 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*