How dracula-5/procurax works
ProcuraX is a multi-tenant procurement platform whose main workflow takes a user from authenticated purchase-request submission through policy-controlled approval and budget checks into purchase-order, receipt, invoice-matching, and payment-approval stages. The React SPA is the user surface; a FastAPI modular monolith hosts domain rules and procurement services, with PostgreSQL providing tenant-scoped persistence and audit history. The README documents additional spend intelligence, sourcing, and invoice-assistance capabilities. Some feature modules were not sampled, so their internal call paths are not asserted.
Main entry points: router.py API router · procurement/service.py Request approvals · audit/service.py Audit trail · App.tsx React SPA
Components 21
Web application
- React SPA
frontend/src/App.tsx - API client
frontend/src/lib/api.ts - Session context
frontend/src/auth/AuthContext.tsx - Procurement screens
frontend/src/pages/PurchaseToPay.tsx
API and identity
- FastAPI entry
backend/app/main.py - API router
backend/app/api/router.py - Identity service
backend/app/modules/identity/service.py - Authenticated principal
backend/app/api/deps.py
Procurement workflow
- Request approvals
backend/app/modules/procurement/service.py - P2P records
backend/app/modules/procurement/records_router.py - Delegation and escalation
backend/app/modules/procurement - Vendor master
backend/app/modules/vendors/service.py - Organization and budgets
backend/app/modules/organization/service.py
Domain and intelligence
- Policy evaluation
backend/app/domain/policy/engine.py - Request state machine
backend/app/domain/workflow/purchase_request.py - Spend and invoice AI
backend/app/ml - Sourcing support
backend/app/modules/procurement/decision_support.py - Procurement assistant
backend/app/modules/procurement/assistant.py
Persistence and governance
- Audit trail
backend/app/modules/audit/service.py - Tenant database
backend/app/core/db.py
Other components
- Procurement user
Connections 26
- Procurement user → React SPA: uses
README.md - React SPA → Session context: loads session
frontend/src/App.tsx - React SPA → Procurement screens: routes to
frontend/src/App.tsx - Procurement screens → API client: requests data
- Session context → API client: uses
frontend/src/auth/AuthContext.tsx - API client → FastAPI entry: calls API
README.md - FastAPI entry → API router: registers
backend/app/main.py - API router → Identity service: routes identity
backend/app/api/router.py - API router → Request approvals: routes procurement
- API router → P2P records: routes records
backend/app/api/router.py - API router → Vendor master: routes vendors
backend/app/api/router.py - API router → Procurement assistant: routes assistant
backend/app/api/router.py - Identity service → Audit trail: records actions
backend/app/modules/identity/service.py - Authenticated principal → Tenant database: binds tenant
backend/app/api/deps.py - Request approvals → Policy evaluation: evaluates rules
backend/app/modules/procurement/service.py - Request approvals → Request state machine: checks transitions
backend/app/modules/procurement/service.py - Request approvals → Organization and budgets: uses organization services
backend/app/modules/procurement/service.py - Request approvals → Audit trail: records decisions
backend/app/modules/procurement/service.py - P2P records → Audit trail: records changes
backend/app/modules/procurement/records_router.py - P2P records → Tenant database: reads and writes
backend/app/modules/procurement/records_router.py - Vendor master → Audit trail: records changes
backend/app/modules/vendors/service.py - Organization and budgets → Audit trail: records changes
backend/app/modules/organization/service.py - Sourcing support → Spend and invoice AI: ranks vendors
- Procurement assistant → Spend and invoice AI: retrieves knowledge
README.md - Audit trail → Tenant database: stores entries
backend/app/modules/audit/service.py - Delegation and escalation → Request approvals: supports workflow
README.md