Backend API for searching public domain books with pagination, full-text filtering, and production-ready deployment using Docker + CI/CD.
-
Backend (Render)
https://public-domain-library-nestjs-api-latest.onrender.com -
Frontend (Vercel)
https://public-domain-books-iota.vercel.app/ -
Swagger Docs
https://public-domain-library-nestjs-api-latest.onrender.com/api
- NestJS (TypeScript)
- Prisma ORM
- PostgreSQL (Aiven)
- Swagger (OpenAPI)
- Docker
- GitHub Actions (CI/CD)
- Docker Hub (image registry)
- Render (deployment)
These are required in production:
DATABASE_URL=your_postgres_connection
APP_URL=https://your-render-url.onrender.com
FRONTEND_URL=https://your-frontend.vercel.app
PORT=3000
GET /health
Response:
{
"status": "up"
}
GET /books
- search (string): Search in title + authors
- page (number, default=1)
- size (number, default=20)
GET /books?search=tolstoy&page=1&size=20
{
"items": [
{
"id": 2487,
"title": "War and Peace",
"authors": "Tolstoy, Leo, graf; Maude, Aylmer; Maude, Louise",
"subjects": "Historical fiction; War stories..."
}
],
"total": 4,
"page": 1,
"size": 20,
"pages": 1
}
- Case-insensitive
- Tokenized search ("fairy tales" → ["fairy", "tales"])
- Matches title and authors
- Uses AND across tokens
Example:
GET /books search="fairy tales" page=5 size=20 results=20 total=103
Visible in Render logs.
- Runs every 10 minutes
- Calls /health
- Requires APP_URL
Image:
carlosm1/public-domain-library-nestjs-api:latest
On push to main:
- Build Docker image
- Push to Docker Hub
- Trigger Render deploy
npm install
npm run start:dev
http://localhost:3000
http://localhost:3000/api
src/
modules/
books/
health/
prisma/
self-ping.service.ts
app.module.ts
main.ts