Skip to content

refactor: split large controllers and components into focused modules#7

Merged
BODMAT merged 1 commit into
masterfrom
refactor/file-structure
May 21, 2026
Merged

refactor: split large controllers and components into focused modules#7
BODMAT merged 1 commit into
masterfrom
refactor/file-structure

Conversation

@BODMAT
Copy link
Copy Markdown
Owner

@BODMAT BODMAT commented May 21, 2026

Split oversized backend controllers and frontend components into smaller, focused files.

Backend

transactionController.ts (806 lines) split into controllers/transaction/:

  • transactionHelpers.ts - shared types and formatTransaction
  • transactionCrudHandlers.ts - CRUD handlers
  • transactionStatsHandlers.ts - portfolio, coin stats, chart data

walletController.ts (359 lines) split into controllers/wallet/:

  • walletQueryHandlers.ts - getWallets, getWallet
  • walletMutationHandlers.ts - createWallet, updateWallet, deleteWallet

Routers updated to import from new subfolder files.

Frontend

  • TransactionFormFields.tsx - shared form fields extracted from AddTransactionPopup and ChangeTransactionPopup
  • TransactionRow.tsx - single row and skeleton extracted from WatchTransactionsPopup
  • extractApiErrorMessage moved to utils/functions.ts, duplication removed

Files left untouched: transaction.api.ts, auth.api.ts (single createApi slices), Background.tsx, AllCrypto.tsx - all logically cohesive despite size.

Testing

All 22 backend integration tests pass. TypeScript check clean on both frontend and backend.

Backend: transactionController (806 lines) split into transaction/ subfolder
with crud, stats and helpers files. walletController (359 lines) split into
wallet/ subfolder with query and mutation handlers. Routers updated.

Frontend: extracted TransactionFormFields shared between Add and Change
popups, TransactionRow and skeleton from WatchTransactionsPopup, moved
extractApiErrorMessage to utils/functions.ts.
@BODMAT BODMAT merged commit f00c004 into master May 21, 2026
1 check passed
@BODMAT BODMAT deleted the refactor/file-structure branch May 21, 2026 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant