This project is a REST service for a Home Library. Users can create, read, update, delete data about Artists, Tracks, and Albums, and add them to Favorites in their own Home Library. The service implements logging functionality, authentication and authorization with JWT (Access and Refresh tokens), and uses Docker for containerization. The data source for the application is a PostgreSQL database, and Prisma is used as the ORM.
- User signup and login with JWT tokens
- Access and refresh token management
- Secured resource access with tokens
- Detailed logging for events and errors
- Informative error responses for API calls
- PostgreSQL database for data persistence
- Prisma ORM for efficient database interactions
- Docker setup for multi-container application
- Simple deployment and portability
- Interactive API documentation at http://localhost:4000/doc/
- Comprehensive test suite for API endpoints and authentication
- OpenAPI documentation for API endpoints
- Git
- Node.js (20 LTS version)
- Docker
git clone {repository URL}
cd nodejs2024Q1-service
git checkout logging-auth
- Rename .env.example file to .env
npm install
npm run compose:up
Access the OpenAPI documentation at http://localhost:4000/doc/ for detailed API usage and exploration.
The default port for the application is 4000.
After application running open new terminal and enter:
To run all tests without authorization
npm run test
To run only one of all test suites
npm run test -- <path to suite>
To run all test with authorization
npm run test:auth
To run only specific test suite with authorization
npm run test:auth -- <path to suite>
npm run docker:audit
npm run lint
npm run format
Press F5 to debug.
For more information, visit: https://code.visualstudio.com/docs/editor/debugging