ProcureGuard AI is a full-stack procurement audit application that helps teams inspect procurement records, compare purchase orders with goods-received notes and invoices, identify suspicious patterns, and route exceptions for human review.
This repository is a runnable MVP foundation. Its matching and risk checks are deterministic, explainable rules—not claims of autonomous financial approval or proven fraud detection. Production deployment requires authentication, authorization, encryption, retention controls, stronger document parsing, and independent validation.
flowchart LR
U[User] --> FE[React + TypeScript]
FE --> API[FastAPI REST API]
API --> DB[(SQL database)]
API --> FS[(Uploaded files)]
API --> M[Matching and risk rules]
M --> Q[Human review queue]
Q --> A[Audit events]
Requirements:
cd backend
python -m venv .venv
# Windows PowerShell
.venv\Scripts\Activate.ps1
# macOS/Linux
# source .venv/bin/activate
pip install -r requirements.txt
Create your environment file from the project root:
Copy-Item .env.example backend/.env
For the default SQLite setup, start the API:
uvicorn app.main:app --reload
API documentation:
http://localhost:8000/docs
Open another terminal:
cd frontend
npm install
npm run dev
Open:
http://localhost:5173
The frontend expects the API at:
http://localhost:8000
Set VITE_API_URL if needed.
From the backend directory, with the virtual environment activated:
python -m scripts.seed_demo
Then run an audit using:
POST /api/audits/run
The sample invoice intentionally exceeds the received quantity and contracted unit price.
From the repository root:
docker compose up --build
Frontend:
http://localhost:5173
API:
http://localhost:8000/docs
The Compose configuration uses PostgreSQL. The default local Python instructions use SQLite.
POST /api/audits/run.GET /api/reviews.POST /api/reviews/{id}/decision.| Method | Endpoint | Purpose |
|---|---|---|
| GET | /api/health |
Health check |
| GET/POST | /api/vendors |
List/create vendors |
| GET/POST | /api/documents |
List/upload documents |
| GET/POST | /api/records/purchase-orders |
Purchase orders |
| GET/POST | /api/records/receipts |
Goods-received notes |
| GET/POST | /api/records/invoices |
Invoices |
| GET/POST | /api/records/contracts |
Vendor contracts |
| POST | /api/audits/run |
Run matching and risk checks |
| GET | /api/audits |
List audit findings |
| GET | /api/reviews |
Review queue |
| POST | /api/reviews/{id}/decision |
Record human decision |
| GET | /api/audit-trail |
Audit event history |
| GET | /api/dashboard |
Dashboard metrics |
A purchase order, receipt and invoice are linked by their reference numbers.
The engine compares:
The sample risk rules detect:
These signals are indicators for investigation, not proof of fraud.
cd backend
pytest
.env.MIT — see LICENSE.