Overview
Divvy is built as a modern Android application using Kotlin and Jetpack Compose with a clean MVVM architecture. The app simplifies group expense splitting by bringing it to the moment of payment through bank integration and receipt scanning.Technology Stack
Frontend
- Kotlin - Primary language
- Jetpack Compose - Modern UI toolkit
- Material 3 - Design system
- Navigation Compose - Type-safe navigation
Backend & Data
- Supabase - Database and authentication
- Postgrest - Database queries
- GoTrue - Auth provider
- Plaid - Bank integration (planned)
Dependency Injection
- Hilt - DI framework
- Dagger - Compile-time DI
Camera & Media
- CameraX - Receipt scanning
- Coil - Image loading
Project Structure
The Divvy codebase follows a feature-based organization within the MVVM pattern:Each feature in the
ui/ directory typically contains ViewModels/ and Views/ subdirectories, maintaining clear separation between business logic and presentation.Data Flow Architecture
Divvy implements a unidirectional data flow pattern:1
User Interaction
User interacts with Compose UI components (buttons, text fields, etc.)
2
ViewModel Processing
UI events are handled by ViewModels which contain business logic
3
Repository Layer
ViewModels call repository methods for data operations
4
Backend Communication
Repositories interact with Supabase through the SupabaseClient
5
State Updates
Data flows back through StateFlow/Flow emissions
6
UI Recomposition
Compose UI automatically recomposes when state changes
Dependency Injection Setup
Divvy uses Hilt for dependency injection with two main modules:NetworkModule
Provides the Supabase client configuration:app/src/main/java/com/example/divvy/di/NetworkModule.kt
AppModule
Binds repository interfaces to their Supabase implementations:app/src/main/java/com/example/divvy/di/AppModule.kt
All repositories are provided as singletons to ensure consistent state across the app and efficient resource usage.
Build Configuration
Key build configuration fromapp/build.gradle.kts:
- Android Config
- Plugins
- Key Dependencies
Environment Configuration
Divvy useslocal.properties for environment-specific configuration:
Authentication Flow
Supabase Auth is configured with custom URL scheme for OAuth redirects:- Redirect URL:
com.example.divvy://auth - Auth Method: Google OAuth via Custom Tabs
- Session Management: Handled by Supabase GoTrue SDK
Next Steps
MVVM Pattern
Learn how ViewModels and Views work together
Navigation
Explore the navigation architecture