Tech Stack | Task Manager API | License
A simple RESTful API for managing tasks (CRUD + bulk import via CSV).
- Node.js
- Fastify
- Postgresql
- Docker
- File handling for CSV import
- Create a task
- List all tasks (with optional search)
- Update a task by
id
- Delete a task by
id
- Mark/unmark a task as completed
- Import tasks in bulk using a CSV file
Each task has the following properties:
Field | Type | Description |
---|---|---|
id |
string | Unique identifier for the task |
title |
string | Task title |
description |
string | Detailed task description |
completed_at |
datetime/null | Timestamp when the task was completed (initially null ) |
created_at |
datetime | Timestamp when the task was created |
updated_at |
datetime | Timestamp when the task was last updated |
Create a new task.
Request Body:
{
"title": "Task Title",
"description": "Task Description"
}
Behavior:
id
,created_at
, andupdated_at
are auto-generated.completed_at
is initially set tonull
.
List all tasks. Supports optional filtering by title
and/or description
.
Query Params (optional):
?title=example&description=details
Update a task's title
and/or description
.
Request Body:
{
"title": "Updated Title",
"description": "Updated Description"
}
Rules:
- You can update either
title
,description
, or both. updated_at
is updated on change.- Must validate the task exists before updating.
Delete a task by id
.
Rules:
- Validate task existence before deletion.
Toggle a task’s completion status.
Behavior:
- If
completed_at
isnull
, set it to the current timestamp. - If
completed_at
has a value, reset it tonull
.
Bulk import tasks from a CSV file.
CSV Format:
id,title,description
1,Task 1,Description for Task 1
2,Task 2,Description for Task 2
...
Behavior:
- All imported tasks follow the same creation rules as
POST /tasks
.
# Clone the repository
git clone https://github.com/larissadantier/server-tasks.git
# Install all packages
- Npm
npm install
- Yarn
yarn install
- Pnpm
pnpm install
After all this, you're ready to run the project, just enter the command:
- Docker
pnpm docker:up
- Npm
npm run dev
- Yarn
yarn dev
- Pnpm
pnpm dev
- Bun
bun dev
All done! Now your application will run 😄
You can use tools like Postman, Insomnia or Yaak to test each route.
This project is under the MIT license. See the LICENSE file for more details.
Developed por Larissa Dantier 🚀
Contact us 👏