This is a small, beginner-friendly project developed using Java Spring Boot to showcase my fundamental skills in building RESTful APIs and integrating them with a simple web frontend. The application provides basic CRUD (Create, Read, Update, Delete) functionality for managing a list of tasks.
- Add Tasks: Easily add new tasks with a title and an optional description.
- View Tasks: Display all tasks in a list.
- Mark as Completed: Toggle the completion status of a task.
- Edit Tasks: Update the title and description of existing tasks.
- Delete Tasks: Remove tasks from the list.
- Filter Tasks: Filter tasks by "All", "Active", or "Completed" status.
- Responsive UI: A simple, responsive user interface built with plain HTML, CSS, and JavaScript.
- Java 17+
- Spring Boot 3.2.0: For rapid application development.
- Spring Data JPA: For database interaction and ORM.
- Spring Web: For building RESTful endpoints.
- H2 Database: An in-memory/file-based database for development and easy setup.
- Lombok: To reduce boilerplate code (getters, setters, constructors).
- HTML5
- CSS3
- JavaScript (ES6+)
The project follows a standard Spring Boot application structure:
todolist
├── src
│ ├── main
│ │ ├── java
│ │ │ └── com
│ │ │ └── shiningpr1sm
│ │ │ └── todolist
│ │ │ ├── TodoListApplication.java (Main Spring Boot entry point)
│ │ │ ├── controller
│ │ │ │ └── TaskController.java (RESTful API endpoints)
│ │ │ ├── model
│ │ │ │ └── Task.java (JPA Entity for tasks)
│ │ │ ├── repository
│ │ │ │ └── TaskRepository.java (Spring Data JPA repository)
│ │ │ └── service
│ │ │ └── TaskService.java (Business logic for tasks)
│ │ └── resources
│ │ ├── application.properties (Application configuration)
│ │ └── static
│ │ └── index.html (Frontend UI)
└── pom.xml (Maven Project Object Model)
To get a local copy up and running, follow these simple steps.
- Java Development Kit (JDK) 17 or higher
- Maven (usually bundled with IDEs like IntelliJ IDEA, or can be installed separately)
- A preferred IDE (e.g., IntelliJ IDEA, VS Code with Java extensions, Eclipse)
-
Clone the repository:
git clone https://github.com/ShiningPr1sm/java-todolist.git cd java-todolist -
Build the project with Maven:
./mvnw clean install
This command will download all necessary dependencies and compile the project.
-
Run the Spring Boot application:
./mvnw spring-boot:run
The application will start on port
8080by default. -
Access the application: Open your web browser and navigate to:
http://localhost:8080You will see the To-Do List interface.
The backend provides the following RESTful API endpoints:
GET /tasks: Retrieve all tasks.GET /tasks/{id}: Retrieve a specific task by ID.POST /tasks: Create a new task.- Request Body:
{"title": "Task Title", "description": "Task Description"}
- Request Body:
PUT /tasks/{id}: Update an existing task.- Request Body:
{"title": "New Title", "description": "New Description", "completed": true}
- Request Body:
DELETE /tasks/{id}: Delete a task by ID.