This project implements a Task Manager following the principles of Clean Architecture. The goal is to maintain organized, decoupled, and easy-to-maintain code.
The application is structured in layers, each with a specific responsibility:
- Domain: Contains the core business entities and repository interfaces.
- Application: Implements the use cases, converting data and orchestrating business logic.
- Infrastructure: Handles data persistence, configurations, and interactions with external technologies.
- Interfaces: Defines the REST API endpoints and other ways to interact with the system.
task-manager/
├── src/main/java/com/example/taskmanager
│ ├── domain
│ │ ├── entity
│ │ │ └── Task.java
│ │ └── repository
│ │ └── TaskRepository.java
│ ├── application
│ │ ├── dto
│ │ │ └── TaskDTO.java
│ │ └── service
│ │ └── TaskService.java
│ ├── infrastructure
│ │ ├── persistence
│ │ │ ├── TaskEntity.java
│ │ │ ├── TaskRepositoryImpl.java
│ │ │ └── SpringTaskRepository.java
│ │ └── configuration
│ │ └── PersistenceConfig.java
│ └── interfaces
│ └── rest
│ └── TaskController.java
└── pom.xml
- Java 17
- Spring Boot
- Spring Data JPA
- H2 Database (for development/testing environment)
- Maven
Make sure you have installed:
- Clone the repository:
git clone https://github.com/your-username/task-manager.git
- Navigate to the project directory:
cd task-manager - Compile and run the application:
mvn spring-boot:run
- The API will be available at:
http://localhost:8080
The REST API exposes the following endpoints:
POST /tasksExample Payload:
{
"title": "New Task",
"description": "Task description",
"status": "PENDING"
}GET /tasksGET /tasks/{id}PUT /tasks/{id}Example Payload:
{
"title": "Updated Task",
"description": "Updated description",
"status": "COMPLETED"
}DELETE /tasks/{id}If you want to contribute to the project:
- Fork the repository.
- Create a branch for your feature (
git checkout -b feature-new). - Make the changes and commit (
git commit -m 'Add new feature'). - Push your changes (
git push origin feature-new). - Open a Pull Request.
This project is distributed under the MIT license. See the LICENSE file for more details.