A NestJS-based REST API for managing a music library with artists, albums, tracks, and favorites.
-
Clone the repository
git clone git@github.com:dashque/nodejs2025Q2-service.git git checkout dev cd nodejs2025Q2-service -
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env
npm run start:devStarts the server with hot reload on file changes.
npm run build
npm run start:prodnpm run start:debugAfter starting, access the OpenAPI documentation at: http://localhost:4000/doc/
npm run start:dev
npm run testRuns all e2e tests without authentication.
npm run test -- test/artists.e2e.spec.tsnpm run test:watch| 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 |
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
# Lint and auto-fix issues
npm run lint
# Format code
npm run formatsrc/
├── 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