Skip to content

a2rp/backend-task-manager-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

backend-task-manager-api

Backend API for task manager CRUD with status, priority, due date, and user ownership using JWT and HttpOnly cookies.

Features

  • Register user
  • Login user
  • Logout user
  • Create task
  • Get all tasks (user-specific)
  • Get single task (user-specific)
  • Update task (user-specific)
  • Delete task (user-specific)
  • Task status support
  • Task priority support
  • Due date support
  • Protected routes
  • JWT authentication
  • HttpOnly cookie based auth
  • MongoDB with Mongoose

Tech Stack

  • Node.js
  • Express.js
  • MongoDB
  • Mongoose
  • JWT
  • bcryptjs
  • cookie-parser

Environment Variables

Create a .env file:

PORT=1203
MONGO_URI=mongodb://127.0.0.1:27017/backend_task_manager_api
JWT_SECRET=your_secret_key
NODE_ENV=development

Install

npm install

Run

npm run dev

API Endpoints

Auth

  • POST /api/auth/register
  • POST /api/auth/login
  • POST /api/auth/logout

Tasks

  • POST /api/tasks
  • GET /api/tasks
  • GET /api/tasks/:id
  • PUT /api/tasks/:id
  • DELETE /api/tasks/:id

Task Fields

  • title
  • description
  • status → pending, in-progress, completed
  • priority → low, medium, high
  • dueDate

Notes

  • Each task belongs to a specific user
  • Users can only access their own tasks
  • Authentication via HttpOnly cookies
  • Use withCredentials: true in frontend

Follow Me

About

Secure backend API for task manager CRUD with status, priority, due date, and user ownership using Node.js, Express, MongoDB, JWT, and HttpOnly cookies.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors