A simple and production-ready To-Do List App built with Spring Boot, MySQL, and REST APIs.
- Add new tasks
- View all tasks
- Update tasks
- Mark tasks as completed
- Delete tasks
- Persistent storage using MySQL database
- Clean, modular Spring Boot architecture
- Supports deployment on cloud / VPS
- Java 17/21
- Spring Boot 3.x
- Spring Web
- Spring Data JPA
- MySQL Database
- Lombok
- Maven
src/main/java/com/example/todo
│
├── controller
│ └── TaskController.java
├── service
│ └── TaskService.java
├── repository
│ └── TaskRepository.java
└── entity
└── Task.java
src/main/resources
└── application.properties
CREATE DATABASE todo_app;spring.datasource.url=jdbc:mysql://localhost:3306/todo_app?useSSL=false&serverTimezone=UTC
spring.datasource.username=root
spring.datasource.password=your_mysql_password
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
spring.jpa.database-platform=org.hibernate.dialect.MySQLDialectmvn spring-boot:runServer runs at: ➡️ http://localhost:8080
POST /api/tasks
{
"title": "Learn Spring Boot",
"description": "Complete CRUD implementation"
}GET /api/tasks
GET /api/tasks/{id}
PUT /api/tasks/{id}
{
"title": "Learn Spring Boot (Updated)",
"description": "Improve service layer",
"completed": false
}PATCH /api/tasks/{id}/complete
DELETE /api/tasks/{id}
@Entity
@Data
public class Task {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@NotBlank
private String title;
private String description;
private boolean completed = false;
}Because spring.jpa.hibernate.ddl-auto=update, Spring Boot will automatically create the task table in MySQL.
mvn clean installjava -jar target/todo-app-0.0.1-SNAPSHOT.jarOpen-source — MIT License.
Your Name GitHub: https://github.com/your-username