Multi-Company SaaS Payroll Engine with progressive tax calculation, BPJS simulation, overtime calculation, and complete payroll management.
- Multi-Tenant Architecture - Support multiple companies with data isolation
- Progressive Tax Calculation - Indonesia tax bracket system (PPh 21)
- BPJS Simulation - Employer & employee contribution calculations
- Overtime Calculation - Weekday, weekend, and holiday rates
- Payroll Workflow - Draft β Approve β Lock lifecycle
- Audit Logging - Complete audit trail for all changes
- Payslip PDF - Generate payslip PDF documents
- CSV Export - Bank transfer file generation
- JWT Authentication - Secure role-based access control
- Swagger/OpenAPI - Interactive API documentation
- Docker Support - Complete containerization
- Docker and Docker Compose
- Java 21 (for local development)
- Maven 3.9+
cd "/Users/admin/Documents/seno/PayrollTax Pro API/PayrollTax Pro API"docker-compose up -dThis will start:
- PostgreSQL on port 5432
- Redis on port 6379
- Backend API on port 8081
curl http://localhost:8081/api/healthOpen your browser and navigate to:
http://localhost:8081/api/swagger-ui.html
curl http://localhost:8081/api/v3/api-docs -o openapi.json- Username:
admin - Password:
admin123
| Company | Username | Role |
|---|---|---|
| PT Maju Jaya Sejahtera | budi.maju |
Manager, Finance |
| PT Maju Jaya Sejahtera | siti.maju |
Employee |
| CV Teknologi Nusantara | andi.teknologi |
Admin, Manager |
| CV Teknologi Nusantara | dewi.teknologi |
Finance |
| PT Solusi Digital Indonesia | reza.digital |
Manager, Finance |
| PT Ritel Modern Indonesia | wulan.ritel |
Manager |
The application comes with real Indonesian seed data:
- PT Maju Jaya Sejahtera
- CV Teknologi Nusantara
- PT Solusi Digital Indonesia
- PT Ritel Modern Indonesia
- PT Konsultan Prima
- Various salary levels from Staff to C-Level
- Different tax statuses (TK0, TK1, TK2, TK3, K0, K1, K2, K3)
- Multiple banks (BCA, Mandiri, BNI, BRI, Jago)
- Real Indonesian NPWP numbers
- 14 salary grades from Junior Staff to C-Level
- Competitive Indonesian market rates (2024)
- 5 progressive tax brackets (Indonesia PPh 21)
- Download the Postman collection from
postman/PayrollTax_Pro_API.postman_collection.json - Import the collection into Postman
- Import the environment from
postman/PayrollTax_Pro_API_Local.postman_environment.json
POST {{baseUrl}}/auth/login
Content-Type: application/json
{
"username": "admin",
"password": "admin123"
}POST {{baseUrl}}/payroll/process
Authorization: Bearer {{token}}
Content-Type: application/json
{
"month": 1,
"year": 2024,
"employeeIds": [1, 2, 3, 4, 5],
"defaultOvertimeHours": 10
}GET {{baseUrl}}/payroll/summary?tenantId=1&month=1&year=2024
Authorization: Bearer {{token}}POST {{baseUrl}}/payroll/1/approve
Authorization: Bearer {{token}}
Content-Type: application/json
{
"payrollId": 1,
"action": "APPROVE",
"notes": "Approved for payment"
}GET {{baseUrl}}/payroll/1/payslip
Authorization: Bearer {{token}}http://localhost:8081/api/swagger-ui.html
http://localhost:8081/api/v3/api-docs
http://localhost:8081/api/v3/api-docs.yaml
| Variable | Default | Description |
|---|---|---|
SPRING_DATASOURCE_URL |
jdbc:postgresql://localhost:5432/payrolltax | Database URL |
SPRING_DATASOURCE_USERNAME |
payrolluser | Database username |
SPRING_DATASOURCE_PASSWORD |
payrollpass | Database password |
SPRING_DATA_REDIS_HOST |
localhost | Redis host |
SPRING_DATA_REDIS_PORT |
6379 | Redis port |
JWT_SECRET |
(default) | JWT signing secret |
JWT_EXPIRATION |
900000 | JWT expiration (ms) |
- Employer percentage: 5%
- Employee percentage: 2%
- Salary cap: Rp 12.000.000
- Weekday: 1.5x
- Weekend: 2.0x
- Holiday: 2.0x
src/main/java/com/payrolltaxpro/
βββ config/ # Configuration classes
β βββ SecurityConfig.java
β βββ OpenApiConfig.java
β βββ RedisCacheConfig.java
β βββ TenantContext.java
βββ controller/ # REST controllers
βββ service/ # Business logic
βββ repository/ # JPA repositories
βββ domain/ # Entities
βββ dto/ # Data transfer objects
βββ security/ # JWT authentication
βββ exception/ # Global exception handling
Image: postgres:16-alpine
Port: 5432
Database: payrolltax
Username: payrolluser
Password: payrollpassImage: redis:7-alpine
Port: 6379Image: payrolltax-api (built from Dockerfile)
Port: 8081- JWT-based authentication
- Role-based access control (RBAC)
- Roles: ADMIN, MANAGER, FINANCE, EMPLOYEE
- Password hashing with BCrypt
- CSRF protection disabled for API
- Tenant isolation via
X-Tenant-IDheader - Schema-per-tenant approach (optional)
- JWT claim-based tenant resolution
- Redis-based caching for:
- Payroll locks
- Tax brackets
- Salary structures
- All payroll changes tracked
- User, timestamp, and IP address logged
- Before/after values stored
docker build -t payrolltax-api:latest .docker-compose -f compose.yaml up -dSPRING_PROFILES_ACTIVE=production docker-compose up -dMIT License
For issues and questions:
- Email: support@payrolltax.local
- Documentation: See
/docfolder - API Docs: http://localhost:8081/api/swagger-ui.html
Built with β€οΈ using Spring Boot 3, Java 21, and PostgreSQL