docker compose up --build -d
Delete docker containers and volumes
and then run the docker compose up --build -d
CREATE TABLE IF NOT EXISTS users (
id SERIAL PRIMARY KEY,
name VARCHAR(255) NOT NULL,
email VARCHAR(255) UNIQUE NOT NULL
);
id SERIAL PRIMARY KEY,
title VARCHAR(255) NOT NULL,
description TEXT,
user_id INTEGER REFERENCES users(id) ON DELETE SET NULL,
status VARCHAR(50) CHECK (status IN ('Pending', 'In Progress', 'Completed')) DEFAULT 'Pending',
due_date DATE,
created_at TIMESTAMP DEFAULT NOW(),
updated_at TIMESTAMP DEFAULT NOW()
);
http://localhost:8080/docs/index.html
- Create Task: Endpoint to create a new task. A task must have a title, description, assigned user, status (Pending, In Progress, Completed), and due date.
- Get Tasks: Endpoint to retrieve all tasks or filter tasks by status, user, or due date.
- Update Task: Endpoint to update task details (e.g., change status, description, etc.).
- Delete Task: Endpoint to delete a task.
'http://localhost:8080/v1/tasks'
-H 'accept: application/json'
'http://localhost:8080/v1/tasks/1'
-H 'accept: application/json'
'http://localhost:8080/v1/tasks'
-H 'accept: application/json'
-H 'Content-Type: application/json'
-d '{
"description": "test",
"due_date": "2024-09-29T18:25:43.511Z",
"status": "Pending",
"title": "test",
"user_id": 1
}'
'http://localhost:8080/v1/tasks'
-H 'accept: application/json'
-H 'Content-Type: application/json'
-d '{
"description": "Description",
"id": 1,
"status": "Pending",
"title": "Title"
}'
'http://localhost:8080/v1/tasks/1'
-H 'accept: application/json'
- Create User: Endpoint to create a new user. A user has a name and email
curl -X 'GET'
'http://localhost:8080/v1/user'
-H 'accept: application/json'
curl -X 'GET'
'http://localhost:8080/v1/user/rkpundhir90%40gmail.com'
-H 'accept: application/json'
curl -X 'POST' \
'http://localhost:8080/v1/user'
-H 'accept: application/json'
-H 'Content-Type: application/json'
-d '{
"email_id": "rkpundhir90@gmail.com",
"name": "Rohit Pundhir"
}'