GitHunt
BA

Bahaaio/TaskTracker

A simple Java CLI app for tracking tasks using JDBC and H2.

Task Tracker CLI

A command-line task management application built to practice core Java database technologies.

๐Ÿ’ก Learning Goals

This project focuses on mastering fundamental Java database concepts:

  • โœ… JDBC and SQL with Java
  • โœ… Connection pooling with HikariCP
  • โœ… In-memory and file-based databases using H2
  • โœ… Clean project structure (DAO pattern, Mapper classes)
  • โœ… Unit testing with JUnit 5
  • โœ… CLI development with PicoCLI

The goal is to build solid foundations in Java database access (JDBC) before transitioning to frameworks like JPA or
Spring Boot.

๐Ÿ›  Tech Stack

  • Java 21 - Programming language
  • H2 Database - Embedded SQL database
  • HikariCP - High-performance connection pooling
  • PicoCLI - Command-line interface framework
  • JUnit 5 - Testing framework
  • Gradle - Build automation (Kotlin DSL)

๐Ÿš€ Building and Running

Prerequisites

  • Java 21 or higher
  • No additional setup required (Gradle wrapper included)

Build the Application

./gradlew build
# Make the script executable
chmod +x task-cli

# Enable tab completion for commands (optional) 
source task-cli_completion

๐Ÿ’ก Tip: Press TAB after a partial command to view available options with tab completion enabled.

Usage Examples

General Commands

# Show help
./task-cli --help

# Show version
./task-cli --version

โ„น๏ธ Tip: You can use --help with any subcommand (e.g., ./task-cli add --help) to see detailed options.

Adding a new task

./task-cli add "Learn JDBC" -d "Practice database operations"

Updating and deleting tasks

# Update task title
./task-cli update 1 -t "Master JDBC fundamentals"

# Update task description
./task-cli update 1 -d "Complete all JDBC exercises"

# Update both title and description
./task-cli update 1 -t "New Title" -d "New Description"

# Delete a task
./task-cli delete 1

Marking a task's status

# Mark task as done
./task-cli mark done 1

# Mark task as todo (reopen)
./task-cli mark todo 1

Listing Tasks

# List all tasks
./task-cli list

# List only completed tasks
./task-cli list done

# List only pending tasks  
./task-cli list todo

Alternative: Run with Gradle

If you prefer not to use the script:

./gradlew run --args="add 'Task title'"
Bahaaio/TaskTracker | GitHunt