How bhagirihi/moneyexpensemobile works
Project Type & Purpose
• Type: Full‑stack mobile application (React Native + Expo)
• Purpose: Expense tracking and management (personal and shared), with real‑time collaboration and analytics.
Top‑Level Components
A. Mobile Client (React Native/Expo)
1. UI Layer
– src/components & src/screens
– Navigation: src/navigation/AppNavigator.js
2. State Management
– Context Providers: AuthContext, ThemeContext, AppSettingsContext
– Async Storage for local persistence
3. Service Layer
– Business services: expenseService, categoryService, dashboardService, etc.
– Real‑time sync: WebSocket via realTimeSync.js
4. Configuration
– supabase config: src/config/supabase.js
5. Utilities & Theming
– Formatters, toast utils, theme.js
B. Backend as a Service (Supabase)
1. Auth & User Profiles
2. PostgreSQL Database + Migrations (supabase/migrations)
3. Real‑time Postgres subscriptions
4. Storage (for receipts, profile pictures)
C. Third‑Party Integrations
– Google Sign‑In
– Calendar import
– Notification Service (push notifications)
D. DevOps/Infrastructure
– EAS / expo configuration (eas.json, app.json)
– CI/CD build scripts (APK_BUILD_GUIDE.md)
Relationships & Data Flow
1. User interacts with UI screens → triggers actions in Components
2. Components call Service Layer methods → these wrap REST or real‑time calls to Supabase
3. Supabase Auth module handles login/2FA → returns JWT
4. Supabase Postgres handles CRUD on expenses, categories, boards → real‑time updates stream back to client via WebSocket
5. Client persists some data locally in Async Storage (offline support)
6. NotificationService connects to FCM/APNs for push notifications
7. External integrations (Google, Calendar) invoked via service modules
Architectural Patterns & Principles
• Layered Architecture:
– Presentation (React Native UI)
– Application/Service layer
– Data layer (Supabase)
• Context API for global state – clear separation of concerns
• Service‑oriented modules (each domain area has its own service file)
• Real‑time eventing via WebSocket subscriptions (pub/sub)
Technologies & Frameworks
– React Native + Expo (App.js, index.js)
– React Navigation
– Context API + Async Storage
– Supabase JS client (src/config/supabase.js)
– WebSockets for real‑time sync
– Local assets/fonts, theming engine (src/theme/theme.js)