Tasks API is a RESTful API built with Node.js, Express.js, and TypeScript for managing user tasks. Each task includes a title, description, status, creation, and modification dates. It allows users to perform CRUD operations on tasks, filter tasks by status, change the status of tasks, and calculate the time elapsed since a task was created.
- Create a new task
- Retrieve all tasks
- Retrieve a specific task by ID
- Update a task (title and description)
- Delete a task by ID
- Filter tasks by status (pending, in-progress, completed, deleted)
- Change the status of a task
- Calculate the number of days elapsed since a task's creation
- Node.js
- Express.js
- TypeScript
- PostgreSQL with TypeORM
- Docker
- Jest
- Swagger
Ensure that Docker is installed and running on your system. You can download Docker from the official Docker website or follow the installation instructions in the Docker documentation.
-
Clone the repository:
git clone https://github.com/delucajuan/tasks-api.git cd tasks-api
-
Create a
.env
file in the project root and add the necessary environment variables (you can reference the providedenv.example
file):# Application Port PORT=3000 # Database Configuration DB_PORT=5432 DB_USERNAME=user DB_PASSWORD=123456 DB_NAME=tasks
-
Build and run the Docker containers:
docker-compose up
-
The API will be reachable at http://localhost:3000/api/ and the documentation at http://localhost:3000/api-docs/. If a different port is set in the
.env
file, replace 3000 with the configured port.
To run the unit tests, use the following command:
docker-compose run --rm test
Additionally, if you want to develop or customize the application, install local dependencies:
npm install
When you are finished working with the application, stop and remove the Docker containers by running:
docker-compose down
Developed by Juan De Luca.