skip to content
Mohamed Azahrioui
← work

Backend API · 2025-2026

Procurement Risk API

A FastAPI backend for invoice data retrieval, risk detection, analytics, CSV ingestion, and secure API access.

snapshot
type
Backend API
period
2025-2026
source
public github

view 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
  • Risk rules for duplicate invoices, below-threshold amounts, and weekend transactions
  • CSV-to-PostgreSQL ingestion pipeline with a dedicated pipeline endpoint
  • JWT and OAuth2 Bearer authentication with bcrypt password hashing
  • PostgreSQL schema via SQLAlchemy with protected routes
  • Analytics summary endpoint for invoices, risk signals, and severity counts
  • Swagger/OpenAPI documentation through /docs

example endpoints

GET /invoicesGET /risk-signalsGET /analytics/summaryPOST /pipeline/runPOST /auth/registerPOST /auth/login

tech stack

PythonFastAPIPostgreSQLSQLAlchemyJWTOAuth2bcryptSwagger / OpenAPIUvicorn

Read the source

The repo has the code, structure, and implementation detail.