WorkTime is a full-stack work and time management application built with Spring Boot, Angular and PostgreSQL.
The application allows administrators to manage users, projects and tasks while employees can view their assigned work, update task statuses and track working time.
- Session-based authentication
- BCrypt password hashing
- Role-based access control
ADMINandEMPLOYEEroles- Protected Angular routes
- HTTP authentication interceptor
- Logout confirmation and session termination
- Centralized API error notifications
- Create and update users
- Assign administrator or employee roles
- Activate and deactivate accounts
- Case-insensitive email handling
- Prevent inactive users from signing in or receiving new tasks
- Restrict user management to administrators
- Create and update projects
- Manage project lifecycle statuses
- Filter projects by name, status and date range
- Sort projects by end date
- Prevent invalid project date ranges
- Prevent completed or cancelled projects from receiving new tasks
- Keep projects as inactive records instead of physically deleting them
- Create and update tasks
- Assign tasks to users and projects
- Define priority, status, due date and estimated duration
- Filter tasks by priority, status, project and assigned user
- Restrict employees to their assigned tasks
- Allow employees to update the status of assigned tasks
- Detect and display overdue open tasks
- Record task status history with the responsible user and timestamp
- Start and stop timers
- Record start and end times on the backend
- Calculate elapsed duration on the backend
- Allow only one active timer per user
- Restore the active timer after a page refresh
- Create manual time entries
- Validate manual entry dates and duration
- Display personal time entry history
- Calculate daily and weekly totals
- Generate project-based and user-based time reports
- Daily tracked-time card
- Weekly tracked-time card
- Overdue task count
- Active timer status
- Overdue task detail list
- Daily tracked-time bar chart
- Inclusive date range filter
- CSV export for the selected date range
- Responsive Angular Material interface
- Java 21
- Spring Boot 4.1
- Spring Web MVC
- Spring Data JPA
- Spring Security
- Bean Validation
- PostgreSQL
- Flyway
- Lombok
- SpringDoc OpenAPI
- Maven Wrapper
- JUnit 5
- Mockito
- Spring Security Test
- Angular 22
- Angular Material 22
- TypeScript 6
- RxJS 7
- Signals and computed state
- Standalone Angular components
- Lazy-loaded routes
- Vitest
- npm 11
| Capability | Admin | Employee |
|---|---|---|
| Manage users | Yes | No |
| Create and update projects | Yes | No |
| View projects | Yes | Yes |
| Create tasks | Yes | No |
| Fully update tasks | Yes | No |
| View accessible tasks | Yes | Yes |
| Update assigned task status | Yes | Yes |
| View task status history | Yes | No |
| Start and stop a timer | Yes | Yes |
| Create manual time entries | Yes | Yes |
| View personal time entries | Yes | Yes |
| View project and user reports | Yes | No |
WorkTime/
├── backend/
│ ├── src/main/java/com/worktime/
│ │ ├── controller/
│ │ ├── dto/
│ │ ├── entity/
│ │ ├── exception/
│ │ ├── repository/
│ │ ├── security/
│ │ └── service/
│ ├── src/main/resources/
│ │ ├── db/migration/
│ │ └── application.properties
│ ├── src/test/
│ ├── mvnw
│ ├── mvnw.cmd
│ └── pom.xml
├── frontend/
│ ├── src/app/
│ │ ├── core/
│ │ ├── features/
│ │ └── layout/
│ ├── angular.json
│ └── package.json
└── README.md
Install the following tools before running the project:
- Java 21
- PostgreSQL
- Node.js
- npm
- Git
The project includes Maven Wrapper, so a separate Maven installation is not required.
Create a PostgreSQL database:
CREATE DATABASE worktime;The backend uses the following environment variables:
| Variable | Example |
|---|---|
DB_URL |
jdbc:postgresql://localhost:5432/worktime |
DB_USERNAME |
postgres |
DB_PASSWORD |
your_password |
Do not commit real database passwords or other secrets to the repository.
Flyway runs automatically when the backend starts and applies the migrations under:
backend/src/main/resources/db/migration
Hibernate is configured with:
spring.jpa.hibernate.ddl-auto=validateThis means Flyway manages the database schema while Hibernate verifies that the entity mappings match it.
Open PowerShell in the backend directory:
cd backendSet the environment variables for the current terminal session:
$env:DB_URL="jdbc:postgresql://localhost:5432/worktime"
$env:DB_USERNAME="postgres"
$env:DB_PASSWORD="your_password"Start the backend:
.\mvnw.cmd spring-boot:runThe backend runs at:
http://localhost:8080
No default administrator password is committed to the repository. The application requires an administrator account created through the approved local bootstrap or database setup process.
Open a second terminal:
cd frontend
npm install
npm startThe frontend runs at:
http://localhost:4200
The frontend expects the backend at:
http://localhost:8080
With the backend running, Swagger UI is available at:
http://localhost:8080/swagger-ui.html
The OpenAPI specification is available at:
http://localhost:8080/v3/api-docs
| Area | Base path |
|---|---|
| Authentication | /api/auth |
| Users | /api/users |
| Projects | /api/projects |
| Tasks | /api/tasks |
| Time entries | /api/time-entries |
Important time tracking endpoints include:
POST /api/time-entries/start
POST /api/time-entries/stop
POST /api/time-entries/manual
GET /api/time-entries
GET /api/time-entries/active
GET /api/time-entries/summary/daily
GET /api/time-entries/summary/weekly
GET /api/time-entries/reports/projects/{projectId}
GET /api/time-entries/reports/users/{userId}
Set the database environment variables, then run:
cd backend
.\mvnw.cmd testThe backend test suite contains service unit tests, MVC controller tests and security behavior checks.
Install dependencies and generate a production build:
cd frontend
npm install
npm run buildBuild output is generated under:
frontend/dist/
Run frontend tests with:
cd frontend
npm test- Passwords are stored with BCrypt hashing.
- Authentication uses server-side sessions.
- Protected frontend requests include credentials.
- Authorization is also enforced on the backend.
- Deactivated users cannot sign in.
- Sensitive values must be supplied through environment variables.
- No real password or production credential should be stored in source control.
Development follows a branch-based workflow:
main
└── feature/descriptive-task-name
Typical flow:
git switch main
git pull origin main
git switch -c feature/example-featureAfter development and validation:
git add <changed-files>
git commit -m "feat: describe the change"
git push -u origin feature/example-featureChanges are merged into main through pull requests.
WorkTime currently includes the core project, task, user, time tracking, reporting and dashboard functionality. Further improvements may include expanded audit logging, additional report visualizations, pagination and broader automated test coverage.