Spring Boot 3 Todo Planner Application
- :link: Modern fullstack To-Do List application using Java Spring Boot and Thymeleaf.
- :man: Users can
create, update, delete tasks.
Technologies Used
methodology
This project was developed following the Agile methodology, focusing on iterative development, continuous feedback, and adaptability. It adopts the Model-View-Controller(MVC) architecture, ensuring a clear separation between the presentation layer, business logic, and data access. The backend is built with Spring Boot 3 and follows best programming practices to maintain clean, modular, and maintainable code. This approach facilitates scalability and testing throughout the development lifecycle.
Project Structure
src/
├─ main/
│ ├─ java/com/example/springboot3todoapplication/
│ │ ├─ config/ # Configurações e dados iniciais
│ │ │ └─ SeedData.java
│ │ ├─ controllers/ # Controladores responsáveis pelas rotas e lógica das requisições
│ │ │ ├─ PageController.java
│ │ │ ├─ TodoController.java
│ │ │ └─ TodoFormController.java
│ │ ├─ models/ # Classes de modelo representando entidades do banco
│ │ │ ├─ StatusType.java
│ │ │ └─ Todo.java
│ │ ├─ repositories/ # Interfaces para acesso e manipulação dos dados
│ │ │ └─ TodoRepository.java
│ │ ├─ services/ # Serviços que encapsulam a lógica de negócio
│ │ │ ├─ TodoService.java
│ │ │ └─ SpringBoot3TodoApplication.java
│ ├─ resources/
│ │ ├─ static/ # Arquivos estáticos (JS, CSS, imagens, ícones)
│ │ │ ├─ icon/
│ │ │ ├─ image/
│ │ │ ├─ logo/
│ │ │ ├─ app.js
│ │ │ └─ styles.css
│ │ ├─ templates/ # Templates Thymeleaf para as views
│ │ │ ├─ index.html
│ │ │ └─ sobre.html
│ │ └─ application.properties # Configurações da aplicação
├─ test/
│ ├─ java/com/example/springboot3todoapplication/
│ │ ├─ controllers/ # Testes para os controladores
│ │ │ └─ TodoControllerTests.java
│ │ ├─ services/ # Testes para os serviços
│ │ │ ├─ TodoServiceTests.java
│ │ │ └─ SpringBoot3TodoApplicationTests.java
Testing
Tests are implemented using JUnit 5 (Jupiter), Spring Boot Test, and Mock to ensure the reliability and robustness of the application through both unit and integration testing. Tests are organized by layers, with unit tests targeting individual services and isolated business logic, while integration tests validate the interaction between controllers, services, and repositories. The tests cover essential functionalities such as context loading, CRUD operations for Todo entities, and endpoint behaviors.
How to Use
- Clone the repository.
- Set up environment variables in
.env file
DATABASE_URL="postgresql://USER:PASSWORD@HOST:PORT/DATABASE_NAME"
- Run the Spring Boot application using
mvn spring-boot:run
or use
#!/bin/bash set -o allexport source .env set +o allexport mvn spring-boot:run / bash -c "set -o allexport; source .env; set +o allexport; mvn spring-boot:run
- Access the application at
http://localhost:8080
Testing