Skip to main content

February 14th, 2026

Cleaning House: Architecture Consolidation & React Cleanup Today was a massive day for paying down technical debt. We restructured the entire backend API to be domain-centric and decomposed massive frontend screens into clean, testable hooks.

🛠️ Backend Consolidation

validating the architectural decision to simplify the API layer. We moved away from scattered get/list/create files to consolidated domain modules.

1. Commitments & Instances API

  • Merged Operations:
    • commitments/get.ts + commitments/list.tscommitments/read.ts
    • instances/get.ts + instances/list.tsinstances/read.ts
  • Simplified Layer: Removed the unnecessary core/commitments/queries.ts abstraction. The API now queries the DB directly, reducing boilerplate.
  • Conflict Logic: Relocated conflictDetection.ts from lib/ to core/commitments/ to co-locate it with domain logic.

2. Full CRUD Implementation

  • New Endpoints: Added create.ts, update.ts, and delete.ts to api/instances/ to support full lifecycle management of instances.
  • Consistency: Both commitments and instances now follow the exact same API structure (read, create, update, delete).

📱 Frontend Decomposition

We tackled the growing complexity of our main screens by extracting logic into custom hooks.

1. Schedules Screen Refactor

The SchedulesScreen was over 250 lines. We reduced it to ~100 lines by extracting:

2. Commits Screen Refactor

Similarly, the CommitsScreen was decomposed:

3. Skeleton Loading Polish

  • Fix: Replaced the full-screen overlay in CommitsScreen with proper list-item skeletons.
  • Layout: used View containers to prevent layout collapse during loading states.

📝 Key Takeaways

We adhered to the “Separation of Concerns” principle today.
  • Backend: Organized by Domain (Commitments vs Instances) rather than Action (Get/List).
  • Frontend: Separated View (Render) from Logic (Hooks).
This sets a solid foundation for adding complex features like “Partner Verification” without the codebase collapsing under its own weight.