A Spring Boot-based task management system with priority-based task processing, user management, and RESTful APIs.
- Create, read, update, and delete tasks
- Assign tasks to users
- Set task priorities (HIGH, MEDIUM, LOW)
- Track task status (TODO, IN_PROGRESS, DONE)
- Set due dates for tasks
- Create and manage users
- Assign tasks to users
- View tasks assigned to specific users
- Automatic task processing based on priority
- Real-time task status updates
- Configurable processing intervals
- Error handling and retry mechanism
POST /api/tasks
Content-Type: application/json
{
"title": "Task Title",
"description": "Task Description",
"priority": "HIGH|MEDIUM|LOW",
"assigneeId": 1,
"dueDate": "2024-03-20T10:00:00"
}GET /api/tasksGET /api/tasks/{id}PUT /api/tasks/{id}/status?status=TODO|IN_PROGRESS|DONEGET /api/tasks/status/{status}GET /api/tasks/assignee/{userId}POST /api/tasks/reprocessPOST /api/users
Content-Type: application/json
{
"name": "User Name",
"email": "user@example.com"
}GET /api/usersGET /api/users/{id}PUT /api/users/{id}
Content-Type: application/json
{
"name": "Updated Name",
"email": "updated@example.com"
}DELETE /api/users/{id}The system includes a priority-based task processor that automatically processes tasks based on their priority level. The processor:
- Runs on a configurable interval (default: 1 second)
- Processes tasks in priority order (HIGH > MEDIUM > LOW)
- Updates task status automatically
- Handles errors and retries failed tasks
- Tasks are created with TODO status
- The processor picks up TODO tasks
- Tasks are processed in priority order
- Status transitions: TODO → IN_PROGRESS → DONE
- Failed tasks are reset to TODO status for retry
The task processor can be configured in application.properties:
# Task Processor Configuration
task.processor.interval=1000 # Processing interval in millisecondsThe system uses PostgreSQL as the database. Configure the database connection in application.properties:
spring.datasource.url=jdbc:postgresql://localhost:5432/task_management
spring.datasource.username=postgres
spring.datasource.password=postgres
spring.jpa.hibernate.ddl-auto=update- Ensure PostgreSQL is running and configured
- Build the application:
mvn clean install
- Run the application:
mvn spring-boot:run
The application will start on port 8080 by default.
Run the test suite:
mvn testThe test suite includes:
- Task creation and processing tests
- Priority-based processing tests
- User management tests
- API endpoint tests
- Java 17 or higher
- Maven 3.6 or higher
- PostgreSQL 12 or higher
- Docker (optional)
Create a .env file in the root directory with the following variables:
# Database
DB_URL=jdbc:postgresql://localhost:5432/task_management
DB_USERNAME=postgres
DB_PASSWORD=postgres
# JWT
JWT_SECRET=your-256-bit-secret
# AWS S3
AWS_S3_BUCKET=your-bucket-name
AWS_REGION=us-east-1
AWS_ACCESS_KEY=your-access-key
AWS_SECRET_KEY=your-secret-key
# SendGrid
SENDGRID_API_KEY=your-api-key
SENDGRID_FROM_EMAIL=your-email@example.com- Create a PostgreSQL database:
CREATE DATABASE task_management;- The application will automatically create the necessary tables on startup.
src/main/java/com/taskmanagement/
├── config/ # Configuration classes
├── controller/ # REST controllers
├── dto/ # Data Transfer Objects
├── entity/ # JPA entities
├── exception/ # Custom exceptions
├── repository/ # JPA repositories
├── security/ # Security related classes
├── service/ # Business logic
└── util/ # Utility classes
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License.