Skip to content

Repository files navigation

Personal Task Manager API

A full-stack task management application built with Spring Boot, H2, Thymeleaf, and Google Gemini AI.

The application supports task management, analytics dashboards, AI-powered task suggestions, and AI-generated task breakdowns to help users organize and prioritize work more effectively.


Tech Stack

  • Java 17
  • Spring Boot 3.5.14
  • Spring Data JPA
  • H2 Database
  • Maven
  • JUnit 5
  • Google Gemini API
  • HTML/CSS/JavaScript
  • Thymeleaf

Features

Task Management

  • Create, update, delete, and view tasks
  • Filter by status and priority
  • Sort by due date, created date, title, and priority
  • Search by ID or title

AI Features

  • AI task suggestion from natural language
  • AI task breakdown into subtasks
  • Graceful fallback AI provider when Gemini API key is not configured

Analytics

  • Task counts by status and priority
  • Overdue task count
  • Upcoming tasks (next 7 days)
  • Analytics dashboard with visual task distribution by status and priority
  • Active HIGH priority task monitoring

Frontend UI

  • Create/manage tasks
  • AI suggestion and AI breakdown buttons
  • Task details modal
  • API quick links for reviewers

Run the Application

1. Set Gemini API Key

Mac/Linux:

export GEMINI_API_KEY=your-api-key

Windows PowerShell:

$env:GEMINI_API_KEY="your-api-key"

application.properties

application.properties file already has:

gemini.api.key=${GEMINI_API_KEY:}

So the project runs without api key but below are actual steps to add the real key:

gemini.api.key=${GEMINI_API_KEY}

2. Run the Project

./mvnw spring-boot:run

Application runs at:

http://localhost:8080

Run Tests

./mvnw test

Main API Endpoints

Method Endpoint Description
POST /tasks Create task
GET /tasks Get all tasks
GET /tasks/{id} Get task by ID
PUT /tasks/{id} Update task
DELETE /tasks/{id} Delete task
GET /tasks/analytics Task analytics
POST /tasks/suggest AI task suggestion
POST /tasks/{id}/breakdown AI task breakdown

Example Task

You can find more example tasks in sample-tasks.json (convenient for testing)

{
  "title": "Prepare quarterly report",
  "description": "Finalize metrics and submit",
  "dueDate": "2026-05-30T17:00:00",
  "priority": "HIGH",
  "status": "TODO"
}

Business Rules

  • Maximum of 3 active HIGH priority tasks at any time
  • Due date must be a future date
  • Title is required and limited to 200 characters
  • Description is limited to 1000 characters
  • Tasks support LOW, MEDIUM, and HIGH priorities
  • Tasks support TODO, IN_PROGRESS, and DONE statuses

Timestamps

Each task response includes:

  • createdAt: set when the task is created
  • updatedAt: set when the task is created and refreshed whenever the task is updated

How to verify:

  1. Create a task using POST /tasks
  2. Note the createdAt and updatedAt values
  3. Update the same task using PUT /tasks/{id}
  4. Call GET /tasks/{id}

Expected result:

  • createdAt stays the same
  • updatedAt changes to the latest update time

Testing

Includes:

  • Unit tests
  • Integration tests
  • Controller tests
  • AI endpoint tests

Run:

./mvnw test

AI Usage Examples

AI Task Suggestion

Endpoint:

POST /tasks/suggest

Example request: You can also find some more examples in text file "AI-PromptsForTestingAIEndpoint.txt"

{
  "description": "Prepare slides for the quarterly review meeting next Friday"
}

Other example prompts:

  • "Remind me to submit tax documents tomorrow"
  • "Plan onboarding session for new interns next week"
  • "Finish backend API integration before Monday"

AI Task Breakdown

Endpoint:

POST /tasks/{id}/breakdown

Example workflow:

  1. Create a complex task
  2. Click AI Breakdown in the UI
  3. Or call:
POST /tasks/1/breakdown

Recommended complex tasks:

  • "Launch company onboarding portal"
  • "Prepare annual engineering roadmap"
  • "Organize company hackathon event"
  • "Migrate legacy authentication system"

AI Assistance

AI tools were used (Claude code CLI) Sonnet 4.6 for implementation support, debugging assistance, and documentation refinement.


AI transcript

You can find all AI Transcripts in folder AITranscripts. It also has a dedicated folder "Prompt Highlights" which has a text file of all my prompts used.


About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages