Welcome to our music streaming system! 👋🎵
Our project designs and implements a music streaming system for Artists (content creators) and Listeners (consumers). We include user authentication, media management (songs and podcasts), and playback controls (play, pause, stop).
We aim to have a clear separate of concerns across authentication, catalog, media items, and the CLI application.
- Our
Catalogacts as the single source of truth for all content, centralizing search functionality and simplifying read-mostly access - Inheritance allows common fields to reside in abstract classes, with subclasses adding unique attributes
MediaItemis extended by concrete types such as Song and Podcast, with shared fields like itemId, title, and durationSec defined in MediaItemUserclass is extended by Artist and Listener, each inheriting base fields such as userId and displayName
Searchableinterface allows different media objects to share a common search behavior across the system- State management via the
PlayerStateenum controls player statesPLAYING,PAUSED, andSTOPPEDfor clear playback transitions
auth:AuthService: Registers accounts, verifies credentials, validates and creates sessionsSession: Holds session metadata (sessionId, accountId, role, linkedId, active flag)Account: User credentials and role binding
catalog:Catalog: content of all MediaItems; add/list/get and search entry pointsLibrary: per-listener collection of saved item IDsDataLoader: Initializes clibrary/catalog information from filesdata: artists, listeners, song CSV files
domain:MediaItem(abstract): itemId, title, durationSec, common behaviorSong: concrete implmentation ofMediaItemPodcast: concrete implmentation ofMediaItemSearchable(interface): contract for matching queries (title)
user:User(abstract): base user identityArtist: can create/publish items to CatalogListener: maintains a Library, playback stateRole: ARTIST, LISTENER for authorization checks in CLI
app:MusicSystemCLI: text UI, handles auth -> catalog/library -> playback flowsConsoleUI: utility class providing ANSI color-coded console output (success, error, info, warning messages) and formatted input prompts to create a beautified and colorful user experience
exceptions:InvalidCredentialsException: Custom exception thrown when login fails due to invalid credentialsItemNotFoundException: Custom exception thrown when a requested item cant be found in the catalog
config:Constants: Enforces maximum number of instances (100) allowed for each class withIllegalStateException
test:- Includes unit test coverage across each package
- Our single source of truth allows all content to live in the Catalog. Library stores only item IDs (references)
- We designed with extensibility in mind, making implementing new media types and adding more search capabilities easier
- We considered security, deciding our AuthService handles the credential checks, while session carries the role
- We intentionally decided on hashmaps and sets as we considered performance. We have a read-mostly catalog with simple indexing (such as in-memory mapping by itemId and title), and library operations are O(1) on item IDs
- NumberFormatException - Catches invalid number input (built-in)
- InvalidCredentialsException - Catches login failures (custom)
- ItemNotFoundException - Catches missing songs (custom)
- File I/O (
DataLoader.java) - Catches file-loading errors (e.g., IOException) during CSV reads
- Current file-based persistence via DataLoader keeps setup simple but isn’t realistic for account creation. A future improvement would be migrating to a database to support live updates
- Introduce indexing and metadata filters (e.g., genre, album, artist) to enable more search capabilities
- Implement better authentication practice by implementing password hashing
- Clone the repository
git clone https://github.com/juliahusainzada/Music-System-CS151-Fall-2025.git
cd Music-System-CS151-Fall-2025/src
- Compile the file
javac app/MusicSystemCLI.java
- Launch the CLI
java app/MusicSystemCLI.java
- Enjoy the music player!
Once you've launched the CLI, you'll be greeted with the Main Menu, where you can register or log in as a user (User)
- Register - Create an account as either an Artist or Listener
- Login - Access your exist account and session
- Exit - Close the application
If you register/log in as an Artist, you will see the Artist Menu, where you can:
- Publish Media - Add new music to global Catalog
- View Published Songs - List all media uploaded by you
- Remove song - Delete the media from Catalog
If you register/log in as a Listener, you will see the Listener Menu, where you can:
- Search Songs - Query the Catalog for available media by title
- Save/Unsave Songs - Add or remove items in personal Library
- Play Song - Start playback
- Pause/ Stop - Manage your playback state
- View Saved Songs - Display songs saved to your personal library
Artist:
- Register as Artist
- Log in → “Publish Song” → Enter title & duration
- You can verify it appears in the catalog!
Listener:
- Register as Listener (logs you in)
- “Search Songs” → View results from catalog
- “Save Song” to add to your Library
- “Play Song” → “Pause” → “Stop” and see state transitions
- “View Saved Songs”
Together, we designed the overall architecture, high-level design, and project choice.
| Team Member | Areas of Contribution |
|---|---|
| Julia Husainzada | Designed package structure; implemented AuthService, Session, DataLoader, Catalog, Constants, exceptions, unit tests for 7 classes, ReadMe, and CLI flow (ConsoleUI, MusicSystemCLI) |
| Dushan Siriwardana | Developed UML diagram; Implemented Library, Artist, Podcast functionality; added playback features (Play, Pause, Stop); managed player state transitions with PlayerState enum; Arist unit test |
| Houmei Li | Implemented Searchable interface, User abstract class |
