How javierdvlpr/taskflow works
1. Overall shape
TaskFlow PRO is a two-tier enterprise task management system: an Angular 17 single-page frontend talks to a Spring Boot 3.2 REST backend, which persists data in PostgreSQL. The architectural boundary is cleanly split into UI/client concerns and server-side business/security/data concerns.
2. Frontend subsystem
The frontend is organized by feature area under src/app/features: auth, admin, employee, and a role-based dashboard redirect. It uses standalone components, Angular routing, shared layout/loading components, and a central auth service/interceptor pattern. This makes the UI primarily a presentation and session-management layer.
3. Frontend access control
Two client-side guards define navigation boundaries: auth.guard.ts protects authenticated routes, and role.guard.ts constrains admin vs employee views. The auth.interceptor.ts attaches authentication tokens to API calls, so the frontend is responsible for carrying session identity across requests but not enforcing server trust.
4. Backend API layer
The backend exposes REST controllers for Auth, User, Department, Task, and TimeLog. These controllers represent the public API surface and map incoming HTTP requests into DTOs and service calls rather than directly exposing entities.
5. Backend application layers
The backend follows a typical layered Spring structure: controller -> service -> repository -> entity. Services contain business rules, repositories handle persistence, and entities model the domain. DTOs (TaskDTO, UserDTO, response/request objects) separate API payloads from internal JPA entities.
6. Security boundary
Authentication is JWT-based. SecurityConfig, JwtService, JwtAuthenticationFilter, and CustomUserDetailsService form the security subsystem that authenticates requests, resolves the current user, and protects routes by role. This is the main trust boundary between client and server.
7. Domain model
The core business entities are User, Department, Task, and TimeLog, with supporting enums for UserRole, TaskStatus, and Priority. This shows the system centers on assigning work, organizing people into departments, and recording execution time against tasks.
8. Main data flows
The primary flow is: login request from Angular -> AuthController/AuthService -> JWT issuance -> frontend stores and reuses token -> subsequent API calls go through the interceptor -> JWT filter validates identity -> services load/update domain data through repositories. For regular operations, the same pattern applies to task assignment, task viewing, user management, department management, and time logging.
9. Role-based business partitioning
The application is split into two product experiences: administrators manage users, departments, tasks, and reports; employees view assigned tasks, track time, and review history. This role split is reflected both in the frontend routes/components and in backend authorization decisions.
10. Persistence and initialization
Data access is abstracted through Spring Data repositories for users, departments, tasks, and time logs. DataInitializer seeds initial data, likely including the sample admin/employee accounts documented in the README. A database/clean_database.sql file suggests support for resetting or recreating the database state.
11. Configuration and runtime
Backend configuration lives in application.yml and .env templates; frontend environment values live in environment.ts. The project expects local development via two processes: backend on port 8081 and frontend on port 4200, with Swagger UI available for API exploration.
12. Operational entry points
The .bat scripts (start-all.bat, start-backend.bat, start-frontend.bat) are the top-level operational wrappers. They do not add business logic, but they define how the system is launched and therefore matter for deployment/runtime diagrams.
13. Architecture summary for diagramming
A good diagram would show: browser/UI on the left, Angular route/guard/interceptor layer in the middle, Spring Boot API with security filter and service/repository layers on the right, and PostgreSQL at the bottom. Separate the admin and employee feature paths at the UI and authorization layers, but keep the shared backend domain and persistence layer centralized.
Main entry points: app.routes.ts App Routes · AuthService.java Domain Services · AuthController.java REST Controllers · JwtAuthenticationFilter.java JWT Filter
Components 22
Angular UI
Client-side task management experience and navigation control
- Angular SPA · Single-page client for admin and employee workflows
frontend/src/app/app.component.ts - App Routes · Top-level route configuration and redirects
frontend/src/app/app.routes.ts - Auth Guard · Blocks unauthenticated access
frontend/src/app/core/guards/auth.guard.ts - Role Guard · Constrains admin and employee views
frontend/src/app/core/guards/role.guard.ts - Auth Interceptor · Attaches JWT to API requests
frontend/src/app/core/services/auth.interceptor.ts - Auth Service · Handles login, token state, and session identity
frontend/src/app/core/services/auth.service.ts - Login View · Entry point for user authentication
frontend/src/app/features/auth/login/login.component.ts - Admin Area · User, department, task, and report management
frontend/src/app/features/admin/dashboard/admin-dashboard.component.ts - Employee Area · My tasks, time tracking, and history views
frontend/src/app/features/employee/dashboard/employee-dashboard.component.ts - Shared Layout · Common app shell and loading state components
frontend/src/app/shared/components/layout/layout.component.ts
Spring API
REST API, security, services, and persistence
- Security Config · HTTP access rules and authentication setup
backend/src/main/java/com/taskflow/security/SecurityConfig.java - JWT Filter · Validates bearer tokens on incoming requests
backend/src/main/java/com/taskflow/security/jwt/JwtAuthenticationFilter.java - JWT Service · Creates and validates JWTs
backend/src/main/java/com/taskflow/security/jwt/JwtService.java - User Details · Loads authenticated user details for security
backend/src/main/java/com/taskflow/security/CustomUserDetailsService.java - REST Controllers · Auth, user, department, task, and time-log endpoints
backend/src/main/java/com/taskflow/controller/AuthController.java - Domain Services · Business rules for auth, users, departments, tasks, and time logs
backend/src/main/java/com/taskflow/service/AuthService.java - Repositories · Spring Data repositories for domain aggregates
backend/src/main/java/com/taskflow/repository/UserRepository.java - Domain Model · Users, departments, tasks, time logs, and enums
backend/src/main/java/com/taskflow/entity/User.java - Data Initializer · Seeds initial application data
backend/src/main/java/com/taskflow/config/DataInitializer.java
Data Layer
Database and initialization assets
- PostgreSQL · Persistent store for application data
database/clean_database.sql - App Config · Backend and frontend environment configuration
backend/src/main/resources/application.yml
Runtime
Top-level launch scripts
- Start Scripts · Batch scripts for launching backend and frontend
start-all.bat
Connections 24
- Angular SPA → App Routes: uses · App shell is driven by route configuration
- App Routes → Auth Guard: protects · Authenticated routes are guarded
- App Routes → Role Guard: filters · Role-based access is applied per route
- App Routes → Login View: opens · Unauthenticated users land on login
- App Routes → Admin Area: navigates · Admin role routes to admin area
- App Routes → Employee Area: navigates · Employee role routes to employee area
- Shared Layout → Admin Area: wraps · Shared shell hosts admin views
- Shared Layout → Employee Area: wraps · Shared shell hosts employee views
- Login View → Auth Service: calls · Login submits credentials through auth service
- Auth Service → Auth Interceptor: stores token · Session token is reused for API calls
- Auth Interceptor → REST Controllers: calls API · Adds auth to backend requests
- REST Controllers → Domain Services: delegates · Controllers map HTTP to business logic
- Domain Services → Repositories: persists via · Services use repositories for data access
- Repositories → Domain Model: maps · Repositories operate on domain entities
- Domain Services → Domain Model: uses · Business logic reads and updates domain objects
- Security Config → JWT Filter: installs · Security chain includes JWT validation
- JWT Filter → JWT Service: validates · Filter checks tokens using JWT service
- JWT Filter → User Details: loads identity · Authenticated principal is resolved from user details service
- REST Controllers → Security Config: protected by · API endpoints are secured by Spring Security
- Data Initializer → PostgreSQL: seeds · Bootstrap data is written to the database
- Domain Services → PostgreSQL: reads/writes · Domain operations ultimately persist to PostgreSQL
- App Config → Security Config: configures · Application settings shape backend runtime and security
- Start Scripts → Angular SPA: starts · Scripts launch the frontend process
- Start Scripts → REST Controllers: starts · Scripts launch the backend process