Skip to content

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.

Notifications You must be signed in to change notification settings

Anant-Saini/ME_OBJECT_MODELING_JUKEBOX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

59 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎡 Jukebox - Music Playlist Management System

Java Gradle Build Status

πŸ“‹ 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

    git clone <repository-url>
    cd jukebox
  2. Build the project

    ./gradlew build
  3. Run the application

    ./gradlew run

    Or run directly:

    java -jar build/libs/jukebox.jar

πŸ“– Usage

The application supports the following commands:

Load Data

LOAD-DATA <csv-file-path>

Load songs from a CSV file into the system.

Create User

CREATE-USER <user-name>

Create a new user profile.

Create Playlist

CREATE-PLAYLIST <user-id> <playlist-name> <song-id-1> <song-id-2> ...

Create a new playlist for a user with specified songs.

Modify Playlist

MODIFY-PLAYLIST <playlist-id> <ADD/DELETE> <song-id>

Add or remove songs from an existing playlist.

Delete Playlist

DELETE-PLAYLIST <user-id> <playlist-id>

Delete a user's playlist.

Play Playlist

PLAY-PLAYLIST <user-id> <playlist-id>

Play songs from a specific playlist.

Play Song

PLAY-SONG <user-id> <song-id>

Play a specific song.

πŸ“Š Sample Data Format

Songs CSV format:

id,name,genre,album,artist
1,Song Name,Pop,Album Name,Artist Name

πŸ§ͺ Testing

Run the test suite:

./gradlew test

Run with coverage:

./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

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages