How vijaysaiyerra/box-packing-service works
This is a FastAPI shipping-box recommendation service. A caller submits package data; the API validates it, checks IDs, and delegates packing, then returns box assignments and weight totals. A separate endpoint exposes the fixed box catalogue, while error handlers format validation and operational failures. Versioned API requests are also recorded in an Excel workbook. The route implementation in app/main.py was not sampled, so endpoint-to-service links rely on the README’s documented API behavior; middleware registration is not shown.
Main entry points: box_service.py Box service · main.py Box-count endpoint · schemas.py Request and response models · packing.py Packing algorithm
Components 10
API and validation
- Box-count endpoint
app/main.py - Box-options endpoint
app/main.py - Request and response models
app/schemas.py - Error responses
app/errors.py
Packing domain
- Box service
app/services/box_service.py - Box catalogue
app/services/boxes.py - Packing algorithm
app/services/packing.py
Request logging
- Request logger
app/excel_logging.py - Request workbook
Other components
- API caller
Connections 14
- API caller → Box-count endpoint: submits packages
README.md - API caller → Box-options endpoint: requests options
README.md - Box-count endpoint → Request and response models: validates input
README.md - Box-count endpoint → Box service: requests packing
README.md - Box-options endpoint → Box service: requests catalogue
README.md - Box service → Box catalogue: reads boxes
app/services/box_service.py - Box service → Packing algorithm: packs packages
app/services/box_service.py - Packing algorithm → Box catalogue: checks box types
app/services/packing.py - Box service → Request and response models: builds response
app/services/box_service.py - Box service → Error responses: raises API errors
app/services/box_service.py - Box-count endpoint → Error responses: formats failures
- Box-options endpoint → Request and response models: returns box data
- API caller → Request logger: request captured
README.md - Request logger → Request workbook: appends request
app/excel_logging.py