Skip to content

Repository files navigation

Home Library Service

A NestJS-based REST API for managing a music library with artists, albums, tracks, and favorites.

Installation

  1. Clone the repository

    git clone git@github.com:dashque/nodejs2025Q2-service.git
    git checkout dev
    cd nodejs2025Q2-service
  2. Install dependencies

    npm install
  3. Set up environment variables

    cp .env.example .env

Running the Application

Development Mode

npm run start:dev

Starts the server with hot reload on file changes.

Production Mode

npm run build
npm run start:prod

Debug Mode

npm run start:debug

After starting, access the OpenAPI documentation at: http://localhost:4000/doc/

Testing

Run All Tests

npm run start:dev
npm run test

Runs all e2e tests without authentication.

Run Specific Test Suite

npm run test -- test/artists.e2e.spec.ts

Watch Mode

npm run test:watch

Available Scripts

Script Description
npm start Start in production mode
npm run start:dev Start in development mode with watch
npm run start:debug Start in debug mode
npm run build Build the application
npm run test Run all tests
npm run test:auth Run tests with authentication
npm run test:refresh Run refresh token tests
npm run test:watch Run tests in watch mode
npm run test:cov Generate coverage report
npm run lint Run ESLint with auto-fix
npm run format Format code with Prettier

API Endpoints

The service provides REST endpoints for:

  • Artists - CRUD operations
  • Albums - CRUD operations with artist relationships
  • Tracks - CRUD operations with artist and album relationships
  • Favorites - Manage favorite artists, albums, and tracks
  • Users - User management

Development

Code Quality

# Lint and auto-fix issues
npm run lint

# Format code
npm run format

Project Structure

src/
├── artists/          # Artist module
├── albums/           # Album module
├── tracks/           # Track module
├── favorites/        # Favorites module
├── auth/             # Authentication module
├── users/            # User module
└── utils/            # Shared utilities

test/                 # E2E tests
├── auth/             # Auth tests
├── artists.e2e.spec.ts
├── albums.e2e.spec.ts
├── tracks.e2e.spec.ts
├── favorites.e2e.spec.ts
└── refresh/          # Refresh token tests

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages