This is the backend application for managing tasks. It provides endpoints for user registration, authentication, and task management.
To install and run the application, follow these steps:
-
Clone this repository to your local machine:
git clone https://github.com/atul-007/task_management_backend.git
-
Navigate to the project directory:
cd task_management_backend
-
Build the application:
go build -tags netgo -ldflags '-s -w' -o app
-
Run the application:
./app
The application will be accessible at http://localhost:8080
.
- Route:
POST /api/register
- Payload:
{ "username": "example_user", "password": "example_password" }
- Description: Registers a new user with the provided username and password.
- Route:
POST /api/login
- Payload:
{ "username": "example_user", "password": "example_password" }
- Description: Logs in a user with the provided username and password. Returns a JWT token upon successful login.
- Route:
GET /api/tasks
- Description: Retrieves tasks for the authenticated user.
- Route:
POST /api/tasks
- Payload:
{ "title": "Example Task", "priority": "High", "due_date": "2024-05-15T12:00:00Z", "completed": false }
- Description: Creates a new task for the authenticated user.
- Route:
PUT /api/tasks/:id
- Payload:
{ "title": "Updated Task", "priority": "Low", "due_date": "2024-05-20T12:00:00Z", "completed": true }
- Description: Updates an existing task for the authenticated user.
- Route:
DELETE /api/tasks/:id
- Description: Deletes an existing task for the authenticated user.
Deployed Link:https://task-management-backend-3boh.onrender.com