🎵Music Library

📝Overview

Music Library is an innovative front-end application (SPA) designed for creating and managing music albums. This dynamic platform offers visitors an immersive experience to explore a vast catalog of albums. Upon registration, users gain access to personalized features, enabling them to craft their own album cards. Furthermore, album authors enjoy full control over their publications, with the ability to edit or delete entries at their convenience.

Mission Statement:

At Music Library, our mission is to provide a platform where music lovers can connect, discover, and share their passion for music. We strive to foster a vibrant community where creativity thrives and users can explore the vast and diverse world of music albums.

Join us on our journey to redefine the way people experience music. Whether you're a casual listener or a die-hard music enthusiast, there's something for everyone at Music Library.

Landing Page

✨ Features

  • Browse Albums: Explore a vast collection of albums with ease.
  • User Registration: Sign up with your email and password.
  • Create Albums: Users can create their own album cards.
  • Direct Content Management: Edit or remove your contributions at your discretion.

🛠️ Technologies Used

  • Frontend:

    • JavaScript JavaScript
    • HTML5 HTML
    • CSS3 CSS
  • Backend:

    • Node.js Node.js
    • Express.js Express.js
  • Testing:

    • Mocha Mocha
    • Chai Chai

Pages

This section provides an overview of the various pages in the application and the corresponding permissions required.

Home

The Home Page is accessible to all users without any specific permissions.

image

Dashboard

The Dashboard provides an overview of user-related information.

image

Details

The Details page displays additional information about the application.

image

Login

The Login page allows users to authenticate and access their accounts.

image

Register

The Register page allows users to create new accounts.

image

Add Album

The Add Album page allows authenticated users to add a new album, providing details such as Singer/Band, Album Name, Image URL, Release Date, Label, and Sales.

image

⚙️ Installation

Step 1: Clone the repository

https://github.com/ViktorKrumov/Software-Project-Documentation.git

Step 2: Install the the required resources

npm install

Step 3: Run the project

npm start

Unit Tests

The Music Library is equipped with a suite of unit tests designed to ensure the reliability and stability of the application. These tests cover a range of functionalities, from user authentication to album management.

Running Tests

To run the unit tests for the Harmony Hub application, follow these steps:

  1. Open the terminal in Visual Studio Code.

  2. Type in the following command:

    npm run test
    
  3. After a few seconds, different tests will appear in the terminal.

image

How to Access the API

To access the API documentation, open the following link in your browser:

http://localhost:3300/api-docs

The following API endpoints are available for interacting with the application

API Endpoints

  • GET /api/albums?order=release_date&dir=desc:

    • Retrieves a list of albums, sorted by release date in descending order.
  • GET /api/albums/{albumId}:

    • Fetches details for a specific album using its unique identifier.
  • POST /api/albums:

    • Adds a new album to the collection. Requires a JSON payload with album details. Example payload:
      {
        "artist": "John Doe",
        "title": "New Horizons",
        "coverUrl": "https://example.com/new_horizons_cover.jpg",
        "releaseDate": "June 1, 2024",
        "recordLabel": "Indie Sounds",
        "sales": "500,000 copies"
      }
  • PUT /api/albums/{albumId}:

    • Updates details of an existing album. Send a complete JSON payload with all album details, including any changes. Example payload mirrors the POST endpoint.
  • DELETE /api/albums/{albumId}:

    • Removes an album from the collection using its unique identifier.
  • POST /api/users/authenticate:

    • Authenticates a user and returns a session token. Requires a JSON payload with user credentials. Example payload:
      {
        "username": "user123",
        "password": "securepassword"
      }

image