A chatbot that recommends TV series, with every fact and recommendation sourced from the TVDB API. Built with NestJS, the OpenAI Agents SDK and MongoDB.
- PLAN.md: scope and key decisions
- ARCHITECTURE.md: design and implementation status
- docs/TVDB_API.md: TVDB endpoints used and their quirks
Requires Node.js 24, Docker Compose, a TVDB API key and an OpenAI API key.
- Copy
.env.exampleto.envand fill it in (TVDB_PINmay be empty). SetMONGODB_USERNAMEandMONGODB_PASSWORDbefore the first start: MongoDB creates its user only when its data volume is new. - Run
npm install, thennpm start.
npm start runs MongoDB in Docker and the API locally in watch mode at
http://127.0.0.1:<PORT>/api. To run the API in Docker too, use
docker compose up instead (not both; they share the port), with
--build -V after changing dependencies.
There is no UI; use curl or Postman.
Authentication is not planned for now, so no token is needed. Every
request acts as the same placeholder user, id
00000000-0000-0000-0000-000000000000 (src/common/user-id.decorator.ts),
so all chats belong to that user.
curl -X POST http://127.0.0.1:8080/api/chat
# Your chats without messages, newest first; pass `nextCursor` back as
# `cursor` for the next page.
curl 'http://127.0.0.1:8080/api/chat?limit=20'
# One chat with all its messages, oldest first.
curl http://127.0.0.1:8080/api/chat/<chat id>
curl -X POST http://127.0.0.1:8080/api/chat/<chat id>/message \
-H 'Content-Type: application/json' \
-d '{ "text": "I liked the main cast of Breaking Bad, what else are they in?" }'The optional clientId (a UUID) in the message body makes retries safe:
resending it returns the saved answer.
npm test
npm run lint
npm run format:check