A minimal RESTful API for managing authors and books using NestJS, TypeORM, and PostgreSQL.
- CRUD operations for Authors and Books
- Data validation using DTOs (
class-validator) - Global error handling
- PostgreSQL or SQLite support
- E2E and unit testing using Jest & Supertest
git clone https://github.com/your-user/bookstore.git
cd bookstore
pnpm installcp .env.example .env
cp .env.test.example .env.testFill in your DB credentials in both files.
| Command | Description |
|---|---|
pnpm start:dev |
Run in development mode |
pnpm test:e2e |
Run end-to-end tests |
src/
├── app.module.ts
├── database/
└── modules/
├── author/
└── book/
test/
├── app.e2e-spec.ts
├── author/
│ └── author.e2e-spec.ts
└── book/
└── book.e2e-spec.ts
POST /authorsGET /authorsGET /authors/:idPATCH /authors/:idDELETE /authors/:id
POST /booksGET /booksGET /books/:idPATCH /books/:idDELETE /books/:id
pnpm test:e2eMake sure .env.test is properly configured.