Skip to content

About

This repo holds the resources and codes that were a part of MK Code Club backend course.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

Todo API banner

Node.js Express MongoDB dotenv

A REST API for managing todo items, built as part of the backend development course on the MK Code Club YouTube channel.

Overview

This project provides a simple, clean backend for creating, reading, updating, and deleting todo items with a MongoDB-powered data layer.

Features

  • Create and store todo items
  • Fetch all todos or a single item by ID
  • Update todo status and content
  • Delete records from the database
  • Built-in health check endpoint
  • Automatic timestamps for creation and updates

Stack

  • Node.js and Express
  • MongoDB with Mongoose
  • dotenv for environment configuration

Getting started

  1. Install dependencies:

    npm install
  2. Create a .env file in the project root:

    PORT=3000
    MONGO_URI=mongodb://localhost:27017/todoDB

    Replace the MongoDB URI with your local or hosted database connection string.

  3. Start the development server:

    npm run dev

The API runs at http://localhost:3000 (or the port set in .env). Send JSON request bodies with the Content-Type: application/json header.

API

Base path: /api/todos

Method Endpoint Description Body
POST /api/todos Create a todo { "title": "Learn Express" }
GET /api/todos Get all todos —
PUT /api/todos/:id Update a todo { "title": "Learn Express", "isDone": true }
DELETE /api/todos/:id Delete a todo —
GET /api/health-check Check server status —

Each todo has a required title, an isDone flag (defaults to false), and automatically managed createdAt and updatedAt timestamps.

🎓 Course

Follow along with the backend development lessons on MK Code Club.


Project status

About

This repo holds the resources and codes that were a part of MK Code Club backend course.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages