How vasanthpapa/smartsalary works
SmartSalary manages workforce records, attendance, and salary calculations through a React dashboard backed by an Express API. The main workflow is admin login, employee and attendance management, optional biometric attendance sync, and salary calculation/reporting. The graph includes the documented real-time capability, but the sampled excerpts do not show the client’s socket handling or the rules UI implementation; those links are therefore omitted. Biometric sync and storage behavior are represented from the excerpts; some UI-to-API connections remain unverified.
Main entry points: App.jsx App shell · index.js Express server · biometricSync.js Biometric sync · attendance.js Attendance API
Components 28
Workforce app
- App shell
client/src/App.jsx - Login
client/src/pages/Login.jsx - Dashboard
client/src/pages/Dashboard.jsx - Employees
client/src/pages/Employees.jsx - Attendance
client/src/pages/Attendance.jsx - Bulk attendance
client/src/components/BulkAttendanceTable.jsx - Individual report
client/src/components/IndividualReport.jsx - Monthly report
client/src/components/MonthlyReportModal.jsx - Late tracker
client/src/components/MonthlyLateTracker.jsx - Salary calculator
client/src/pages/Calculator.jsx - Workforce state
client/src/context/WorkforceContext.jsx - Context interface
client/src/context/workforceShared.js
API and access
- Express server
server/index.js - Login API
server/routes/auth.js - Employee API
server/routes/employees.js - Attendance API
server/routes/attendance.js - Rules API
server/routes/rules.js - System API
server/routes/system.js - Token verification
server/middlewares/auth.js
Workforce services
- Biometric sync
server/services/biometricSync.js
Data storage
- Employee records
server/models/Employee.js - Attendance records
server/models/Attendance.js - Rules records
server/models/Rules.js - Demo store
server/config/mockStore.js - Storage selection
server/config/db.js
Other components
- Admin
- eTimeOffice
- MongoDB Atlas
Connections 42
- Admin → App shell: uses
client/src/App.jsx - App shell → Login: shows
client/src/App.jsx - App shell → Dashboard: routes to
client/src/App.jsx - App shell → Employees: routes to
client/src/App.jsx - App shell → Attendance: routes to
client/src/App.jsx - App shell → Salary calculator: routes to
client/src/App.jsx - App shell → Workforce state: reads state
- Workforce state → Context interface: uses interface
client/src/context/WorkforceContext.jsx - App shell → Context interface: uses hook
client/src/App.jsx - Attendance → Bulk attendance: renders
client/src/pages/Attendance.jsx - Attendance → Individual report: renders
client/src/pages/Attendance.jsx - Attendance → Monthly report: renders
client/src/pages/Attendance.jsx - Dashboard → Late tracker: renders
client/src/pages/Dashboard.jsx - Dashboard → Context interface: uses
client/src/pages/Dashboard.jsx - Employees → Context interface: uses
client/src/pages/Employees.jsx - Salary calculator → Context interface: uses
client/src/pages/Calculator.jsx - Express server → Storage selection: initializes
server/index.js - Express server → Login API: mounts
server/index.js - Express server → Employee API: mounts
server/index.js - Express server → Attendance API: mounts
server/index.js - Express server → Rules API: mounts
server/index.js - Express server → System API: mounts
server/index.js - Express server → Token verification: protects routes
server/index.js - Admin → Login API: submits credentials
- Employee API → Employee records: reads and writes
server/routes/employees.js - Employee API → Demo store: uses fallback
server/routes/employees.js - Employee API → Biometric sync: uses credentials
server/routes/employees.js - Attendance API → Attendance records: reads and writes
server/routes/attendance.js - Attendance API → Employee records: uses records
server/routes/attendance.js - Attendance API → Demo store: uses fallback
server/routes/attendance.js - Attendance API → Biometric sync: dispatches sync
server/routes/attendance.js - Rules API → Rules records: uses records
server/routes/rules.js - Rules API → Demo store: uses fallback
server/routes/rules.js - Biometric sync → eTimeOffice: fetches punches
server/services/biometricSync.js - Biometric sync → Employee records: loads employees
server/services/biometricSync.js - Biometric sync → Attendance records: loads and saves
server/services/biometricSync.js - Biometric sync → Demo store: uses fallback
server/services/biometricSync.js - Biometric sync → Storage selection: checks storage mode
server/services/biometricSync.js - Storage selection → MongoDB Atlas: connects
server/config/db.js - Employee records → MongoDB Atlas: persists
- Attendance records → MongoDB Atlas: persists
- Rules records → MongoDB Atlas: persists