Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Task Management System

A full-stack task management application built with Node.js, Next.js, and PostgreSQL.

Track

Track A — Full-Stack Engineer (Backend API + Web Frontend)

Tech Stack

Backend

  • Node.js + TypeScript
  • Express.js
  • Prisma ORM + PostgreSQL
  • JWT (Access + Refresh tokens)
  • bcryptjs, Zod, express-rate-limit

Frontend

  • Next.js 14 (App Router) + TypeScript
  • Tailwind CSS
  • Axios (with interceptors)
  • React Hook Form + Zod
  • react-hot-toast

Prerequisites

  • Node.js v18+
  • pnpm
  • PostgreSQL

Setup Instructions

1. Clone the repository

git clone cd task-management

2. Backend setup

cd backend pnpm install cp .env.example .env

Edit .env with your database credentials and JWT secrets

3. Run database migrations

pnpm dlx prisma migrate dev pnpm dlx prisma generate

4. Start backend

pnpm dev

5. Frontend setup (new terminal)

cd frontend pnpm install cp .env.example .env.local

Edit .env.local with NEXT_PUBLIC_API_URL=http://localhost:5000/api

6. Start frontend

pnpm dev

API Endpoints

Auth

Method Endpoint Auth Description
POST /api/auth/register No Register new user
POST /api/auth/login No Login
POST /api/auth/refresh No Refresh access token
POST /api/auth/logout No Logout
GET /api/auth/me Yes Get current user

Tasks

Method Endpoint Auth Description
GET /api/tasks Yes Get all tasks (paginated)
POST /api/tasks Yes Create task
GET /api/tasks/:id Yes Get single task
PATCH /api/tasks/:id Yes Update task
DELETE /api/tasks/:id Yes Delete task
POST /api/tasks/:id/toggle Yes Toggle task status

Query Parameters for GET /api/tasks

  • page (default: 1)
  • limit (default: 6)
  • status: PENDING | IN_PROGRESS | COMPLETED
  • search: string (searches by title)

Design Decisions

  • Access token stored in memory (not localStorage) for XSS protection
  • Refresh token stored in HTTP-only cookie for CSRF protection
  • Axios interceptors handle silent token refresh automatically
  • useRef pattern in useTasks hook prevents infinite re-fetch loops
  • Prisma adapter pattern used for better connection pool control

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages