Backend API | 2025-2026
Procurement Risk API
A FastAPI backend for invoice data retrieval, risk detection, analytics, CSV ingestion, and secure API access.
Project snapshot
- Type
- Backend API
- Period
- 2025-2026
- Source
- Public GitHub repository
Problem
Invoice data often needs to be checked for risk signals such as duplicate invoices, suspicious timing, and below-threshold amounts. This project turns that logic into a structured backend API.
Outcomes
Turned invoice risk rules into inspectable API behavior
Kept data access, auth, risk checks, and analytics separated
Documented the backend automatically through OpenAPI
What I built
REST endpoints for invoice retrieval, risk detection, and analytics
PostgreSQL database schema using SQLAlchemy ORM
User and Invoice models
CSV-to-PostgreSQL ingestion pipeline
Dedicated pipeline endpoint for structured data loading
JWT authentication using HS256
OAuth2 Bearer token authentication
Protected API routes
bcrypt password hashing for registration and login
Risk detection for duplicate invoices
Risk detection for below-threshold amounts
Risk detection for weekend transaction signals
Analytics summary endpoint for invoices, risk signals, and severity counts
Modular backend structure with routers, services, and models
Swagger/OpenAPI documentation through /docs
Example endpoints
GET /invoicesGET /risk-signalsGET /analytics/summaryPOST /pipeline/runPOST /auth/registerPOST /auth/loginTech stack
PythonFastAPIPostgreSQLSQLAlchemyJWTOAuth2bcryptSwagger / OpenAPIUvicorn
View the source code
The repository includes the code, structure, and implementation details for this project.