Skip to content

Manish-Royan/Spring-Boot-Todo-Application

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌸 Spring-Boot Todo Application

Aesthetic task manager built with Spring Boot 4, Thymeleaf, and MySQL β€” designed to make staying organized feel a little more bloomy.

Java Spring Boot License

MixCollage-17-Jun-2026-12-47-AM-8060


✨ Overview

Spring-Boot Todo application is a server-rendered task management web app with a kawaii aesthetic. It features priority levels, filterable task views, a live progress bar, inline editing, and a soft pastel UI with falling sakura petals, a cat mascot, and friendly toast notifications.

Built as a learning project to demonstrate clean Spring Boot architecture β€” controller / service / repository layering, DTOs, bean validation, centralized exception handling, and proper HTTP method semantics β€” wrapped in a thoughtful, animated UI.


🌷 Features

Category What you get
Task management Create, toggle, edit, and delete tasks
Priority levels Low 🌱 Β· Medium 🌸 Β· High πŸ”₯ with colored badges
Filter tabs All / Active / Done β€” with live counts per tab
Progress tracking Live progress bar with shimmer + completion celebration
Bulk actions One-click "Clear completed" with confirmation
Inline edit Modal dialog prefilled with current task data
Toast notifications Friendly feedback after every action
Cute aesthetic Sakura Kawaii palette, cat mascot 🐱, falling petals, heartbeat footer
Responsive Mobile-first layout, works from 360px upward
Accessible ARIA labels, keyboard-navigable modal (ESC to close), prefers-reduced-motion support

πŸ› οΈ Tech Stack

Layer Technology
Language Java 17
Framework Spring Boot 4.1.0
Web Spring MVC + Thymeleaf
Persistence Spring Data JPA Β· Hibernate
Database MySQL 8+
Validation Bean Validation (JSR-380)
Build tool Maven 3.9+ (wrapper included)
Frontend Vanilla CSS + JS (no framework), Bootstrap Icons, Google Fonts
Boilerplate Lombok

πŸ“ Project Structure

src/main/java/com/bishwakarma/learning/todoapp/
β”œβ”€β”€ TodoAppApplication.java         ← Spring Boot entry point
β”œβ”€β”€ controller/
β”‚   └── TodoController.java         ← HTTP routing (GET/POST/PATCH/DELETE)
β”œβ”€β”€ service/
β”‚   └── TodoService.java            ← Business logic, @Transactional boundary
β”œβ”€β”€ repository/
β”‚   └── TodoRepository.java         ← Spring Data JPA + custom queries
β”œβ”€β”€ entity/
β”‚   └── Todo.java                   ← JPA entity with timestamps + priority
β”œβ”€β”€ dto/
β”‚   β”œβ”€β”€ TodoRequest.java            ← Validated input payload
β”‚   └── TodoResponse.java           ← Read-only view DTO
β”œβ”€β”€ enums/
β”‚   └── Priority.java               ← LOW / MEDIUM / HIGH with UI metadata
└── exception/
    β”œβ”€β”€ TodoNotFoundException.java
    └── GlobalExceptionHandler.java ← @ControllerAdvice

src/main/resources/
β”œβ”€β”€ application.properties          ← Env-var-aware configuration
β”œβ”€β”€ static/
β”‚   β”œβ”€β”€ css/style.css               ← Sakura Kawaii theme
β”‚   └── js/app.js                   ← Edit-modal interactions
└── templates/
    β”œβ”€β”€ index.html                  ← Main Thymeleaf view
    └── error.html                  ← Friendly error fallback

πŸš€ Quick Start

Prerequisites

  • JDK 17+
  • Maven 3.9+ (or use the bundled ./mvnw)
  • MySQL 8+ running on localhost:3306

1. Set up the database

The JDBC URL includes createDatabaseIfNotExist=true, so you only need a user with database-creation privileges:

CREATE USER IF NOT EXISTS 'todo_user'@'%' IDENTIFIED BY 'TodoApp_Password2026!';
GRANT ALL PRIVILEGES ON *.* TO 'todo_user'@'%';
FLUSH PRIVILEGES;

2. Run the app

https://github.com/Manish-Royan/Spring-Boot-Todo-Application.git
cd Spring-Boot-Todo-Application-main
./mvnw spring-boot:run

Open http://localhost:8080 β€” you should see the Spring-Boot Todo UI 🌸

3. Override credentials (optional)

The defaults work out-of-the-box for local dev. For a different setup, set environment variables:

export TODO_DB_URL='jdbc:mysql://localhost:3306/todo_db?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC&createDatabaseIfNotExist=true'
export TODO_DB_USER='your_user'
export TODO_DB_PASSWORD='your_password'
./mvnw spring-boot:run

4. Build a JAR (optional)

./mvnw clean package
java -jar target/todoApp-1.0.0.jar

πŸ—ΊοΈ HTTP Routes

Method URL Purpose
GET / Home page (supports ?filter=all|active|completed)
POST /todos Create a new todo
PATCH /todos/{id}/toggle Toggle the done flag
PATCH /todos/{id} Edit title / priority
DELETE /todos/{id} Delete a single todo
DELETE /todos/completed Bulk-clear completed todos

Browsers only support GET/POST natively β€” PATCH and DELETE go through a hidden _method input. The filter is enabled via spring.mvc.hiddenmethod.filter.enabled=true in application.properties.


🎨 Design Tokens

The Sakura Kawaii palette is defined as CSS custom properties at the top of style.css:

Token Colour Used for
--pink-50 #fff5f8 Page background base
--pink-200 #ffd6e4 Borders, soft accents
--pink-400 #ff8fab Primary accent (buttons)
--pink-500 #f569a0 Headings, strong accent
--peach #ffb7a3 Secondary accent (progress gradient)
--cream #fffaf3 Page background secondary
--mint-deep #7ec8a3 Completed state

Fonts: Pacifico (logo), Quicksand (headings), Nunito (body) β€” all from Google Fonts.


πŸ§ͺ Testing

./mvnw test

The smoke test (TodoAppApplicationTests) uses H2 in-memory so it doesn't require a running MySQL β€” the test profile swaps the datasource via @TestPropertySource.


πŸ“ Architecture Notes

This project follows the classic 3-layer Spring architecture:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Controller  (HTTP routing, view rendering)              β”‚
β”‚      ↓                                                   β”‚
β”‚  Service     (business logic, @Transactional)            β”‚
β”‚      ↓                                                   β”‚
β”‚  Repository  (Spring Data JPA, custom queries)           β”‚
β”‚      ↓                                                   β”‚
β”‚  Database    (MySQL)                                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  • DTOs (TodoRequest / TodoResponse) decouple the wire format from the persistence format and prevent mass-assignment.
  • @ControllerAdvice centralizes error handling β€” every exception maps to a user-friendly outcome (toast notification or cute error page).
  • JPA lifecycle callbacks (@PrePersist / @PreUpdate) auto-populate createdAt / updatedAt.
  • Bean Validation (@NotBlank, @Size) rejects bad input at the API boundary with a 400, not a 500.

🌱 Roadmap

Possible future enhancements:

  • Pagination for large task lists
  • Search/filter by title substring
  • Drag-and-drop reordering with order_index field
  • Due dates with overdue highlighting
  • Categories / tags (many-to-many)
  • REST endpoints + AJAX (no full page reload)
  • Service-layer unit tests with Mockito
  • Docker Compose for one-command setup
  • Deploy to Railway / Fly.io / Render

πŸ“„ License

Released under the MIT License. See LICENSE for details.


made with passion 🌸
Happy Coding 🀭

About

Spring Boot - Todo App with Aesthetic UI using Thymeleaf + Bootstrap + MySQL

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors