Skip to content

mongodb-developer/task-manager-with-categories

Repository files navigation

Task Manager with Categories

A simple task manager built with Node.js, Express, and the MongoDB Node driver. No Mongoose, no frontend framework, just a clean API and a lightweight vanilla JS UI.

What it does

  • Basic CRUD API for tasks
  • Tasks have categories: Work, Personal, Study, Other
  • Filter tasks by category
  • Simple frontend served from the same app
  • Input validation and basic security (helmet, size limits)
  • Indexed category field for faster queries
  • Graceful startup/shutdown handling
  • Tests using Node's built-in test runner

Getting started

git clone https://github.com/<your-username>/task-manager-with-categories.git
cd task-manager-with-categories
npm install

cp .env.example .env
# add your MongoDB connection string

npm run dev

Environment variables

  • MONGO_URI (required) – your MongoDB connection string
  • DB_NAME (optional) – defaults to taskmanager
  • PORT (optional) – defaults to 3000

API overview

  • GET /tasks – list tasks
  • GET /tasks?category=Work – filter by category
  • POST /tasks – create
  • PUT /tasks/:id – update
  • DELETE /tasks/:id – delete

Errors return:

{ "error": "message" }

Running tests

npm test

Notes

This is meant to be simple and production-ready enough to build on. If you're deploying it for real use, you'll probably want to add auth, rate limiting, and stricter security headers.

About

A Node.js and MongoDB REST API for managing tasks with categories, featuring validation, filtering, and a lightweight vanilla JavaScript frontend.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors