Skip to content

Spring Boot REST API with JWT authentication, MySQL, and Docker — Task Manager project.

License

Notifications You must be signed in to change notification settings

harii-dev26/task-manager-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java Spring Boot Maven Docker License

Task Manager API

A Spring Boot-based RESTful Task Management System that enables users to securely manage tasks — create, update, delete, and track progress — with JWT-based authentication, database persistence, and container-ready architecture.


Features

User Authentication & Authorization

  • Secure login/register using Spring Security + JWT
  • Role-based access control for users

Task Management APIs

  • Create, update, delete, and list tasks
  • Each user can manage their own tasks independently

Persistence & ORM

  • Data persisted via Spring Data JPA (Hibernate)
  • Currently runs on H2 in-memory database (can easily switch to MySQL)

Container-Ready

  • Includes Dockerfile and docker-compose.yml for one-command deployment
  • Stateless architecture for cloud scalability

Developer Tools

  • Live H2 console for debugging
  • In-memory database auto-schema creation
  • Easily extensible for PostgreSQL or MySQL

Tech Stack

Layer Technology
Backend Spring Boot 2.7.x
Security Spring Security, JWT
Database H2 (In-Memory) / MySQL (switchable)
ORM Hibernate / JPA
Build Tool Maven
Containerization Docker
Language Java 11
Testing JUnit (Spring Boot Starter Test)

Architecture Overview

                        ┌──────────────────────────────┐
                        │        REST Controller        │
                        │ (Handles API requests & maps) │
                        └──────────────┬────────────────┘
                                       │
                                       ▼
                        ┌──────────────────────────────┐
                        │          Service Layer        │
                        │  (Business logic, validation) │
                        └──────────────┬────────────────┘
                                       │
                                       ▼
                        ┌──────────────────────────────┐
                        │        Repository Layer       │
                        │ (CRUD operations via JPA/HQL) │
                        └──────────────┬────────────────┘
                                       │
                                       ▼
                        ┌──────────────────────────────┐
                        │     H2 / MySQL Database       │
                        │ (Data persistence & relations)│
                        └──────────────────────────────┘
                                       ▲
                                       │
                        ┌──────────────────────────────┐
                        │  JWT Auth + Spring Security   │
                        │ (Access control, token verify)│
                        └──────────────────────────────┘


**## API Endpoints Overview** 

| Method | Endpoint             | Description                          |
| :----- | :------------------- | :----------------------------------- |
| POST   | `/api/auth/register` | Register a new user                  |
| POST   | `/api/auth/login`    | Authenticate user and return JWT     |
| GET    | `/api/tasks`         | Get all tasks for the logged-in user |
| POST   | `/api/tasks`         | Create a new task                    |
| PUT    | `/api/tasks/{id}`    | Update an existing task              |
| DELETE | `/api/tasks/{id}`    | Delete a task                        |


**POST** `/api/auth/login`

```json
{
  "username": "hariish",
  "password": "password123"
}


{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}




About

Spring Boot REST API with JWT authentication, MySQL, and Docker — Task Manager project.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published