How nguyenhuy2405-vn/japfa works
Japfa is a multi-role farm operations platform covering authentication, farm flock and feed monitoring, inventory, orders, transfers, administration, audit, notifications, and background processing. The principal workflow is: a farm, operator, or administrator signs in; role-specific screens request operational data or submit commands; domain services query or mutate Payload collections; results return as dashboards, status views, alerts, and audit records. The tree shows both the older role UI/API application and a newer platform backend, but sampled source does not establish all cross-application links.
Components 25
Access and Roles
- Login API
japfa-payload/src/app/api/auth/login/route.ts - Auth Session
japfa-payload/src/server/auth.ts
Role Interfaces
- Farm Interface
japfa-payload/src/app/(app)/(farm)/farm/dashboard/page.tsx - Operations Interface
japfa-payload/src/app/(app)/(operation)/operation/dashboard/page.tsx - Admin Interface
japfa-payload/src/app/(app)/(admin)/admin/dashboard/page.tsx - Legacy Data API
japfa-payload/src/app/api/japfa-data/route.ts
Farm Operations
- Order Queries
japfa-payload/src/services/oms/oms.query.service.ts - Order Commands
japfa-payload/src/services/oms/oms.command.service.ts - Flock Monitoring
japfa-payload/src/services/fms/fms.query.service.ts - Inventory Queries
japfa-payload/src/services/wms/wms.query.service.ts - Setup Services
japfa-payload/src/services/setup/setup.command.service.ts
Platform Services
- Admin Operations
japfa-platform/src/app/api/admin - Order Workflows
japfa-platform/src/workflows/approve-order.ts - Transfer Workflows
japfa-platform/src/workflows/transfer-request.ts - Job Runtime
japfa-platform/src/jobs/tasks/index.ts - Notifications
japfa-platform/src/services/notification/notification.service.ts - Audit Records
japfa-platform/src/collections/AuditLogs.ts - Redis Cache
japfa-platform/src/lib/redis.ts
Operational Storage
- Users and Tenants
japfa-payload/src/collections/Users.ts - Orders and Transfers
japfa-payload/src/collections/Orders.ts - Flock and Feed Data
japfa-payload/src/collections/FmsDailyLogs.ts - Inventory Ledger
japfa-payload/src/collections/WmsTransactions.ts
Other components
- Farm User
- Operations User
- Administrator
Connections 29
- Farm User → Login API: signs in
- Operations User → Login API: signs in
- Administrator → Login API: signs in
- Login API → Users and Tenants: checks credentials
- Login API → Auth Session: creates session
- Login API → Farm Interface: redirects role
- Login API → Operations Interface: redirects role
- Login API → Admin Interface: redirects role
- Farm User → Farm Interface: uses dashboard
- Operations User → Operations Interface: uses dashboard
- Administrator → Admin Interface: uses dashboard
- Legacy Data API → Order Queries: loads orders
- Legacy Data API → Order Commands: dispatches order
- Legacy Data API → Inventory Queries: loads inventory
- Legacy Data API → Flock Monitoring: loads flock logs
- Legacy Data API → Setup Services: updates setup
- Order Queries → Orders and Transfers: reads orders
- Flock Monitoring → Flock and Feed Data: reads logs
- Flock Monitoring → Flock and Feed Data: reads standards
- Inventory Queries → Inventory Ledger: reads ledger
- Inventory Queries → Flock and Feed Data: reads flock logs
- Admin Operations → Users and Tenants: manages farms
- Admin Operations → Audit Records: records actions
- Admin Operations → Job Runtime: queues bulk work
- Order Workflows → Orders and Transfers: changes orders
- Transfer Workflows → Orders and Transfers: changes transfers
- Job Runtime → Notifications: runs notifications
- Notifications → Audit Records: persists events
- Admin Operations → Redis Cache: caches KPI