Skip to content

Question/Discussion Introduce CaseManager service layer for centralized case lifecycle handling #57

@sanvishukla

Description

@sanvishukla

Type

Question

Context

While working on recent backend stability improvements, I observed that case lifecycle and storage access logic is currently distributed across multiple route files.
During that review, I ran grep -R "DATA_STORAGE" API/
This showed that Config.DATA_STORAGE is referenced across multiple route files and case-related classes, with path construction and filesystem access occurring directly within route handlers.

(Patial grep output attached as screenshot for reference.)
Image

What is blocked?

There does not appear to be a centralized service responsible for:

  • Case existence validation
  • Case path resolution
  • Safe case listing
  • Case deletion
  • Ensuring consistent session/filesystem state

Requested decision or help

I would like to confirm:

  • Is there an intended architectural layer for case lifecycle management that I may have overlooked?
  • Is the current design (routes directly accessing DATA_STORAGE) intentional?
  • If not, would introducing a minimal CaseManager service layer be aligned with the project’s backend direction?

The goal would not be to change behavior, but simply to understand whether the backend is expected to evolve toward more centralized lifecycle handling or remain route-centric.
I want to make sure I am aligned with the intended architectural direction before proposing any structural refactor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions