How itsriku237/assetflow works
ADP AssetHub manages company IT assets from inventory and employee custody through requests, returns, repair, and retirement, with reimbursements and audit history. Employees and administrators use role-specific dashboards; admins also manage employees and administrator accounts. The documented flow is Next.js pages/components → server actions and data services → Prisma-backed PostgreSQL. Auth.js handles sign-in and server-side role checks; onboarding includes OTP email activation. Workflow capabilities and several connections are based on the README because their implementation was not sampled.
Main entry points: activation-actions.ts Activation actions · asset-actions.ts Asset operations · return-request-actions.ts Return workflow · maintenance-actions.ts Repairs and maintenance
Components 24
Access and onboarding
- Sign-in pages
src/app/(auth)/login/page.tsx - Sign-in actions
src/lib/actions/auth-actions.ts - Auth.js
src/auth.ts - Employee activation
src/components/auth/activation-form.tsx - Activation actions
src/lib/actions/activation-actions.ts - Role guards
src/lib/auth-guards.ts
Asset lifecycle
- Asset views
src/app/(dashboard)/available-assets/page.tsx - Asset operations
src/lib/actions/asset-actions.ts - Lifecycle rules
src/lib/asset-lifecycle.ts - Custody assignments
src/lib/actions/assignment-actions.ts - Return workflow
src/lib/actions/return-request-actions.ts - Repairs and maintenance
src/lib/actions/maintenance-actions.ts
Requests and expenses
- Asset requests
src/lib/actions/asset-request-actions.ts - Reimbursements
src/lib/actions/reimbursement-actions.ts
Administration and oversight
- Employee directory
src/lib/actions/employee-actions.ts - Audit trail
src/lib/audit.ts - Notifications
src/lib/notifications.ts - Admin management
src/lib/actions/admin-actions.ts
Application and persistence
- Role dashboards
src/components/dashboard/employee-dashboard.tsx - Domain data services
src/lib/data/assets.ts - Prisma client
src/lib/prisma.ts - PostgreSQL
Other components
- Employees and admins
- Resend email
Connections 37
- Employees and admins → Sign-in pages: signs in
- Sign-in pages → Sign-in actions: submits credentials
- Sign-in actions → Auth.js: calls sign-in
- Auth.js → PostgreSQL: reads and links users
- Employees and admins → Employee activation: activates account
- Employee activation → Activation actions: submits OTP
- Activation actions → Resend email: sends OTP
- Activation actions → PostgreSQL: updates account
- Employees and admins → Role guards: requests protected access
- Role guards → Auth.js: resolves session
- Employees and admins → Role dashboards: uses dashboard
- Role dashboards → Asset views: links to assets
- Asset views → Domain data services: loads asset data
- Employees and admins → Employee directory: administers directory
- Employee directory → PostgreSQL: writes directory
- Employees and admins → Asset operations: manages inventory
- Asset operations → Lifecycle rules: applies transitions
- Asset operations → PostgreSQL: writes assets
- Employees and admins → Custody assignments: assigns assets
- Custody assignments → PostgreSQL: creates custody record
- Employees and admins → Asset requests: requests asset
- Asset requests → Custody assignments: creates assignment on approval
- Asset requests → PostgreSQL: stores request
- Employees and admins → Return workflow: requests return
- Return workflow → Lifecycle rules: updates asset state
- Return workflow → PostgreSQL: stores review
- Employees and admins → Repairs and maintenance: manages repairs
- Repairs and maintenance → Lifecycle rules: updates asset state
- Repairs and maintenance → PostgreSQL: stores repair history
- Employees and admins → Reimbursements: submits or reviews claim
- Reimbursements → PostgreSQL: stores claim
- Employees and admins → Admin management: manages admins
- Admin management → PostgreSQL: updates admin accounts
- Audit trail → PostgreSQL: appends events
- Notifications → PostgreSQL: stores alerts
- Domain data services → Prisma client: queries through
- Prisma client → PostgreSQL: reads and writes