06

System Design

PythonFastAPIPydanticREST APILoad testing

Overview

Basket recommendation model served as a production-grade REST API. Architecture designed in Excalidraw before implementation. Model loaded from a joblib artifact via a feature store, with one handler file per endpoint.

Endpoints

  • arrow_forwardGET /status: health check
  • arrow_forwardPOST /predict: returns basket recommendations for a given user_id
  • arrow_forwardGET /metrics: Prometheus-compatible metrics in plain text format

Architecture

  • arrow_forwardFull routers / services / utils / models / exceptions layer separation
  • arrow_forwardPydantic schemas for request and response validation
  • arrow_forwardPostman collection with JSON tests for endpoint validation
  • arrow_forwardLoad tested with attack.sh

Diagram

System design diagram for System Design

PDF Resources