Skip to content

Latest commit

 

History

History
80 lines (64 loc) · 2.67 KB

File metadata and controls

80 lines (64 loc) · 2.67 KB

Frontend Refactor Status

✅ Completed

Core Infrastructure

  • ✅ TanStack React Query installed and configured
  • ✅ Provider pattern implemented (AuthProvider, SubscriptionProvider)
  • ✅ Clean hooks architecture
  • ✅ Amplify client abstraction
  • ✅ Type definitions centralized

Files Created

Hooks (src/hooks/)

  • useAuth.tsx - Authentication context and hook
  • useAmplifyClient.ts - Client selection based on auth state
  • useBudget.ts - Budget data fetching with React Query
  • useTransactions.ts - Transactions data fetching
  • useAccounts.ts - Accounts data fetching
  • useSettings.ts - Settings data fetching

Providers (src/providers/)

  • SubscriptionProvider.tsx - Real-time subscriptions with automatic query invalidation

Lib (src/lib/)

  • amplify-client.ts - Centralized Amplify client
  • types.ts - All TypeScript types

Components

  • TabsView.tsx - Clean tabs implementation with hooks
  • SettingsPage/index.tsx - Complete settings page (copied from reference)
  • SettingsPage/SignOutButton.tsx - Sign out component
  • BudgetPage/index.tsx - Placeholder (needs implementation)
  • AccountsPage/index.tsx - Placeholder (needs implementation)

Root Files

  • main.tsx - Updated with QueryClient and providers
  • App.tsx - Cleaned up with DnD support preserved

🚧 Next Steps

Budget Page Components (from reference app)

Need to create these small components (<200 lines each):

  • BudgetPage/BudgetTable.tsx
  • BudgetPage/BudgetProgress.tsx
  • BudgetPage/BudgetTableCategoryRow.tsx
  • BudgetPage/BudgetCategoryDetail.tsx
  • BudgetPage/BudgetCategoryDetailCard.tsx
  • BudgetPage/UncategorizedTransactions.tsx
  • BudgetPage/UncategorizedTransactionBubble.tsx
  • BudgetPage/CategorizeTransactionDialog.tsx
  • BudgetPage/SyncTransactionsButton.tsx

Accounts Page Components

  • AccountsPage/Accounts.tsx
  • AccountsPage/PlaidLink.tsx (or similar)
  • AccountsPage/TellerLink.tsx (or similar)

Helpers (copy from reference)

  • src/helpers/sync-all-transactions.ts
  • src/helpers/sync-financekit-transactions.ts
  • src/helpers/sync-tellerio-transactions.ts
  • src/helpers/plaid.ts

Common Components

  • Any shared components between pages

Architecture Benefits

  1. No Prop Drilling: React Query manages all state
  2. Small Components: Each component <200 lines
  3. Provider Pattern: Clean separation of concerns
  4. Hooks Pattern: Reusable data fetching logic
  5. Type Safety: Centralized types
  6. Real-time Updates: Automatic via subscriptions
  7. Caching: Built-in with React Query

Reference Apps

  • Original: /Users/xss/repo/jpc-finance-2
  • Architecture inspiration: /Users/xss/repo/jpc-eats