A full-stack Task Manager application using NestJS for the backend and Next.js for the frontend.
- NestJS handles task creation, updating, deletion, and retrieval from a PostgreSQL database.
- Next.js displays tasks in a user-friendly frontend interface.
taskmanager/be– Backend (NestJS)taskmanager/fe– Frontend (Next.js)
Before starting the NestJS server, run the following SQL to create the tasks table in your PostgreSQL database:
CREATE TABLE tasks (
id INTEGER DEFAULT nextval('main.table_name_id_seq'::regclass) NOT NULL PRIMARY KEY,
title VARCHAR,
completed SMALLINT,
createdat TIMESTAMP DEFAULT now() NOT NULL
);Fetch all tasks.
Example: http://localhost:3000/api/tasks
Create a new task.
Request Body:
{
"title": "example99"
}Update a task by ID.
Example: http://localhost:3000/api/tasks/4
Request Body:
{
"title": "example4",
"completed": 1
}Delete a task by ID.
Example: http://localhost:3000/api/tasks/4
Navigate to the backend directory:
cd taskmanager/be
npm install
npm run start:devNavigate to the frontend directory:
cd taskmanager/fe
npm install
npm run devOnce both servers are running:
- Frontend: http://localhost:3001
- Backend API: http://localhost:3000/api/tasks