A NestJS application for managing a library system with book borrowing functionality.
- Members can borrow books with conditions
- Members can return books
- Check available books
- Check member information and borrowed books
- NestJS with TypeScript
- TypeORM with SQLite
- Swagger for API documentation
- Jest for unit testing
This project follows DDD principles with the following structure:
- Domain: Contains entities, value objects, and domain services
- Application: Contains use cases and application services
- Infrastructure: Contains repositories, database configurations, and external services
- Interfaces: Contains controllers, DTOs, and presenters
- Node.js (v14 or higher)
- npm (v6 or higher)
- Clone the repository
git clone https://github.com/bagaspra16/library-management-api.git
cd library-management-api- Install dependencies
npm install- Run the application
npm run start:dev- Access the Swagger documentation
http://localhost:3000/api
GET /books: Get all booksGET /members: Get all membersPOST /borrowings: Borrow a bookPOST /borrowings/return: Return a book
# Run unit tests
npm run test
# Run test coverage
npm run test:cov
# Run end-to-end tests
npm run test:e2e