How dwisusanto29/payslip_system works
Payslip System is an Express API for employee payroll. Employees register or log in, submit attendance, overtime and reimbursement data, then retrieve generated payslips; administrators define attendance periods, run payroll and view period summaries. Routes apply authentication and admin authorization before invoking controllers, which query PostgreSQL through the shared connection pool. The sampled controllers show payroll calculations and payslip reads. The README documents the API capabilities; implementation details are based on the sampled source files.
Main entry points: index.js Express server · userRoutes.js User routes · adminRoutes.js Admin routes · database.js PostgreSQL connection pool
Components 10
API entry
- Express server
src/index.js - User routes
src/routes/userRoutes.js - Admin routes
src/routes/adminRoutes.js
Identity and access
- JWT access checks
src/middleware/authMiddleware.js
Workforce inputs
- User operations
src/controllers/userController.js
Payroll and reporting
- Payroll operations
src/controllers/adminController.js
Persistence
- PostgreSQL connection pool
src/config/database.js - PostgreSQL data
src/models/schema.sql
Other components
- Employee
- Administrator
Connections 11
- Employee → Express server: sends API requests
- Administrator → Express server: sends API requests
- Express server → User routes: mounts user routes
- Express server → Admin routes: mounts admin routes
- User routes → User operations: dispatches user actions
- User routes → JWT access checks: checks protected requests
- Admin routes → JWT access checks: checks admin access
- Admin routes → Payroll operations: dispatches admin actions
- User operations → PostgreSQL connection pool: queries user data
- Payroll operations → PostgreSQL connection pool: queries payroll data
- PostgreSQL connection pool → PostgreSQL data: reads and writes