How blitzbugg/entepocket works
1. High-level shape
- EntePocket is a single mobile client app built with Expo / React Native / TypeScript.
- The architecture is centered on Expo Router file-based navigation, with Supabase as the remote backend.
- The codebase is split into a clear UI layer, state layer, integration layer, and shared domain/config files.
2. Navigation and app shells
- app/_layout.tsx is the root composition point for the whole app.
- app/(tabs)/_layout.tsx defines the main authenticated tab shell.
- app/auth/login.tsx and app/auth/verify.tsx form the OTP auth flow.
- app/modal.tsx is a separate modal route outside the main tab experience.
3. Primary user-facing surfaces
- The main product area is the tab group under app/(tabs)/.
- The key screens are:
- home.tsx and index.tsx for landing/dashboard behavior,
- bills.tsx for recurring bill tracking,
- family.tsx for household/group collaboration,
- history.tsx for past expenses/activity,
- profile.tsx for user/account settings.
- This suggests the app is organized around a family expense notebook rather than a deep finance dashboard.
4. Authentication boundary
- Authentication is phone OTP-based and appears to be the main entry gate into the app.
- The auth flow is isolated in the app/auth/ routes, keeping unauthenticated screens separate from the tabbed app.
- store/authStore.ts likely holds the session/user state and acts as the gatekeeper for route decisions.
5. State management
- State is centralized with Zustand stores in store/.
- authStore.ts manages identity/session-related state.
- expenseStore.ts likely manages household expense data, monthly views, and mutation flows.
- This creates a clean split: screens render UI, stores hold mutable app state, and Supabase handles persistence/auth.
6. Backend and external service boundary
- utils/supabase.ts is the shared integration point for backend access.
- Supabase is the main backend boundary, covering both PostgreSQL data and OTP authentication.
- The README indicates phone OTP via SMS and RLS-based protection; architecturally, that means data access is expected to be server-enforced rather than trusted from the client.
7. Domain model and static configuration
- types/index.ts defines the shared TypeScript domain shapes used across screens and stores.
- constants/categories.ts contains the fixed expense categories used by the MVP.
- constants/theme.ts provides shared visual tokens.
- These files act as the app’s domain vocabulary, keeping UI and store logic aligned.
8. Shared UI layer
- components/ contains reusable presentation building blocks:
- themed text/view primitives,
- tab haptics,
- parallax/scroll helpers,
- a collapsible UI piece,
- icon symbol wrappers,
- small decorative helpers like hello-wave.
- This suggests the app uses a composed design system rather than duplicating screen-specific UI.
9. Theming and platform adaptation
- hooks/use-color-scheme* and hooks/use-theme-color.ts provide theme-aware styling helpers.
- components/themed-text.tsx and components/themed-view.tsx indicate the app standardizes color/style access through reusable primitives.
- Even though the README emphasizes a light, calm visual style, the code still has a small theming abstraction to keep UI consistent across platform settings.
10. Assets and brand surface
- assets/images/ contains the app logo and image assets used in the product.
- The branding is part of the architecture because the app is intentionally designed for trust and familiarity, especially for family/parent users.
- The visual identity is lightweight and embedded into the client, not managed by a separate design system service.
11. Tooling and project plumbing
- app.json, tsconfig.json, eslint.config.js, and .vscode/ support the Expo/TypeScript development workflow.
- scripts/reset-project.js is a scaffolding/reset utility, not part of runtime behavior.
- These pieces support maintainability but do not change the runtime architecture.
12. End-to-end data flow
- A user enters the app through OTP login.
- Auth state is stored in authStore, then the router transitions into the tabbed app shell.
- Expense and family-related screens read/write through Zustand stores, which in turn use the Supabase client for backend persistence.
- Shared types/constants keep the same expense categories, data shapes, and UI behavior consistent across all screens.
13. Important architectural boundary to note
- There is no separate backend code in this repo; the app is a frontend client with backend responsibilities delegated to Supabase.
- Similarly, there is no visible standalone services/ layer in the tree, so most integration appears concentrated in utils/ and the stores.
- For a diagram, the clearest split is:
- Presentation: app/, components/
- State/domain: store/, types/, constants/
- Integration: utils/supabase.ts
- Platform/tooling: config files, assets, scripts
Main entry points: (tabs)/_layout.tsx Tab shell · expenseStore.ts Expense store · app/_layout.tsx App shell · authStore.ts Auth store
Components 21
Presentation
Expo Router screens and reusable UI components
- App shell · Root Expo Router composition and app-wide gating
app/_layout.tsx - Tab shell · Main authenticated tab navigator
app/(tabs)/_layout.tsx - Login · Phone-based sign-in entry screen
app/auth/login.tsx - Verify · OTP confirmation and session completion
app/auth/verify.tsx - Modal · Standalone modal route outside tabs
app/modal.tsx - Home · Primary landing and summary surface
app/(tabs)/home.tsx - Index · Tab entry or redirect landing page
app/(tabs)/index.tsx - Bills · Recurring bill tracking and management
app/(tabs)/bills.tsx - Family · Household and shared expense coordination
app/(tabs)/family.tsx - History · Past expenses and activity timeline
app/(tabs)/history.tsx - Profile · User settings and account surface
app/(tabs)/profile.tsx - UI kit · Reusable themed and decorative presentation components
State & Domain
Zustand stores, shared types, and app constants
- Auth store · Session and identity gatekeeper
store/authStore.ts - Expense store · Household expense and monthly app state
store/expenseStore.ts - Types · Shared TypeScript shapes across the app
types/index.ts - Categories · Fixed expense category vocabulary
constants/categories.ts - Theme tokens · Shared visual constants and color tokens
constants/theme.ts
Integration
Backend access and platform hooks
- Supabase · Shared client for auth and persistence
utils/supabase.ts - Color scheme · Platform color-scheme adaptation hooks
hooks/use-color-scheme.ts
Platform & Tooling
Assets and project configuration
- Brand assets · Logo and bundled image assets
assets/images - Project config · Expo, TypeScript, linting, and editor support files
app.json
Connections 31
- App shell → Auth store: gates by session · Root shell decides whether to show auth or app
- App shell → Tab shell: hosts · Mounts the authenticated tab experience
- App shell → Login: routes to · Sends unauthenticated users into OTP login
- App shell → Modal: overlays · Provides a separate modal entry point
- Tab shell → Home: contains · Defines the main tabbed app surfaces
- Tab shell → Index: contains · Defines the main tabbed app surfaces
- Tab shell → Bills: contains · Defines the main tabbed app surfaces
- Tab shell → Family: contains · Defines the main tabbed app surfaces
- Tab shell → History: contains · Defines the main tabbed app surfaces
- Tab shell → Profile: contains · Defines the main tabbed app surfaces
- Login → Auth store: writes session · Login flow updates identity state
- Verify → Auth store: completes auth · OTP verification finalizes the session
- Login → Supabase: requests OTP · Starts phone-based sign-in via backend
- Verify → Supabase: verifies OTP · Confirms code and establishes auth session
- Home → Expense store: reads state · Dashboard consumes shared expense state
- Bills → Expense store: reads state · Recurring bill UI depends on store data
- Family → Expense store: mutates data · Collaboration screen updates shared household state
- History → Expense store: reads state · History view renders store-backed activity
- Profile → Auth store: reads identity · Account screen depends on the current user session
- Expense store → Supabase: persists · Store synchronizes data through Supabase
- Auth store → Supabase: authenticates · Session state is backed by Supabase auth
- Expense store → Types: uses shapes · Store state and mutations follow shared domain types
- Expense store → Categories: uses categories · Store logic and screens rely on fixed category sets
- Home → UI kit: composes · Screens reuse shared presentation building blocks
- Bills → UI kit: composes · Screens reuse shared presentation building blocks
- Family → UI kit: composes · Screens reuse shared presentation building blocks
- History → UI kit: composes · Screens reuse shared presentation building blocks
- UI kit → Theme tokens: uses tokens · Shared UI primitives pull from central theme values
- UI kit → Color scheme: adapts to · UI primitives vary by platform color scheme
- App shell → Brand assets: loads brand · App shell and screens use bundled visual assets
- Project config → App shell: supports · Tooling underpins the Expo app runtime and build