🗂️ Issue: Remove container.ts (legacy DI) and adopt module-scoped factories
Description
There is a legacy container.ts (global DI container) that conflicts with the current modular architecture. Global containers hide dependencies, complicate tests, and break tree-shaking.
What is expected
- Remove
container.ts and any global container registrations.
- Introduce module-scoped factories (simple functions) to compose controllers/use-cases/repositories explicitly.
- Update imports at app bootstrap to use these factories.
- Tests updated to instantiate modules without global side effects.
What should be modified
- Delete
container.ts and its references.
- For each module, add a
factory.ts (or similar) that wires repository → use-cases → controller(s).
- Update routers to import controller handlers from the module factory.
Tests
- Ensure unit/integration tests create module instances via factories (no global container).
- Verify parallel test runs don’t share state.
Acceptance criteria
Rollback plan
- Keep a branch/tag before removal.
- If needed, temporarily keep a minimal shim that proxies to module factories while all imports are updated.
🗂️ Issue: Remove
container.ts(legacy DI) and adopt module-scoped factoriesDescription
There is a legacy
container.ts(global DI container) that conflicts with the current modular architecture. Global containers hide dependencies, complicate tests, and break tree-shaking.What is expected
container.tsand any global container registrations.What should be modified
container.tsand its references.factory.ts(or similar) that wires repository → use-cases → controller(s).Tests
Acceptance criteria
container.tsremoved from the codebase.Rollback plan