Skip to content

EPIC-12: Codebase Refinement & Consistency Cleanup #445

@steilerDev

Description

@steilerDev

Description

After multiple feature epics, the codebase has accumulated duplication and inconsistencies that should be addressed. This epic audits the codebase and fixes identified issues. Should be executed after the Tag/Category Rework epic, as that rework will itself eliminate some duplication and may introduce new patterns to standardize on.

Known Areas to Investigate and Fix

  • CRUD route duplication: 9+ route files follow near-identical patterns (schema validation, auth checks, service delegation) — extract a shared route factory or plugin
  • Modal component duplication: Multiple components implement their own modal dialogs with bespoke focus trap and keyboard handling — extract a reusable Modal component
  • API client wrapper inconsistency: Frontend API wrappers in client/src/lib/ have inconsistent response unwrapping patterns — standardize the convention
  • Error class proliferation: Multiple *InUseError classes with identical structure (e.g., CategoryInUseError, VendorInUseError) — consider a generic ResourceInUseError factory
  • Service layer patterns: Inconsistent naming, error handling, and logging patterns across services — document and standardize

Goals

  • Audit all route, service, component, and API client files for duplication and inconsistency
  • Extract shared abstractions where duplication is significant (route factory, Modal component)
  • Standardize API client response unwrapping convention
  • Consolidate redundant error classes
  • Document established patterns in project conventions (CLAUDE.md or wiki)

Execution Order

This is the second epic in a three-part sequence:

  1. Unified Tag & Category System (prerequisite — must complete first)
  2. Codebase Refinement & Consistency Cleanup ← this epic
  3. Construction Diary / Bautagebuch

Metadata

Metadata

Assignees

No one assigned

    Labels

    epicEpic - large feature area

    Projects

    Status

    Wont-Do

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions