Get the FREE Ultimate OpenClaw Setup Guide →

nestjs-todo-playground

A NestJS playground for experimenting with a Todo API, MongoDB and Redis integration. Includes Docker support for easy local development and testing.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio alakkaya-nestjs-todo-playground docker compose up

How to use

NestJS Todo Playground is a simple backend demo that exposes a modular NestJS application with MongoDB (via Mongoose) for storing Todo items and user data. It includes authentication using JWT tokens, DTO validation, and structured error handling. The project ships with Docker support to spin up the full stack locally, including the database, making it easy to experiment with the API endpoints and the test suite. Use the provided docker setup to run the application and connect to the API to create users, authenticate, and manage todos through the REST endpoints.

To run, start the docker composition so all services boot together. Once running, you can interact with the API to register users, sign in to obtain a JWT, and then create, read, update, or delete todos. The test suite includes integration tests that exercise authentication, user creation, and Todo operations, which helps you verify behavior against the expected API contracts.

How to install

Prerequisites:

  • Docker and Docker Compose installed on your machine
  • Node.js and npm (optional for local testing outside Docker)
  1. Install and run the project with Docker:
  • Ensure you are in the project root.
  • Start the services using Docker Compose: docker compose up
  • Wait for the services to initialize (you should see logs indicating MongoDB, NestJS app, etc.).
  1. Optional: Run tests locally (without Docker):
  • Install dependencies: npm install
  • Run tests: npm run test
  1. Clean up:
  • Stop the services: docker compose down
  • Remove volumes if needed: docker system prune -f (optional)

Notes:

  • The MongoDB connection string and other runtime configurations are typically provided via environment variables inside the docker configuration. If you modify environment settings, ensure the NestJS app can reach MongoDB at the configured host/port.

Additional notes

Tips and common considerations:

  • If you encounter MongoDB connection issues, verify that Docker Compose has started the MongoDB service and that the NestJS app is configured to connect to the correct host (usually mongodb://mongo:27017 or similar within the docker network).
  • The project uses JWT-based authentication; to access protected routes, first register a user and then authenticate to obtain a token that must be supplied in the Authorization header as Bearer <token>.
  • DTO validation is enforced via class-validator, so requests that omit required fields or provide invalid data will return detailed validation errors.
  • If tests fail due to environment differences, ensure Docker has enough memory and that network access is available for MongoDB to start properly.
  • The docker setup includes ready-to-use tests; you can run npm run test inside the container environment or locally if you install dependencies and mimic the same environment.

Related MCP Servers

Sponsor this space

Reach thousands of developers