Smart debt payoff using the proven snowball method
DebtFreePro is a React Native application that helps users track and eliminate their debt using the snowball method. The app features document upload capabilities for credit card statements and automatic debt tracking with a JSON-based data store.
Core Debt Management:
- Debt snowball strategy calculation with payoff projections
- Dynamic dashboard with real-time debt summaries
- JSON-based data persistence for all debt and statement data
- Support for multiple debt types (Credit Card, Auto Loan, Line of Credit, etc.)
- Manual debt entry with comprehensive validation
- Complete debt editing functionality for consecutive monthly updates
- Debt type conversions and account modifications
Document Upload & Processing:
- CSV and PDF document upload from device storage
- Automatic statement parsing and validation
- PDF manual entry fallback with graceful degradation
- Smart debt ID management and temporary state handling
- Transaction categorization and analysis
- Statement-to-debt linking with confidence scoring
- File validation with comprehensive error handling
Data Architecture:
- Local JSON data store with full CRUD operations
- Enhanced DataStoreService with overloaded debt creation methods
- Extended debt interface with account number and due date fields
- Statement history tracking per debt account
- Automatic debt balance updates from uploaded statements
- Settings management (extra payments, strategy type, currency)
- Data export/import functionality
User Interface:
- Modern React Native UI with card-based design
- ManualDebtEntryModal for creating debts from PDF uploads
- EditDebtModal for updating existing debt information
- Previous value hints and validation feedback
- Progress tracking and payoff projections
- Loading states and error handling
- Dynamic next steps based on current debt strategy
DebtFreePro/
βββ src/
β βββ components/ # Reusable UI components
β β βββ DebtCard.tsx # Individual debt display
β β βββ ProgressBar.tsx # Progress visualization
β β βββ StatCard.tsx # Summary statistics
β β βββ DocumentUpload.tsx # PDF/CSV upload with smart routing
β β βββ ManualDebtEntryModal.tsx # Create debt from PDF upload
β β βββ EditDebtModal.tsx # Edit existing debt details
β βββ data/
β β βββ debts.json # Initial data store template
β βββ screens/
β β βββ Dashboard.tsx # Main application screen
β βββ services/ # Business logic layer
β β βββ DataStoreService.ts # JSON data persistence (enhanced)
β β βββ DebtService.ts # Debt calculations (snowball)
β β βββ DocumentUploadService.ts # File upload handling
β β βββ DocumentValidationService.ts # CSV/PDF validation
β β βββ DocumentManagerService.ts # Upload orchestration (enhanced)
β β βββ StatementProcessingService.ts # Statement analysis (enhanced)
β β βββ PDFParsingService.ts # PDF processing (manual entry)
β βββ types/ # TypeScript interfaces
β βββ Debt.ts # Debt data structures
β βββ Statement.ts # Statement/transaction types
β βββ Strategy.ts # Payoff strategy types
βββ __tests__/ # Comprehensive test suite
βββ fixtures/ # Sample CSV data for testing
βββ services/ # Service layer tests
βββ integration/ # End-to-end tests
-
Document Upload Pipeline:
User selects file β DocumentUploadService validates β DocumentValidationService parses β DocumentManagerService processes β [IF PDF + no data] β ManualDebtEntryModal β DataStoreService persists β [IF data extracted] β Automatic processing β Dashboard updates -
Manual Debt Entry Flow:
PDF Upload β No extractable data β ManualDebtEntryModal β User enters debt details β DataStoreService.addDebt() β Temporary debt ID state β StatementProcessingService links β Dashboard updates -
Monthly Debt Update Flow:
User opens EditDebtModal β Updates balance/payments β DataStoreService.updateDebt() β Preserves statement relationships β Dashboard reflects changes -
Data Persistence:
JSON Store (debts.json) β DataStoreService β Components Enhanced with dual interface support (CreateDebtParams | Debt)
- Unit Tests: 49+ tests covering all service layers (including enhanced DataStoreService)
- Integration Tests: 30+ tests covering complete workflows
- ManualDebtEntry.integration.test.ts (12 tests)
- DebtEditing.integration.test.ts (11 tests)
- PDFProcessing.integration.test.ts (7 tests)
- Mock Infrastructure: Complete React Native module mocking
- Test Fixtures: Sample credit card, bank, and line of credit statements
Test Execution:
npm test # Run all tests
npm test -- services # Run service tests only
npm run lint # Code quality checksCore:
- React Native 0.80.1
- TypeScript 5.0.4
- React 19.1.0
File Handling:
- react-native-fs: File system operations
- react-native-document-picker: Document selection UI
Development:
- Jest: Testing framework
- ESLint: Code linting
- Babel: JavaScript transpilation
Data Management:
- Local JSON file storage
- No external database dependencies
- Automatic data migration and validation
Enhanced Debt Interface:
interface Debt {
id: string;
name: string;
type: DebtType;
balance: number;
minimumPayment: number;
interestRate: number;
lastUpdated: Date;
institution?: string;
accountNumber?: string; // NEW: Last 4 digits
dueDate?: number; // NEW: Day of month (1-31)
}Statement Interface:
interface Statement {
id: string;
debtId: string;
statementDate: Date;
balance: number;
minimumPayment: number;
dueDate: Date;
interestCharged: number;
payments: StatementPayment[];
purchases: StatementTransaction[];
fileName?: string;
imported: Date;
}DataStore Structure:
interface DataStore {
debts: Debt[];
statements: Statement[];
settings: {
extraPayment: number;
strategy: 'SNOWBALL' | 'AVALANCHE';
currency: string;
};
}Supported Formats:
- CSV files with multiple header formats
- PDF files with manual entry fallback (automatic extraction gracefully degrades)
CSV Header Support:
Date, Amount, DescriptionTransaction Date, Transaction Amount, DescriptionPosted Date, Debit, Credit, Description- Automatic detection of credit card vs. line of credit statements
Validation Features:
- File type and size validation (10MB limit)
- CSV structure and data integrity checks
- Date and amount format validation
- Automatic transaction categorization
- Document type detection (credit card, line of credit, etc.)
Dashboard Features:
- Real-time debt summary cards
- Progress visualization with percentage complete
- Dynamic next steps based on snowball strategy
- Responsive design with proper loading states
Modal Components:
- ManualDebtEntryModal: Complete debt creation from PDF uploads
- EditDebtModal: Monthly balance updates and debt management
- Previous value hints for easy comparison during edits
- Comprehensive validation with user-friendly error messages
Styling:
- Modern card-based design with shadows
- Consistent color scheme (grays, greens for success)
- Emoji icons for visual appeal
- Canadian dollar formatting
- Node.js >= 18
- React Native development environment set up
- iOS Simulator or Android Emulator
-
Clone and install dependencies:
git clone [repository-url] cd DebtFreePro npm install -
iOS Setup:
cd ios bundle install bundle exec pod install cd ..
-
Run the application:
# Start Metro bundler npm start # Run on iOS npm run ios # Run on Android npm run android
-
Code Quality:
npm run lint # Check code style npm test # Run test suite
-
Testing with Sample Data:
- Sample CSV files available in
__tests__/fixtures/ - Use document picker in app to upload test statements
- Check
src/data/debts.jsonfor initial debt data
- Sample CSV files available in
-
Data Management:
- App data stored in device's document directory
- Initial data loaded from
src/data/debts.json - Use DataStoreService for programmatic data access
The current models have become overloaded and need refactoring for better separation of concerns:
Current Issues:
Debtinterface handles both account info and financial stateStatementinterface mixes document metadata with transaction dataDataStoreServicemanages too many responsibilities- Mixed concerns between document processing and debt management
Planned Refactoring:
- Separate Account from Debt: Create
DebtAccount(institution, account#, type) vsDebtBalance(amount, rate, payment) - Extract Document Model: Separate
Documententity fromStatementfinancial data - Split Service Responsibilities: Separate account management from transaction processing
- Normalize Data Relationships: Better foreign key relationships between entities
- Settings Screen: Configure extra payments and strategy preferences
- Statement Review UI: Screen to review and edit parsed transactions
- Enhanced PDF Processing: Implement OCR or PDF text extraction
- Data Migration: Handle schema changes gracefully
- Data Visualization: Charts for debt progress and trends
- Payment Reminders: Notification system for due dates
- Export Features: PDF reports and CSV exports
- Backup/Sync: Cloud storage integration
- Advanced Analytics: Spending categorization and insights
- Multiple Strategies: Implement debt avalanche method
- Goal Setting: Custom payoff date targets
- Educational Content: Debt management tips and resources
The project maintains comprehensive test coverage with:
- Unit Tests: Every service method tested with mocks
- Integration Tests: Real CSV processing with sample data
- Error Scenarios: Malformed data and edge cases covered
- Performance Tests: Large file processing validation
Test files mirror the source structure and include realistic sample data for thorough validation.
- PDF parsing requires manual entry (automatic extraction not implemented)
- Domain models are overloaded and need refactoring
- No cloud sync or backup functionality
- Single user support only
- Limited to snowball method (avalanche planned)
- TypeScript strict mode enabled
- ESLint with React Native preset
- Functional components with hooks
- Service layer pattern for business logic
- Comprehensive error handling throughout
- Local JSON file storage for simplicity
- Automatic backup on data changes
- Migration support for future schema changes
- No external dependencies or network requirements