How animesh-0041/expense-tracker-fe works
Project type and purpose
• This is a mobile expense-tracker application built with Expo/React Native (using Expo Router’s file-based “app/” directory), targeting Android (native Android folder & Gradle config present) and leveraging Supabase as its backend service.
• Purpose: Allow users to sign up, log in, record income/expenses, view dashboards (charts, lists), receive push notifications, and manage security (PIN, AsyncStorage).
File structure
• Top level:
• android/ → Native Android project (Kotlin MainActivity & Application, Gradle build, resources).
• app.json → Expo configuration.
• app/ → Expo Router screens (file-based routing).
• api/ → Client-side API wrappers (.api.ts) for auth, transactions, notifications, feedback.
• components/ → Reusable UI components & common controls.
• context/ → React Context providers (AuthContext, Dialog, Snackbar).
• hooks/ → Custom hooks (data fetching: useAuth, useTransaction, etc.; device readiness, AsyncStorage).
• services/ → HTTP request setup (authRequest/publicRequest) and Supabase client.
• notifications/ → Push notification setup, permissions, listeners, scheduler.
• utils/, constants/, data/ → Helper functions, theme & API endpoint constants, mock data.
• No separate backend code—uses Supabase (external) for database/auth.
README
• Minimal (“expense-tracker”) – confirms it’s a simple expense-tracking mobile app.
a. Main components:
• Mobile App (UI Layer – Screens & Components)
• Navigation (Expo Router)
• State & Business Logic (React Context + Hooks)
• Service Layer (services/api & Supabase Client)
• External Backend (Supabase: Auth, Database, Storage)
• Local Data Storage (AsyncStorage & Secure PIN Storage)
• Notifications Subsystem (Permissions, Scheduler, Listeners)
• Native Android Runtime (Kotlin MainActivity/Application)
b. Relationships & interactions:
• UI Screens → invoke Hooks/Context → call Service Layer → HTTP to Supabase → responses back up.
• Notification scheduler & listeners register with native modules (Android Runtime) → push events into the App.
• AsyncStorage used by hooks and contexts for persisting tokens, PIN, preferences.
c. Architectural patterns/design principles:
• Separation of concerns: UI (components/screens) vs. state (Context/hooks) vs. data access (services) vs. external services.
• File-based routing (Expo Router) organizes screens under “app/”.
• Dependency inversion: API endpoints configured centrally (constants/apiEndPoints).
• React Context for cross-cutting concerns (auth state, dialogs, snackbars).
• Modular notifications: clear division between scheduler, listeners, utils.
d. Relevant technologies/frameworks:
• Expo & React Native with Expo Router
• TypeScript & React Context API
• React Query (implied by “use…“ hooks under hooks/queries)
• Supabase client (services/supabaseClient.ts)
• AsyncStorage and React Native Notifications
• Kotlin/Gradle for native Android bootstrap
Elements
• UI → Context/Hooks → Services → Supabase → backflow.
• App → Notification Scheduler → Device OS → Event → App.
• UI → AsyncStorage and AsyncStorage → UI.
• Green for service layer (services/, api/).
• Orange for external entities (Supabase, Device OS).
• Rounded rectangle for native Android.