Skip to content

Amiral-Code/task-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Task Tracker CLI

A command-line task tracker, built as the roadmap.sh Task Tracker project. Pure Java (JDK only, no external libraries), tasks persisted to a tasks.json file in the working directory.

Requirements (the brief)

  • Add, update, and delete tasks
  • Mark a task as in-progress or done
  • List all tasks, or filter by status (todo / in-progress / done)
  • Each task has: id, description, status, createdAt, updatedAt
  • Store tasks in a JSON file; create it if missing
  • No external libraries or frameworks
  • Handle errors and edge cases gracefully

Commands

add "description"
update <id> "new description"
delete <id>
mark-in-progress <id>
mark-done <id>
list
list <todo|in-progress|done>

Project layout

src/tasktracker/
  Main.java            entry point: parses args, dispatches commands
  Task.java            the task model
  TaskStatus.java      enum: TODO / IN_PROGRESS / DONE
  Json.java            minimal hand-rolled JSON read/write (plumbing)
  TaskRepository.java  load()/save() the list to tasks.json (plumbing)

What is done vs yours

Done (scaffold): structure, Task, TaskStatus, JSON persistence, and two worked commands to copy the pattern from: add and list.

Your turn (the practice): implement update, delete, and mark (mark-in-progress / mark-done) in Main.java. Each one loads the list, changes it, and saves it, exactly like add. There is a parseId(...) helper ready for you, and each TODO method has step-by-step hints in a comment.

Build and run

Needs only a JDK (built and tested with Temurin 21).

Git Bash:

javac -d out src/tasktracker/*.java
java -cp out tasktracker.Main add "Buy groceries"
java -cp out tasktracker.Main list

PowerShell:

javac -d out (Get-ChildItem -Recurse src -Filter *.java).FullName
java -cp out tasktracker.Main add "Buy groceries"

IntelliJ: open the folder, mark src as Sources Root, run Main (pass arguments via Run/Debug Configurations).

Example session (once you finish the TODOs)

$ java -cp out tasktracker.Main add "Buy groceries"
Task added successfully (ID: 1)
$ java -cp out tasktracker.Main mark-in-progress 1
$ java -cp out tasktracker.Main list in-progress
#1 [in-progress] Buy groceries

Notes

  • tasks.json is created on first add and is git-ignored (runtime data).
  • When you are ready to show this off, git init here and push it as its own repo.
  • Progress is tracked in the notes vault: Notes/Projects/Task-Tracker-CLI.md.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages