A Spring Boot-based RESTful API with an Angular frontend for managing approval workflows in an organizational hierarchy.
- Authentication with JWT tokens
- Employee management (create, update, delete, toggle availability)
- Supervisor assignment
- Approval workflows (submit, approve, reject, escalate)
- Dashboard with tabs for approvers to view pending requests
- Role-based access control
- Java 17 or higher
- Node.js and npm
- MySQL Database
- Maven
- Create a MySQL database named
test - Use the following credentials:
- Username:
root - Password:
root
- Username:
- Clone the repository
- Navigate to the project directory
- Run the Spring Boot application using Maven:
mvn spring-boot:run
The application will start on port 8080.
- Navigate to the Angular project directory:
cd src/main/resources/static
- Install dependencies:
npm install
- Start the Angular development server:
ng serve
The Angular application will be available on http://localhost:4200.
The system comes with three default users:
-
Supervisor
- Email: alice@example.com
- Password: alice123
- Role: SUPERVISOR
-
Manager
- Email: bob@example.com
- Password: bob123
- Role: MANAGER
-
Employee
- Email: charlie@example.com
- Password: charlie123
- Role: EMPLOYEE
- Access the login page at (http://localhost:9090/)
- Enter your email and password
- Click "Login"
The dashboard displays tabs for each employee who can approve requests. Each tab shows the pending requests for that employee.
- View requests assigned to you
- Approve or reject requests using the respective buttons
- Escalate requests to a higher approver if needed
- View all employees
- Create new employees
- Update employee details
- Delete employees
- Toggle employee availability
- Assign or change supervisors
- Fill out the request form
- Select the requester (self or others if permitted)
- Provide a description
- Submit the request
POST /api/auth/login: Authenticate a user
GET /api/employees: Get all employeesGET /api/employees/{id}: Get employee by IDPOST /api/employees: Create a new employeePUT /api/employees/{id}: Update an employeeDELETE /api/employees/{id}: Delete an employeePUT /api/employees/{id}/supervisor: Update an employee's supervisorPUT /api/employees/{id}/toggle-availability: Toggle an employee's availability
GET /api/approvals: Get all approval requestsGET /api/approvals/{id}: Get approval request by IDGET /api/approvals/employee/{employeeId}: Get approval requests by employeeGET /api/approvals/approver/{approverId}: Get approval requests by approverPOST /api/approvals: Submit a new approval requestPUT /api/approvals/{id}/approve: Approve a requestPUT /api/approvals/{id}/reject: Reject a requestPUT /api/approvals/{id}/escalate: Escalate a request
The application uses JWT tokens for authentication. All API endpoints (except for authentication) are protected and require a valid JWT token in the Authorization header.
- If you encounter database connection issues, ensure your MySQL server is running and the credentials are correct.
- For JWT token issues, check that the token hasn't expired (default expiration is 24 hours).
- If the Angular application can't connect to the backend, verify that the Spring Boot application is running and CORS is properly configured.