How yung729/spendsavvy works
Project Identification
• Project Type & Purpose: SpendSavvy is an Android application aimed at managing and tracking spending and saving habits. The minimal README and the file tree illustrate a mobile app with multiple screens for tasks like adding bills, managing cash accounts, budgeting, and tracking transactions.
• Main Frameworks/Technologies: Kotlin for Android development, Android components (Activities, Fragments, ViewModels), Firebase integration (evidenced by the presence of google-services.json and FireAuth/Firestore repositories), and native Android UI resources.
Key Components
a. Presentation Layer:
• Screens/UI: Highlight the numerous screens under the “screen” directory (e.g., LoginScreen, OverviewScreen, WalletScreen, SettingsScreen). These represent the views where users interact.
b. Business Logic Layer:
• ViewModels: Under “viewModels”, there are various view model classes (e.g., BillsViewModel, CategoryViewModel, MainViewModel) that manage UI-related data, following MVVM principles.
c. Data & Domain Layer:
• Models: Located in “models”, these define the data structures (e.g., Bills, Cash, Category, Stock) used throughout the app.
• Repositories: The “repo” directory shows FirestoreRepository and FireAuthRepository for data access and remote operations (likely interacting with Firebase) as well as local persistence, in addition to “data” for category-related data.
d. Database/Storage:
• Local Database: The “db” directory includes DatabaseHelper for managing local data storage.
• Firebase Services: The existence of google-services.json and repository components indicate remote data handling (authentication and Firestore operations).
e. Navigation & Application Infrastructure:
• Navigation: The “navigation” package (containing NavGraph, NetworkHelper, Screen definitions, and ConnectionStatus) is in charge of routing and managing network connectivity cues across various screens.
• Component-based Design: The “components” folder houses AppComponent.kt, which suggests the implementation of dependency injection or similar component management (possibly via Dagger/Hilt).
f. Testing Infrastructure:
• Unit and Instrumentation Tests: The presence of “androidTest” and “test” directories indicates well-organized testing setups.
Relationships and Interactions
• User Action Flow: Start at the Presentation Layer (screens/UI), which interacts with the corresponding ViewModels.
• Data Flow: Each ViewModel communicates with the Repository layer to either fetch data from the local Database (via DatabaseHelper) or remote data from Firebase (via FireAuthRepository and FirestoreRepository).
• Navigation & Component Interaction: The Navigation module connects UI screens, while the AppComponent likely facilitates dependency injection by wiring up view models, repositories, and other services.
• Testing: Separate flows for instrumented tests (UI interaction on devices) and unit tests (logic verification).
Architectural Patterns & Design Principles
• MVVM Architecture: The clear isolation of UI (screens) from business logic (ViewModels) and data (Models and Repositories) is a classic MVVM approach.
• Repository Pattern: Data access is segregated via repositories that abstract away the details of local vs. remote data.
• Dependency Injection: The presence of an AppComponent hints at using DI to decouple component creation and dependency management.
• Modularity: By separating screens, navigation, data, database, and network components into distinct packages, the design promotes maintainability and scalability.
• Top Layer: Presentation (screens & UI themes).
• Middle Layer: Business logic (ViewModels, navigation).
• Lower Layer: Data (Repositories, Models) and Storage (Local Database; External Services like Firebase).
• Integration highlights such as:
• Testing components (unit tests & instrumentation tests) as separate supportive modules.