Skip to content

Repository files navigation

STRMS — Smart Task & Resource Management System

A Java 17 application for managing tasks, users, and dependencies in a software project team. Includes a console interface, a web dashboard, and a REST API — all with no external dependencies.


Project Structure

src/
├── com/strms/
│   ├── main/           Main.java              — entry point, demo walkthrough
│   ├── model/          Task, User, Admin, Manager, Engineer, TaskHistoryEntry
│   ├── controller/     TaskManager            — core business logic
│   ├── interfaces/     Assignable, Persistable, Notifiable, Reportable
│   ├── enums/          TaskStatus, PriorityLevel, TaskCategory, NotificationType
│   ├── exceptions/     7 custom exceptions
│   ├── utils/          FileManager, NotificationManager, ReportGenerator
│   ├── view/           ConsoleView, Dashboard
│   └── web/            WebServer, TaskApiHandler, StaticHandler
└── web/static/         index.html, tasks.html, create.html, admin.html, login.html, style.css, app.js

Architecture

Model layer

Class Role
Task Core entity. Holds status, priority, category, deadline, dependencies, and history
User Abstract base class with role-based permission methods
Admin Can create, assign, and delete tasks
Manager Can create and assign tasks
Engineer Can start and complete assigned tasks only
TaskHistoryEntry Immutable audit record — who did what and when

Enums

Enum Values
TaskStatus TODOIN_PROGRESSDONE, or TODOBLOCKED
PriorityLevel LOW, MEDIUM, HIGH, CRITICAL
TaskCategory FEATURE, BUGFIX, RESEARCH, DOCUMENTATION, TESTING, MAINTENANCE

Controller

TaskManager — all business logic in one place:

  • addTask(task, requester) — role check, duplicate check, history entry
  • deleteTask(taskId, requester) — role check
  • updateTask(taskId, ...) — update title/description/priority/deadline
  • assignTask(taskId, engineerId, requester) — role check, notification
  • startTask(taskId, requester) — state machine: TODO → IN_PROGRESS
  • completeTask(taskId, requester) — IN_PROGRESS → DONE, auto-unblocks dependents
  • addDependency(taskId, dependencyId) — circular dependency detection (DFS)
  • removeDependency(taskId, dependencyId) — unblocks task if all deps met
  • saveTasksToFile(path) / loadTasksFromFile(path) — CSV persistence
  • saveUsersToFile(path) / loadUsersFromFile(path) — user CSV persistence
  • listTasksByStatus(status) — filter tasks by status
  • listTasksByUser(userId) — all tasks assigned to a given engineer
  • getNextTask() — peek the highest-priority ready task
  • unassignTask(taskId, requester) — remove assignment from a task
  • removeUser(userId) — remove a user from the registry

Interfaces

Interface Implemented by
Assignable TaskManager
Persistable FileManager
Notifiable NotificationManager
Reportable ReportGenerator

Exceptions

Exception When thrown
TaskNotFoundException Task ID not found
DuplicateTaskException Task ID already exists
InvalidRoleException User lacks permission for the action
InvalidTaskStateException Illegal status transition
CircularDependencyException Dependency would create a cycle
DependencyNotCompletedException Starting a task whose deps are not DONE
FilePersistenceException CSV read/write failure

Task features

  • isBlocked() — returns true if any dependency is not DONE
  • isOverdue() — returns true if deadline has passed and status is not DONE
  • Audit history — every state change records who did it and when
  • Priority queue — ready tasks are ordered CRITICAL → HIGH → MEDIUM → LOW
  • Auto-unblock — completing a task automatically unblocks all tasks waiting on it
  • Completion rate — console dashboard shows a █░░ progress bar with percentage

Web Interface

Started automatically on http://localhost:8090 when the app runs.

Pages

URL Description
/login Sign in with SHA-256 authentication — role enforced from server
/ Dashboard — 6 stat cards, progress bar, task table
/tasks Full task list with filters (status, priority, search) + role-based actions
/create Create task form — Admin and Manager only
/admin Admin only — user list, add/delete users, role permissions table

REST API

Method Endpoint Description
GET /api/tasks All tasks as JSON
GET /api/stats Counts by status + completion %
GET /api/users All users as JSON
POST /api/auth/login Authenticate {name, password}{name, role, id}
POST /api/tasks Create task {id, title, description, priority, category, deadline, requesterId}
POST /api/tasks/assign Assign task {taskId, userId, requesterId}
POST /api/tasks/start Start task {taskId, requesterId}
POST /api/tasks/complete Complete task {taskId, requesterId}
POST /api/tasks/delete Delete task {taskId, requesterId}
POST /api/tasks/update Update task fields {taskId, title?, description?, priority?, category?, deadline?, requesterId}
POST /api/tasks/dependency/add Add dependency {taskId, depId, requesterId}
POST /api/tasks/dependency/remove Remove dependency {taskId, depId, requesterId}
POST /api/users Create user {id, name, email, role, password, requesterId} — Admin only
POST /api/users/delete Delete user {id, requesterId} — Admin only

All endpoints enforce role-based access control via requesterId. No external web framework — uses com.sun.net.httpserver.HttpServer built into the JDK.

Role permissions

Action Engineer Manager Admin
Start / Complete task
Create task
Assign task
Edit task
Delete task
Manage users

Authentication

Passwords are hashed with SHA-256 (java.security.MessageDigest) before storage. The hash is persisted in strms_users.csv and verified on each login. Users without a stored hash accept any password (backwards compatibility).


CI/CD (GitHub Actions)

Workflow Trigger What it does
ci.yml Every push / PR to main Compile → test-compile → JUnit → upload report → build JAR
pr-check.yml PR to main only Code quality check + full test suite + final build (3 sequential jobs)
tag-release.yml Push a v* tag Run tests → build JAR → create GitHub Release with JAR attached

Branch protection on main: requires passing CI before merge.


Tests (JUnit 5)

42 tests in TaskManagerTest.java covering:

  • Dependency management: add, remove, cycle detection, transitive cycles
  • Blocking/unblocking: task becomes BLOCKED on dep add, auto-promoted after dep completion
  • Role enforcement: Engineer cannot create/delete/assign, Admin has full privileges
  • State machine: start, complete, illegal transitions (start DONE, complete TODO, etc.)
  • Task assignment: assign to non-engineer throws
  • Audit history recording
  • Exception messages
  • Priority ordering (CRITICAL before HIGH, LOW after MEDIUM)

Run tests:

mvn test

How to run

Eclipse

  1. Right-click Main.javaRun AsJava Application
  2. The demo walkthrough runs in the console
  3. Open http://localhost:8090/login in the browser
  4. Default credentials: any registered user with password admin

Command line

mvn package -DskipTests
java -jar target/strms.jar

Dependencies

Library Version Scope
JUnit Jupiter 5.10.2 Test only

No runtime dependencies — pure Java 17 standard library.

About

Smart Task & Resource Management System - Java OOP Project

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages