/ README.md
README.md
1 # π° SpendingTracker 2 3 A simple and elegant iOS app for tracking your monthly expenses with automatic total calculation. 4 5 ## π± Features 6 7 - **Monthly Expense Tracking**: Organize your expenses by month with customizable month titles 8 - **Smart Text Parsing**: Automatically detects and sums up amounts in your expense text (supports both β¬ and β¬ formats) 9 - **Clean Interface**: Modern SwiftUI design with dark/light mode support 10 - **Persistent Storage**: Uses SwiftData for reliable local data storage 11 - **German Localization**: Optimized for German users with proper date formatting 12 13 ## π― How It Works 14 15 SpendingTracker uses intelligent text parsing to automatically calculate your total expenses. Simply write your expenses in natural text format, and the app will: 16 17 - Detect amounts in the format `XX,XXβ¬` or `XX.XXβ¬` 18 - Automatically sum up all detected amounts 19 - Display the total at the bottom of each month card 20 21 ### Example Input: 22 ``` 23 Dinner 50,00β¬ 24 BΓΌcher 20,00β¬ 25 Coffee 3,50β¬ 26 ``` 27 28 **Result**: Automatically calculates and displays `73,50β¬ total` 29 30 ## π Getting Started 31 32 ### Prerequisites 33 34 - Xcode 15.0 or later 35 - iOS 17.0 or later 36 - macOS 14.0 or later (for development) 37 38 ### Installation 39 40 1. Clone the repository: 41 ```bash 42 git clone https://github.com/yourusername/SpendingTracker.git 43 cd SpendingTracker 44 ``` 45 46 2. Open the project in Xcode: 47 ```bash 48 open SpendingTracker.xcodeproj 49 ``` 50 51 3. Select your target device or simulator 52 53 4. Build and run the project (β+R) 54 55 ## π Usage 56 57 ### Adding Expenses 58 59 1. **Start with the default month** (automatically created for the current month) 60 2. **Edit the month title** if needed (tap on the title to edit) 61 3. **Add your expenses** in the text area below 62 4. **Use the format**: `Description Amount,XXβ¬` (e.g., "Dinner 25,50β¬") 63 5. **View the total** automatically calculated at the bottom 64 65 ### Creating New Months 66 67 - Once you have expenses in your current month, a "New month" button will appear 68 - Tap it to create a new month card for the next month 69 - The app automatically generates the correct month title in German 70 71 ### Data Persistence 72 73 - All your data is automatically saved using SwiftData 74 - No manual saving required 75 - Data persists between app launches 76 77 ## π Technical Details 78 79 ### Architecture 80 81 - **Framework**: SwiftUI + SwiftData 82 - **Data Model**: Single `Month` entity with title, expenses text, and creation date 83 - **Storage**: Local SwiftData database 84 - **Minimum iOS Version**: 17.0 85 86 ### Key Components 87 88 - `ContentView.swift`: Main app interface with month cards 89 - `Item.swift`: SwiftData model for Month entities 90 - `SpendingTrackerApp.swift`: App entry point and SwiftData configuration 91 92 ### Features 93 94 - **Regex-based parsing**: Automatically extracts amounts from text 95 - **Dynamic theming**: Adapts to system dark/light mode 96 - **Responsive design**: Works on all iPhone and iPad sizes 97 - **German localization**: Proper date formatting for German locale 98 99 ## π¨ UI/UX Features 100 101 - **Card-based design**: Clean, modern interface with rounded corners 102 - **Adaptive colors**: Automatically adjusts to light/dark mode 103 - **Smooth animations**: Native SwiftUI transitions 104 - **Intuitive editing**: Inline text editing for month titles and expenses 105 106 ## π§ Customization 107 108 The app is designed to be easily customizable: 109 110 - **Color scheme**: Modify the `Color` extensions in `ContentView.swift` 111 - **Date format**: Change the locale and format in `nextMonthTitle()` 112 - **Parsing logic**: Adjust the regex pattern in `total(for:)` function 113 114 ## π± Screenshots 115 116 *Add screenshots of your app here* 117 118 ## π€ Contributing 119 120 1. Fork the repository 121 2. Create a feature branch (`git checkout -b feature/amazing-feature`) 122 3. Commit your changes (`git commit -m 'Add some amazing feature'`) 123 4. Push to the branch (`git push origin feature/amazing-feature`) 124 5. Open a Pull Request 125 126 ## π License 127 128 This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. 129 130 ## π¨βπ» Author 131 132 **Joshua SΓΆhn** 133 - Created: July 21, 2025 134 135 ## π Acknowledgments 136 137 - Built with SwiftUI and SwiftData 138 - Inspired by the need for simple, effective expense tracking 139 - Special thanks to the SwiftUI community for excellent documentation 140 141 --- 142 143 **Note**: This app is designed for personal use and local data storage. For more advanced features like cloud sync, export capabilities, or multi-currency support, consider extending the current implementation.