How techmiresolutions/tms_portal works
Purpose and entry points
This is a full-stack HR/payroll management application. The frontend is a Vite React SPA entered through frontend/src/main.jsx and composed by frontend/src/App.jsx. The backend is a Node.js HTTP API entered through backend/index.js, with deployment configuration in backend/vercel.json.
Backend API boundary
backend/index.js is the server composition point: it connects infrastructure, mounts route modules, and exposes the API runtime. Feature-specific route layers separate request endpoints by domain:
• Authentication: backend/routes/authRoute.js
• Employees/users: backend/routes/userRoute.js
• Payroll: backend/routes/payrollRoute.js
• Former employees and files: backend/routes/exEmployeeRoute.js, backend/routes/fileRoute.js
Routes form the public API boundary; controllers own request handling and domain orchestration.
Domain controllers and persistence
Controller modules implement the application’s operational domains:
• Access/authentication: backend/controllers/authController.js
• Current user/employee management: backend/controllers/userController.js
• Payroll management: backend/controllers/payrollController.js
• Former employee records and file operations: backend/controllers/exEmployeeController.js, backend/controllers/fileController.js
Persistence is accessed through backend/DB/DBconnection.js and domain model modules. Models define the stored entities and isolate database-facing representation from HTTP handling:
backend/models/hrUsers.js, backend/models/userModel.js, backend/models/payrollModel.js, backend/models/exEmployeeModel.js, and backend/models/fileModel.js.
Frontend application composition
The React UI provides workflow pages for login, registration, employee administration, payroll viewing, uploads, and profiles. Primary screen-level boundaries are:
frontend/src/Pages/authPage.jsx, frontend/src/Pages/Allusers.jsx, frontend/src/Pages/RegisterUser.jsx, frontend/src/Pages/ViewDataPage.jsx, frontend/src/Pages/UploadPage.jsx, and frontend/src/Pages/ExEmployeePage.jsx.
Shared application shell and reusable presentation elements live in frontend/src/App.jsx, frontend/src/Components/Navbar.jsx, and frontend/src/Components/Footer.jsx. frontend/src/Components/UserPDF.jsx indicates a client-side employee/PDF presentation or export capability.
Client state and API-driven flows
Feature-scoped stores coordinate UI state and backend interactions:
• Authentication/session state: frontend/src/Store/authStore.js
• User records: frontend/src/Store/userStore.js
• Payroll records: frontend/src/Store/payrollStore.js
• Former employees and uploaded files: frontend/src/Store/exEmployeeStore.js, frontend/src/Store/useFileStore.js
The primary flow is page action → feature store → backend route/controller → model/database → response → store/UI update. This keeps screen components separated from the API and persistence layers.
Validation and business-data boundaries
Frontend schema modules centralize validation or form-data rules before requests cross the API boundary:
frontend/src/Scheema/authScheema.jsx, frontend/src/Scheema/userScheema.jsx, and frontend/src/Scheema/payrollScheema.jsx. Backend controllers and models remain the authoritative boundary for persisted authentication, personnel, payroll, exit-employee, and file data.
Runtime and infrastructure
The frontend uses the Vite build/runtime setup in frontend/vite.config.js and package dependencies declared in frontend/package.json. The backend uses Node.js dependencies in backend/package.json, a database connection abstraction at backend/DB/DBconnection.js, and Vercel-oriented backend deployment configuration at backend/vercel.json. The database service type and any file-storage provider are not identifiable from the supplied tree.
Main entry points: index.js HTTP API · hrUsers.js Domain models · App.jsx App shell · authPage.jsx Workflow pages
Components 17
React frontend
- Vite runtime
frontend/vite.config.js - SPA entry
frontend/src/main.jsx - App shell
frontend/src/App.jsx - Shared UI · Navigation and footer components.
frontend/src/Components/Navbar.jsx - Workflow pages · Login, employee, payroll, upload, and former-employee screens.
frontend/src/Pages/authPage.jsx - Form schemas · Validates auth, user, and payroll input before requests.
frontend/src/Scheema/authScheema.jsx - Feature stores · Owns session, employee, payroll, former-employee, and file API flows.
frontend/src/Store/authStore.js
Node API
- HTTP API · Composes infrastructure and mounts domain routes.
backend/index.js - Auth routes
backend/routes/authRoute.js - HR and payroll routes · Employee and payroll endpoints.
backend/routes/userRoute.js - Exit and file routes · Former-employee and file endpoints.
backend/routes/exEmployeeRoute.js - Auth controller
backend/controllers/authController.js - HR and payroll controllers · Orchestrates employee and payroll operations.
backend/controllers/userController.js - Exit and file controllers · Orchestrates former-employee records and file operations.
backend/controllers/exEmployeeController.js - Vercel deployment
backend/vercel.json
Persistence
- Domain models · Stored representations for users, payroll, former employees, and files.
backend/models/hrUsers.js - Database connection · Database service is unspecified.
backend/DB/DBconnection.js
Connections 18
- Vite runtime → SPA entry: serves/builds
- SPA entry → App shell: renders
- App shell → Shared UI: composes
- App shell → Workflow pages: hosts
- Workflow pages → Form schemas: validates input
- Workflow pages → Feature stores: uses
- Feature stores → HTTP API: HTTP requests
- HTTP API → Auth routes: mounts
- HTTP API → HR and payroll routes: mounts
- HTTP API → Exit and file routes: mounts
- Auth routes → Auth controller: dispatches
- HR and payroll routes → HR and payroll controllers: dispatches
- Exit and file routes → Exit and file controllers: dispatches
- Auth controller → Domain models: persists through
- HR and payroll controllers → Domain models: persists through
- Exit and file controllers → Domain models: persists through
- Domain models → Database connection: uses
- Vercel deployment → HTTP API: deploys