How youngoat911/inventory works
Gymkhana Inventory is a web-based equipment inventory and borrowing system. Users authenticate in the React client, navigate operational pages, and send requests through a shared API client to protected REST routes; domain modules implement inventory, loans, transfers, and related workflows. The README also documents purchasing, maintenance, disposal, verification, reporting, audit, notifications, and alerts. The graph uses documented route and import relationships where available; links among unsampled domain internals are omitted rather than inferred.
Main entry points: api.routes.js API route registry · App.jsx React application · client.js API client · app.js Express application
Components 30
Web client
- React application
frontend/src/App.jsx - Session context
frontend/src/auth/AuthContext.jsx - API client
frontend/src/api/client.js - Asset catalog
frontend/src/pages/Assets.jsx - Catalog views
frontend/src/pages/Catalog.jsx - Loan workflow
frontend/src/pages/Issues.jsx - Loading skeletons
frontend/src/components/Skeleton.jsx - Notification context
frontend/src/context/NotificationContext.jsx - Toast context
frontend/src/context/ToastContext.jsx
API runtime
- Express application
src/app.js - API route registry
src/routes/api.routes.js - PostgreSQL
src/db/pool.js - Structured logging
src/utils/logger.js
Identity and access
- Authentication
src/modules/auth/auth.controller.js - PASETO tokens
src/utils/paseto.util.js - Role authorization
src/middleware/authorize.js - User records
src/modules/users/users.repository.js - Role assignments
src/modules/roles/roles.repository.js
Inventory workflows
- Asset management
src/modules - Checkout and returns
src/modules/issues/issues.controller.js - Borrower restrictions
src/modules/borrower-blocks/borrower-blocks.controller.js - Custody transfers
src/modules/transfers/transfers.controller.js - Purchasing and vendors
src/modules/purchases/purchases.controller.js
Operations and insight
- Maintenance and disposal
src/modules - Inventory verification
src/modules/verifications - Threshold and overdue alerts
src/modules/alerts/alerts.controller.js - Reports and analytics
src/modules/reports/reports.controller.js - Audit log
src/modules/audit-log - Notifications and realtime
src/services/websocket.service.js
Other components
- Inventory user
Connections 33
- Inventory user → React application: uses
- React application → Session context: checks session
frontend/src/App.jsx - React application → Loading skeletons: renders loading
frontend/src/App.jsx - React application → Asset catalog: routes to
frontend/src/App.jsx - React application → Catalog views: routes to
frontend/src/App.jsx - React application → Loan workflow: routes to
frontend/src/App.jsx - Session context → API client: calls auth API
frontend/src/auth/AuthContext.jsx - Asset catalog → API client: requests data
- Catalog views → API client: requests data
- Loan workflow → API client: requests data
- Inventory user → API client: receives alerts
- API client → Express application: sends HTTP requests
- Express application → API route registry: mounts API
src/app.js - API route registry → Authentication: mounts auth routes
src/routes/api.routes.js - API route registry → Asset management: mounts asset routes
src/routes/api.routes.js - API route registry → Checkout and returns: mounts issue routes
src/routes/api.routes.js - API route registry → Borrower restrictions: mounts block routes
src/routes/api.routes.js - API route registry → Custody transfers: mounts transfer routes
src/routes/api.routes.js - API route registry → Purchasing and vendors: mounts purchase routes
src/routes/api.routes.js - API route registry → Threshold and overdue alerts: mounts alert routes
src/routes/api.routes.js - API route registry → Reports and analytics: mounts report routes
src/routes/api.routes.js - API route registry → Maintenance and disposal: mounts domain routes
src/routes/api.routes.js - API route registry → Inventory verification: mounts verification routes
src/routes/api.routes.js - API route registry → Audit log: mounts audit routes
src/routes/api.routes.js - API route registry → Notifications and realtime: mounts notification routes
src/routes/api.routes.js - Authentication → PASETO tokens: generates tokens
src/modules/auth/auth.controller.js - Authentication → Role assignments: loads roles
src/modules/auth/auth.controller.js - Authentication → PostgreSQL: persists credentials
src/modules/auth/auth.controller.js - Role authorization → PostgreSQL: checks scoped access
src/middleware/authorize.js - Notifications and realtime → User records: authenticates user
src/services/websocket.service.js - Notifications and realtime → Role assignments: loads roles
src/services/websocket.service.js - Express application → PostgreSQL: checks health
src/app.js - Express application → Structured logging: logs errors