A lightweight task management system built with Spring Boot, inspired by Trello. This application allows users to create, update, assign, and manage tasks, complete with states and comments. It demonstrates the use of design patterns, such as the Facade and FSM (Finite State Machine) patterns, to simplify task management workflows.
- Create, update, delete tasks with states (TODO, DOING, DONE).
- Assign tasks to users.
- Add, update, and manage comments on tasks.
- Centralized Facade pattern to simplify task and user operations.
- FSM pattern to enforce controlled task state transitions.
- Persistent storage with MySQL.
- Backend: Spring Boot, Spring Data JPA
- Database: MySQL
- Build Tool: Maven
- Testing: JUnit, Postman
- Java (version 17 or higher recommended)
- Maven for dependency management
- MySQL database
-
Clone the repository:
git clone https://github.com/yourusername/task-management-api.git cd task-management-api
-
Database Configuration:
-
Create a MySQL database named
trello_db
. -
Update the database connection properties in
application.properties
:spring.datasource.url=jdbc:mysql://localhost:3306/trello_db spring.datasource.username=your_mysql_username spring.datasource.password=your_mysql_password spring.jpa.hibernate.ddl-auto=update spring.jpa.show-sql=true
-
-
Build and Run the Application:
mvn clean install mvn spring-boot:run
-
Testing:
- Test the API endpoints using Postman or similar tools.
-
POST /tasks - Create a new task
- Example JSON:
{ "state": "TODO", "description": "Walk Lizard", "assignedTo": { "id": 7 }, "comments": [ { "text": "He Might run away" }, { "text": "He's slow though" } ] }
- Example JSON:
-
GET /tasks - Retrieve all tasks
-
GET /tasks/{id} - Retrieve a specific task by ID
-
PUT /tasks/{id}/advanceState - Move task to the next possible state (TODO → DOING → DONE)
-
DELETE /tasks/{id} - Delete a specific task
- POST /users - Create a new user
- GET /users - Retrieve all users
- GET /users/{id} - Retrieve a specific user by ID
- DELETE /users/{id} - Delete a specific user
id
: Unique identifier (Long)state
: State of the task (Enum: TODO, DOING, DONE)description
: Description of the taskassignedTo
: User assigned to the taskcomments
: List of comments associated with the taskcreatedDate
: Date the task was created
id
: Unique identifier (Long)name
: Name of the usertasks
: List of tasks assigned to the user
id
: Unique identifier (Long)text
: Comment texttask
: Associated task
Defines task states and valid transitions (FSM logic).
- TODO - Initial state
- DOING - Intermediate state
- DONE - Final state
- Add more complex task filters (e.g., by assigned user, state).
- Implement user authentication and authorization.
- Add notifications for task updates.
- Improve error handling and response consistency.
- Integrate with frontend (React or Angular) for a complete UI.
Feel free to contribute by opening issues or submitting pull requests. For any questions, please contact the project maintainer.