Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Secure Task Management API

A secure REST API built with Spring Boot for task management and user authentication.

Features

  • User registration and login
  • JWT-based authentication
  • Passwords hashed with BCrypt
  • Full CRUD operations for tasks
  • Users can only access their own tasks (authorization, not just authentication)
  • MySQL persistence

Technologies

  • Java 21
  • Spring Boot
  • Spring Security
  • Spring Data JPA
  • MySQL
  • JWT
  • Maven

Live Demo

https://task-management-api-u91w.onrender.com

This is a REST API with no frontend — use Postman or curl to interact with it. Note: free-tier hosting means the first request after inactivity may take ~30 seconds to wake up.

Running Locally

Create a MySQL database, then set the required environment variables:

export DB_URL="jdbc:mysql://localhost:3306/taskmanager"
export DB_USERNAME="root"
export DB_PASSWORD="your-password"
export JWT_SECRET="$(openssl rand -base64 32)"

./mvnw spring-boot:run

The API will run at http://localhost:8080.

API Endpoints

Authentication

  • POST /auth/register
  • POST /auth/login

Tasks

  • GET /tasks
  • GET /tasks/{id}
  • POST /tasks
  {
    "title": "Finish project"
  }
  • PUT /tasks/{id}
  • DELETE /tasks/{id}

Protected endpoints require a valid JWT token.

Testing

The API can be tested using Postman. After logging in, copy the JWT token and use:

Auth → Bearer Token → Paste Token

About

A task management REST API built with Spring Boot, JWT authentication, and MySQL.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages