How mizuch1/flousbank works
Project type and purpose
• This is a full-stack mobile banking application (“MBK App”) built with React Native (via Expo) for the client, and Supabase (Auth, PostgreSQL, Edge Functions) for the backend.
• It provides user authentication, account dashboard, transaction history, card management, transfers, branch/ATM locator, and a simple chatbot.
File structure
• Top‐level directories:
• android/ & ios/ → native platform build configurations & resources
• app/ → Expo Router–driven UI pages and layout for auth and tabbed navigation
• src/contexts → React Context providers (e.g., AccountContext)
• supabase/functions → custom Edge Functions (e.g., transfer‐funds)
• Configuration files: babel.config.js, tsconfig.json, package.json, app.json, eas.json, Supabase client initialization (src/supabaseClient.ts)
• Logical separation: UI layer (app/), state layer (contexts), backend functions (supabase/functions), native build (android/, ios/)
README for additional insights
• Confirms tech stack: Expo SDK, Expo Router, TypeScript, React Context API, Supabase Auth/DB, Edge Functions, expo modules (secure‐store, maps, location, file‐system)
• Highlights features and external service dependencies (react-native-maps, supabase Edge Functions)
Main components
a. Mobile Client (React Native + Expo)
• UI Pages & Layout (app/_layout.tsx, app/(tabs)/, app/(auth)/)
• Navigation Layer (Expo Router)
• State Management (AccountContext, other contexts in src/contexts)
• Local Storage (Expo Secure Store)
• Device services: Location (expo-location), Maps (react-native-maps), File System & Sharing (expo-file-system, expo-sharing)
b. Supabase Backend
• Authentication Service (Supabase Auth)
• PostgreSQL Database (accounts, transactions, cards, branches, profiles)
• Edge Functions (supabase/functions/transfer-funds)
c. External Services
• Expo Go app / Native runtimes (Android, iOS)
• Third‐party SDKs (Maps, Location, Secure Store)
d. Development & Deployment
• Metro bundler (expo start)
• EAS / CI pipelines (eas.json)
Interactions & data flows
• App startup → Expo Router loads auth guard → AccountContext checks token in Secure Store → if valid, load Dashboard
• User actions (e.g., “Transfer Funds”) → React form → invoke Supabase Edge Function → Edge Function interacts with PostgreSQL → returns status → UI updates
• Data fetch (transactions, cards, branches) → Supabase client → direct REST/GraphQL calls to Supabase → populate React state
• Locator map → device requests location → front end fetches branch data from Supabase → react-native-maps renders pins
• Chatbot → keyword matching on device or simple request to functions/state → UI responds
Architectural patterns & design principles
• Client–Server separation: mobile front end vs. Supabase backend
• Modular UI using Expo Router’s filesystem routing
• Context API for global state & dependency injection
• Edge Functions as BFF (Backend-for-Frontend) for sensitive operations (transfers)
• Secure handling of tokens (Expo Secure Store)
• Lazy-loading & code splitting via file-based routing
Detail
• Every key directory/module from your file tree (android/ios configs, app/ pages, src/contexts, supabase/functions)
• Both synchronous (direct DB read) and asynchronous flows (Edge Functions, location fetch)
• Environment/config dependencies (EXPO_PUBLIC_SUPABASE_URL, Anon Key)