A task management backend built with Node.js, TypeScript, and NestJS.
This project is a backend application for managing tasks and projects. It started as a simple Node.js HTTP server and evolved into a full NestJS application with a modular architecture.
- Node.js
- TypeScript
- NestJS
- dotenv
- fs (file system)
- Jest (testing)
TaskFlow uses PostgreSQL as its database for the following reasons:
- TaskFlow has structured relational data: Users own Projects, Projects have Tasks, and Tasks are optionally assigned to Users. This relational structure is a perfect fit for a SQL database.
- PostgreSQL enforces data integrity through foreign keys and constraints, which matters for a task management system where relationships between data must stay consistent.
- PostgreSQL is reliable, open source, and widely used in production backends.
- TypeORM has excellent support for PostgreSQL, making it easy to define entities and relationships directly in TypeScript using decorators like @OneToMany and @ManyToOne.
- Unlike NoSQL databases such as MongoDB, which are better suited for flexible or unstructured data, PostgreSQL's schema and relational model match TaskFlow's needs more closely.
taskflow-backend/ ├── src/ │ ├── server.ts │ ├── readUsers.ts │ ├── interfaces/ │ │ └── types.ts │ └── data/ │ ├── mock-users.json │ ├── mock-projects.json │ └── mock-tasks.json └── taskflow-nest/ ├── src/ │ ├── main.ts │ ├── app.module.ts │ ├── app.controller.ts │ ├── app.service.ts │ └── projects/ │ ├── projects.module.ts │ ├── projects.controller.ts │ └── projects.service.ts └── README.md
The first part of this project is a simple HTTP server built using the raw Node.js http module and TypeScript.
- Defines interfaces for User, Project, and Task
- Reads mock data from JSON files using the fs module
- Serves the data through HTTP endpoints
- Handles missing routes with a 404 error response
- Uses dotenv to load the PORT from a .env file
| Method | Route | Description |
|---|---|---|
| GET | /projects | Returns all projects |
| GET | /users | Returns all users |
| GET | /* | Returns 404 error |
# From taskflow-backend folder
npm run devThe second part rebuilds the backend using NestJS, a structured framework that organizes code into modules, controllers, and services.
- Sets up a NestJS project with TypeScript
- Creates a ProjectsModule with a controller and service
- Serves project data through clean REST endpoints
- Handles errors with proper HTTP status codes
- Includes unit tests for all controllers and services
# From taskflow-nest folder
cd taskflow-nest
npm run start:dev| Method | Route | Description |
|---|---|---|
| GET | / | Returns Hello World |
| GET | /projects | Returns all projects |
| GET | /projects/:id | Returns one project by id |
| GET | /projects/99 | Returns 404 if not found |
See the README inside the taskflow-nest folder: taskflow-backend/taskflow-nest/README.md
# From taskflow-nest folder
cd taskflow-nest
npm run test- AppController tests
- ProjectsController tests
- ProjectsService tests
- All 9 tests pass
All features are developed on the develop branch and merged into main via Pull Requests with code reviews.