Skip to content

refactor(backend): reorganize file structure (no logic change) - #319

Merged
littlecoffe8 merged 2 commits into
mainfrom
refactor/backend-file-structure
Aug 19, 2026
Merged

refactor(backend): reorganize file structure (no logic change)#319
littlecoffe8 merged 2 commits into
mainfrom
refactor/backend-file-structure

Conversation

@littlecoffe8

Copy link
Copy Markdown
Collaborator

Description

business/ and enums/ had become flat bags mixing unrelated
responsibilities, and offline data pipeline scripts were living inside the
runtime application package.

Pure file/folder reorganization of the backend Python package. No behavior
change on the served API - only file moves, renames, and import path
updates.

Code changes

  • Remove app/models/ (empty, unused since project inception)
  • Split the flat business/open_food_facts/ package into:
    • calculators/ (breeding_type, egg_quantity, quantity, product_type,
      pain_report, unit_pain_loader + its pain_data.csv - a data loader
      feeding the calculators, not a rendering concern)
    • panel_renderer/ (generator + html_templates - the actual rendering
      layer, nothing else)
  • Rename knowledge_panel.py -> knowledge_panel_service.py
    (was easily confused with egg_knowledge_panel_generator.py)
  • Split enums/open_food_facts/ into:
    • patterns/ (constant repositories - not real enums)
    • content/ (UI text catalogs)
    • enums.py keeps only actual StrEnum classes
  • Move app/scripts/ -> backend/pipelines/, out of the served app
    package (offline batch scripts, unrelated to the FastAPI runtime)

How to test

pytest: 59 passed (unchanged).

@littlecoffe8
littlecoffe8 merged commit dd7f98b into main Aug 19, 2026
2 checks passed
@littlecoffe8
littlecoffe8 deleted the refactor/backend-file-structure branch August 19, 2026 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant