Skip to content

πŸ—οΈ Project Structure

This page explains in detail the architecture and code organization in ExpoPlate, helping you understand where to find each element and how everything fits together.

πŸ“‚ Overview

β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ (auth)/
β”‚   β”‚   β”œβ”€β”€ resetPassword.tsx
β”‚   β”‚   β”œβ”€β”€ sign-in.tsx
β”‚   β”‚   β”œβ”€β”€ sign-up.tsx
β”‚   β”‚   └── welcome.tsx
β”‚   β”œβ”€β”€ (protected)/
β”‚   β”‚   β”œβ”€β”€ (tabs)/
β”‚   β”‚   β”‚   β”œβ”€β”€ _layout.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ai.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ index.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ notifications.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ offline.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ payment.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ premium.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ profile.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ settings.tsx
β”‚   β”‚   β”‚   └── tasks.tsx
β”‚   β”‚   β”œβ”€β”€ _layout.tsx
β”‚   β”‚   β”œβ”€β”€ privacy-policy.tsx
β”‚   β”‚   └── terms-of-service.tsx
β”‚   β”œβ”€β”€ onboarding/
β”‚   β”‚   β”œβ”€β”€ _layout.tsx
β”‚   β”‚   └── index.tsx
β”‚   β”œβ”€β”€ _layout.tsx
β”‚   β”œβ”€β”€ +not-found.tsx
β”‚   └── index.tsx
β”œβ”€β”€ assets/
β”‚   β”œβ”€β”€ fonts/
β”‚   β”‚   β”œβ”€β”€ InstrumentSerif-Italic.ttf
β”‚   β”‚   └── InstrumentSerif-Regular.ttf
β”‚   β”œβ”€β”€ icons/
β”‚   β”‚   β”œβ”€β”€ adaptive_icon.png
β”‚   β”‚   β”œβ”€β”€ icon_base.png
β”‚   β”‚   β”œβ”€β”€ icon_dark.png
β”‚   β”‚   └── icon_light.png
β”‚   β”œβ”€β”€ logo/
β”‚   β”‚   β”œβ”€β”€ revenuecat.png
β”‚   β”‚   └── stripe.jpeg
β”‚   β”œβ”€β”€ splashscreen/
β”‚   β”‚   β”œβ”€β”€ splashscreen_dark.png
β”‚   β”‚   └── splashscreen_light.png
β”‚   └── icon.png
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ ai/
β”‚   β”‚   β”œβ”€β”€ AIThinkingLoader.tsx
β”‚   β”‚   β”œβ”€β”€ AutoResizingInput.tsx
β”‚   β”‚   β”œβ”€β”€ ChatHeader.tsx
β”‚   β”‚   β”œβ”€β”€ index.ts
β”‚   β”‚   β”œβ”€β”€ MessageActions.tsx
β”‚   β”‚   β”œβ”€β”€ MessageBubble.tsx
β”‚   β”‚   β”œβ”€β”€ PromptLabels.tsx
β”‚   β”‚   β”œβ”€β”€ ThinkingAnimation.tsx
β”‚   β”‚   └── TypewriterText.tsx
β”‚   β”œβ”€β”€ auth/
β”‚   β”‚   β”œβ”€β”€ appleProviderButton.tsx
β”‚   β”‚   β”œβ”€β”€ EmailLoginForm.tsx
β”‚   β”‚   β”œβ”€β”€ EmailLoginToggle.tsx
β”‚   β”‚   β”œβ”€β”€ googleProviderButton.tsx
β”‚   β”‚   β”œβ”€β”€ index.ts
β”‚   β”‚   β”œβ”€β”€ Separator.tsx
β”‚   β”‚   └── SocialLoginButtons.tsx
β”‚   β”œβ”€β”€ email/
β”‚   β”‚   └── buttonSendEmail.tsx
β”‚   β”œβ”€β”€ layout/
β”‚   β”‚   └── LayoutWrapper.tsx
β”‚   β”œβ”€β”€ notifications/
β”‚   β”‚   β”œβ”€β”€ DebugInfo.tsx
β”‚   β”‚   β”œβ”€β”€ DeviceInfoCard.tsx
β”‚   β”‚   β”œβ”€β”€ index.ts
β”‚   β”‚   β”œβ”€β”€ NotificationCenter.tsx
β”‚   β”‚   β”œβ”€β”€ NotificationHeader.tsx
β”‚   β”‚   β”œβ”€β”€ NotificationSettings.tsx
β”‚   β”‚   β”œβ”€β”€ PermissionStatusCard.tsx
β”‚   β”‚   β”œβ”€β”€ push.tsx
β”‚   β”‚   └── TestButtonsSection.tsx
β”‚   β”œβ”€β”€ onboarding/
β”‚   β”‚   β”œβ”€β”€ index.ts
β”‚   β”‚   β”œβ”€β”€ NotificationSettings.tsx
β”‚   β”‚   β”œβ”€β”€ OnboardingFeatureCard.tsx
β”‚   β”‚   β”œβ”€β”€ OnboardingNavigationButtons.tsx
β”‚   β”‚   β”œβ”€β”€ OnboardingProgressBar.tsx
β”‚   β”‚   β”œβ”€β”€ OnboardingStep1.tsx
β”‚   β”‚   β”œβ”€β”€ OnboardingStep2.tsx
β”‚   β”‚   └── OnboardingStep3.tsx
β”‚   β”œβ”€β”€ payment/
β”‚   β”‚   β”œβ”€β”€ index.ts
β”‚   β”‚   β”œβ”€β”€ PaymentButton.tsx
β”‚   β”‚   β”œβ”€β”€ PaymentSheet.tsx
β”‚   β”‚   β”œβ”€β”€ paywall.tsx
β”‚   β”‚   └── stripeButtonPay.tsx
β”‚   β”œβ”€β”€ premium/
β”‚   β”‚   β”œβ”€β”€ index.ts
β”‚   β”‚   β”œβ”€β”€ PaywallScreen.tsx
β”‚   β”‚   β”œβ”€β”€ PremiumGate.tsx
β”‚   β”‚   β”œβ”€β”€ PremiumStatus.tsx
β”‚   β”‚   └── RestorePurchaseButton.tsx
β”‚   β”œβ”€β”€ profile/
β”‚   β”‚   β”œβ”€β”€ EditFieldModal.tsx
β”‚   β”‚   β”œβ”€β”€ index.ts
β”‚   β”‚   β”œβ”€β”€ ProfileActionsSection.tsx
β”‚   β”‚   β”œβ”€β”€ ProfileEditSection.tsx
β”‚   β”‚   β”œβ”€β”€ ProfileHeaderSection.tsx
β”‚   β”‚   β”œβ”€β”€ ProfileInfoSection.tsx
β”‚   β”‚   └── ProfileStatusSection.tsx
β”‚   β”œβ”€β”€ settings/
β”‚   β”‚   β”œβ”€β”€ AssistanceSection.tsx
β”‚   β”‚   β”œβ”€β”€ index.ts
β”‚   β”‚   β”œβ”€β”€ NotificationsSection.tsx
β”‚   β”‚   β”œβ”€β”€ PreferencesSection.tsx
β”‚   β”‚   β”œβ”€β”€ ProfileSection.tsx
β”‚   β”‚   β”œβ”€β”€ SettingsRow.tsx
β”‚   β”‚   β”œβ”€β”€ SettingsSection.tsx
β”‚   β”‚   └── SubscriptionSection.tsx
β”‚   β”œβ”€β”€ tasks/
β”‚   β”‚   β”œβ”€β”€ CreateTaskForm.tsx
β”‚   β”‚   β”œβ”€β”€ EditTaskModal.tsx
β”‚   β”‚   β”œβ”€β”€ index.ts
β”‚   β”‚   β”œβ”€β”€ StatusBadges.tsx
β”‚   β”‚   β”œβ”€β”€ TaskCard.tsx
β”‚   β”‚   └── TaskList.tsx
β”‚   └── ui/
β”‚       β”œβ”€β”€ avatar.tsx
β”‚       β”œβ”€β”€ badge.tsx
β”‚       β”œβ”€β”€ button.tsx
β”‚       β”œβ”€β”€ card.tsx
β”‚       β”œβ”€β”€ checkbox.tsx
β”‚       β”œβ”€β”€ dialog.tsx
β”‚       β”œβ”€β”€ dynamic-header.tsx
β”‚       β”œβ”€β”€ header-menu.tsx
β”‚       β”œβ”€β”€ header-title.tsx
β”‚       β”œβ”€β”€ input.tsx
β”‚       β”œβ”€β”€ label.tsx
β”‚       β”œβ”€β”€ ProgressBar.tsx
β”‚       β”œβ”€β”€ select.tsx
β”‚       β”œβ”€β”€ sidebar.tsx
β”‚       β”œβ”€β”€ table.tsx
β”‚       β”œβ”€β”€ tabs.tsx
β”‚       β”œβ”€β”€ text.tsx
β”‚       └── toggle.tsx
β”œβ”€β”€ config/
β”‚   β”œβ”€β”€ i18n.ts
β”‚   β”œβ”€β”€ linking.ts
β”‚   └── supabase.ts
β”œβ”€β”€ constants/
β”‚   β”œβ”€β”€ colors.ts
β”‚   β”œβ”€β”€ emailTemplates.ts
β”‚   β”œβ”€β”€ navigation.ts
β”‚   β”œβ”€β”€ notifications.ts
β”‚   β”œβ”€β”€ onboarding.ts
β”‚   β”œβ”€β”€ promptData.ts
β”‚   └── quickActions.ts
β”œβ”€β”€ context/
β”‚   β”œβ”€β”€ AuthContext.tsx
β”‚   β”œβ”€β”€ RevenuCatContext.tsx
β”‚   β”œβ”€β”€ SidebarContext.tsx
β”‚   β”œβ”€β”€ StripeContext.tsx
β”‚   └── ThemeContext.tsx
β”œβ”€β”€ fetch/
β”‚   β”œβ”€β”€ profile.ts
β”‚   └── tasks.ts
β”œβ”€β”€ hooks/
β”‚   β”œβ”€β”€ useAIChat.ts
β”‚   β”œβ”€β”€ useCache.ts
β”‚   β”œβ”€β”€ useColorScheme.ts
β”‚   β”œβ”€β”€ useIconColors.ts
β”‚   β”œβ”€β”€ useImageUpload.ts
β”‚   β”œβ”€β”€ useNetworkStatus.ts
β”‚   β”œβ”€β”€ useNotifications.ts
β”‚   β”œβ”€β”€ useOnboarding.ts
β”‚   β”œβ”€β”€ usePremiumStatus.ts
β”‚   β”œβ”€β”€ useProfile.ts
β”‚   β”œβ”€β”€ useSounds.ts
β”‚   β”œβ”€β”€ useTasks.ts
β”‚   β”œβ”€β”€ useTheme.tsx
β”‚   └── useTranslation.ts
β”œβ”€β”€ icons/
β”‚   └── index.tsx
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ storage/
β”‚   β”‚   β”œβ”€β”€ index.ts
β”‚   β”‚   β”œβ”€β”€ supabase.ts
β”‚   β”‚   └── zustand.ts
β”‚
β”œβ”€β”€ queryClient.ts
└── utils.ts
β”œβ”€β”€ locales/
β”‚   β”œβ”€β”€ en.json
β”‚   β”œβ”€β”€ es.json
β”‚   β”œβ”€β”€ fr.json
β”‚   └── pt.json
β”œβ”€β”€ stores/
β”‚   β”œβ”€β”€ offlineStore.ts
β”‚   β”œβ”€β”€ onboardingStore.ts
β”‚   β”œβ”€β”€ profileStore.ts
β”‚   └── README.md
β”œβ”€β”€ supabase/
β”‚   β”œβ”€β”€ functions/
β”‚   β”‚   β”œβ”€β”€ ai-completion/
β”‚   β”‚   β”‚   └── index.ts
β”‚   β”‚   β”œβ”€β”€ create-payment-intent/
β”‚   β”‚   β”‚   └── index.ts
β”‚   β”‚   β”œβ”€β”€ create-stripe-checkout/
β”‚   β”‚   β”‚   └── index.ts
β”‚   β”‚   β”œβ”€β”€ resend-email/
β”‚   β”‚   β”‚   └── index.ts
β”‚   β”‚   β”œβ”€β”€ send-notifications/
β”‚   β”‚   β”‚   └── index.ts
β”‚   β”‚   └── stripe-webhooks/
β”‚   β”‚       └── index.ts
β”‚
β”œβ”€β”€ migrations/
β”‚   └── 20250202000000_init_supabase.sql
β”‚
β”œβ”€β”€ templates/
β”‚   └── invite.html
β”‚
└── config.toml

πŸ“ Main Folders Detail

πŸ“± /app - Expo Router Structure

The main application structure using Expo Router file-based routing.

app/
β”œβ”€β”€ (auth)/                   # Authentication group
β”‚   β”œβ”€β”€ resetPassword.tsx    # Password reset screen
β”‚   β”œβ”€β”€ sign-in.tsx          # Sign in screen  
β”‚   β”œβ”€β”€ sign-up.tsx          # Sign up screen
β”‚   └── welcome.tsx          # Welcome screen
β”‚
β”œβ”€β”€ (protected)/             # Protected routes group
β”‚   β”œβ”€β”€ (tabs)/              # Tab navigation
β”‚   β”‚   β”œβ”€β”€ _layout.tsx      # Tab layout configuration
β”‚   β”‚   β”œβ”€β”€ ai.tsx           # AI chat screen
β”‚   β”‚   β”œβ”€β”€ index.tsx        # Home screen
β”‚   β”‚   β”œβ”€β”€ notifications.tsx # Notifications screen
β”‚   β”‚   β”œβ”€β”€ offline.tsx      # Offline mode screen
β”‚   β”‚   β”œβ”€β”€ payment.tsx      # Payment screen
β”‚   β”‚   β”œβ”€β”€ premium.tsx      # Premium features screen
β”‚   β”‚   β”œβ”€β”€ profile.tsx      # Profile screen
β”‚   β”‚   β”œβ”€β”€ settings.tsx     # Settings screen
β”‚   β”‚   └── tasks.tsx        # Tasks screen
β”‚   β”œβ”€β”€ _layout.tsx          # Protected layout
β”‚   β”œβ”€β”€ privacy-policy.tsx   # Privacy policy
β”‚   └── terms-of-service.tsx # Terms of service
β”‚
β”œβ”€β”€ onboarding/              # Onboarding flow
β”‚   β”œβ”€β”€ _layout.tsx          # Onboarding layout
β”‚   └── index.tsx            # Onboarding screens
β”‚
β”œβ”€β”€ _layout.tsx              # Root layout
β”œβ”€β”€ +not-found.tsx           # 404 page
└── index.tsx                # App entry point

🎨 /assets - Static Resources

Contains all static resources for your application.

assets/
β”œβ”€β”€ fonts/                   # Custom fonts
β”‚   β”œβ”€β”€ InstrumentSerif-Italic.ttf
β”‚   └── InstrumentSerif-Regular.ttf
β”‚
β”œβ”€β”€ icons/                   # App icons
β”‚   β”œβ”€β”€ adaptive_icon.png    # Android adaptive icon
β”‚   β”œβ”€β”€ icon_base.png        # Base icon
β”‚   β”œβ”€β”€ icon_dark.png        # Dark theme icon
β”‚   └── icon_light.png       # Light theme icon
β”‚
β”œβ”€β”€ logo/                    # Service logos
β”‚   β”œβ”€β”€ revenuecat.png       # RevenueCat logo
β”‚   └── stripe.jpeg          # Stripe logo
β”‚
β”œβ”€β”€ splashscreen/            # Splash screens
β”‚   β”œβ”€β”€ splashscreen_dark.png
β”‚   └── splashscreen_light.png
β”‚
└── icon.png                 # Main app icon

🧩 /components - Reusable Components

Reusable components organized by categories and features.

components/
β”œβ”€β”€ ai/                       # AI-related components
β”‚   β”œβ”€β”€ AIThinkingLoader.tsx  # AI processing indicator
β”‚   β”œβ”€β”€ AutoResizingInput.tsx # Dynamic height input
β”‚   β”œβ”€β”€ ChatHeader.tsx        # Chat interface header
β”‚   β”œβ”€β”€ MessageActions.tsx    # Message interaction buttons
β”‚   β”œβ”€β”€ MessageBubble.tsx     # Chat message display
β”‚   β”œβ”€β”€ PromptLabels.tsx      # Predefined prompts
β”‚   β”œβ”€β”€ ThinkingAnimation.tsx # AI thinking animation
β”‚   β”œβ”€β”€ TypewriterText.tsx    # Animated text reveal
β”‚   └── index.ts              # Exports
β”‚
β”œβ”€β”€ auth/                     # Authentication components
β”‚   β”œβ”€β”€ appleProviderButton.tsx    # Apple Sign In
β”‚   β”œβ”€β”€ EmailLoginForm.tsx         # Email login form
β”‚   β”œβ”€β”€ EmailLoginToggle.tsx       # Login/signup toggle
β”‚   β”œβ”€β”€ googleProviderButton.tsx   # Google Sign In
β”‚   β”œβ”€β”€ Separator.tsx              # Visual separator
β”‚   β”œβ”€β”€ SocialLoginButtons.tsx     # Social login buttons
β”‚   └── index.ts                   # Exports
β”‚
β”œβ”€β”€ email/                    # Email components
β”‚   └── buttonSendEmail.tsx   # Email sending button
β”‚
β”œβ”€β”€ layout/                   # Layout components
β”‚   └── LayoutWrapper.tsx     # Base layout wrapper
β”‚
β”œβ”€β”€ notifications/            # Notification components
β”‚   β”œβ”€β”€ DebugInfo.tsx             # Debug information display
β”‚   β”œβ”€β”€ DeviceInfoCard.tsx        # Device information card
β”‚   β”œβ”€β”€ NotificationCenter.tsx    # Notification center
β”‚   β”œβ”€β”€ NotificationHeader.tsx    # Notifications header
β”‚   β”œβ”€β”€ NotificationSettings.tsx  # Settings interface
β”‚   β”œβ”€β”€ PermissionStatusCard.tsx  # Permission status display
β”‚   β”œβ”€β”€ push.tsx                  # Push notifications
β”‚   β”œβ”€β”€ TestButtonsSection.tsx    # Testing utilities
β”‚   └── index.ts                  # Exports
β”‚
β”œβ”€β”€ onboarding/               # Onboarding components
β”‚   β”œβ”€β”€ NotificationSettings.tsx      # Permission requests
β”‚   β”œβ”€β”€ OnboardingFeatureCard.tsx     # Feature showcase
β”‚   β”œβ”€β”€ OnboardingNavigationButtons.tsx # Navigation
β”‚   β”œβ”€β”€ OnboardingProgressBar.tsx     # Progress indicator
β”‚   β”œβ”€β”€ OnboardingStep1.tsx           # Step 1 component
β”‚   β”œβ”€β”€ OnboardingStep2.tsx           # Step 2 component
β”‚   β”œβ”€β”€ OnboardingStep3.tsx           # Step 3 component
β”‚   └── index.ts                      # Exports
β”‚
β”œβ”€β”€ payment/                  # Payment components
β”‚   β”œβ”€β”€ PaymentButton.tsx     # Generic payment button
β”‚   β”œβ”€β”€ PaymentSheet.tsx      # Payment form interface
β”‚   β”œβ”€β”€ paywall.tsx           # Simple paywall
β”‚   β”œβ”€β”€ stripeButtonPay.tsx   # Stripe payment button
β”‚   └── index.ts              # Exports
β”‚
β”œβ”€β”€ premium/                  # Premium features
β”‚   β”œβ”€β”€ PaywallScreen.tsx     # Complete paywall screen
β”‚   β”œβ”€β”€ PremiumGate.tsx       # Content protection
β”‚   β”œβ”€β”€ PremiumStatus.tsx     # Subscription status
β”‚   β”œβ”€β”€ RestorePurchaseButton.tsx # Purchase restoration
β”‚   └── index.ts              # Exports
β”‚
β”œβ”€β”€ profile/                  # Profile components
β”‚   β”œβ”€β”€ EditFieldModal.tsx         # Field editing modal
β”‚   β”œβ”€β”€ ProfileActionsSection.tsx  # Profile actions
β”‚   β”œβ”€β”€ ProfileEditSection.tsx     # Edit interface
β”‚   β”œβ”€β”€ ProfileHeaderSection.tsx   # Header with avatar
β”‚   β”œβ”€β”€ ProfileInfoSection.tsx     # Information display
β”‚   β”œβ”€β”€ ProfileStatusSection.tsx   # Account status
β”‚   └── index.ts                   # Exports
β”‚
β”œβ”€β”€ settings/                 # Settings components
β”‚   β”œβ”€β”€ AssistanceSection.tsx      # Help and support
β”‚   β”œβ”€β”€ NotificationsSection.tsx   # Notification settings
β”‚   β”œβ”€β”€ PreferencesSection.tsx     # App preferences
β”‚   β”œβ”€β”€ ProfileSection.tsx         # Profile settings
β”‚   β”œβ”€β”€ SettingsRow.tsx           # Individual setting item
β”‚   β”œβ”€β”€ SettingsSection.tsx       # Settings container
β”‚   β”œβ”€β”€ SubscriptionSection.tsx   # Subscription management
β”‚   └── index.ts                  # Exports
β”‚
β”œβ”€β”€ tasks/                    # Task management
β”‚   β”œβ”€β”€ CreateTaskForm.tsx    # Task creation form
β”‚   β”œβ”€β”€ EditTaskModal.tsx     # Task editing modal
β”‚   β”œβ”€β”€ StatusBadges.tsx      # Task status indicators
β”‚   β”œβ”€β”€ TaskCard.tsx          # Individual task display
β”‚   β”œβ”€β”€ TaskList.tsx          # Task collection
β”‚   └── index.ts              # Exports
β”‚
└── ui/                       # Base UI components
    β”œβ”€β”€ avatar.tsx            # User avatar component
    β”œβ”€β”€ badge.tsx             # Status badges
    β”œβ”€β”€ button.tsx            # Button component
    β”œβ”€β”€ card.tsx              # Card container
    β”œβ”€β”€ checkbox.tsx          # Checkbox input
    β”œβ”€β”€ dialog.tsx            # Modal dialogs
    β”œβ”€β”€ dynamic-header.tsx    # Context-aware header
    β”œβ”€β”€ header-menu.tsx       # Header menu
    β”œβ”€β”€ header-title.tsx      # Page title
    β”œβ”€β”€ input.tsx             # Text input
    β”œβ”€β”€ label.tsx             # Form labels
    β”œβ”€β”€ ProgressBar.tsx       # Progress indicator
    β”œβ”€β”€ select.tsx            # Dropdown selection
    β”œβ”€β”€ sidebar.tsx           # Navigation drawer
    β”œβ”€β”€ table.tsx             # Data table
    β”œβ”€β”€ tabs.tsx              # Tab navigation
    β”œβ”€β”€ text.tsx              # Typography
    └── toggle.tsx            # Switch component

βš™οΈ /config - Configuration Files

Application configuration and setup files.

config/
β”œβ”€β”€ i18n.ts                   # Internationalization setup
β”œβ”€β”€ linking.ts                # Deep linking configuration
└── supabase.ts               # Supabase client configuration

πŸ“Š /constants - App Constants

Global constants and configuration values.

constants/
β”œβ”€β”€ colors.ts                 # Color palette and theme colors
β”œβ”€β”€ emailTemplates.ts         # Email template constants
β”œβ”€β”€ navigation.ts             # Navigation constants
β”œβ”€β”€ notifications.ts          # Notification constants
β”œβ”€β”€ onboarding.ts             # Onboarding constants
β”œβ”€β”€ promptData.ts             # AI prompt templates and data
└── quickActions.ts           # Quick action constants

πŸ”— /context - React Context Providers

Context providers for global state management.

context/
β”œβ”€β”€ AuthContext.tsx           # Authentication state
β”œβ”€β”€ RevenuCatContext.tsx      # Subscription management
β”œβ”€β”€ SidebarContext.tsx        # Sidebar state
β”œβ”€β”€ StripeContext.tsx         # Payment context
└── ThemeContext.tsx          # Theme and dark mode

πŸ“‘ /fetch - API Layer

API service functions and data fetching logic.

fetch/
β”œβ”€β”€ profile.ts                # Profile API operations
└── tasks.ts                  # Task management API

🎣 /hooks - Custom React Hooks

Custom hooks for reusable logic and state management.

hooks/
β”œβ”€β”€ useAIChat.ts              # AI chat functionality
β”œβ”€β”€ useCache.ts               # Caching utilities
β”œβ”€β”€ useColorScheme.ts         # System color scheme
β”œβ”€β”€ useIconColors.ts          # Dynamic icon colors
β”œβ”€β”€ useImageUpload.ts         # Image upload functionality
β”œβ”€β”€ useNetworkStatus.ts       # Network connectivity
β”œβ”€β”€ useNotifications.ts       # Push notifications
β”œβ”€β”€ useOnboarding.ts          # Onboarding flow
β”œβ”€β”€ usePremiumStatus.ts       # Premium subscription status
β”œβ”€β”€ useProfile.ts             # Profile management
β”œβ”€β”€ useSounds.ts              # Sound effects
β”œβ”€β”€ useTasks.ts               # Task management
β”œβ”€β”€ useTheme.tsx              # Theme management
└── useTranslation.ts         # Internationalization

🎨 /icons - Icon Components

Centralized icon components and utilities.

icons/
└── index.tsx                 # Icon library with all app icons

πŸ”§ /lib - Utility Libraries

Core utility functions and libraries.

lib/
β”œβ”€β”€ storage/                 # Storage utilities
β”‚   β”œβ”€β”€ index.ts             # Main storage interface
β”‚   β”œβ”€β”€ supabase.ts          # Supabase storage utilities
β”‚   └── zustand.ts           # Zustand storage configuration
β”‚
β”œβ”€β”€ queryClient.ts
└── utils.ts

🌍 /locales - Internationalization

Translation files for multi-language support.

locales/
β”œβ”€β”€ en.json
β”œβ”€β”€ es.json
β”œβ”€β”€ fr.json
└── pt.json

πŸ“¦ /stores - Zustand State Management

Global state stores using Zustand.

stores/
β”œβ”€β”€ offlineStore.ts          # Offline data management
β”œβ”€β”€ onboardingStore.ts       # Onboarding flow state
β”œβ”€β”€ profileStore.ts          # User profile state
└── README.md                # Store documentation

πŸ—„οΈ /supabase - Backend Configuration

Supabase backend configuration, functions, and database migrations.

supabase/
β”œβ”€β”€ functions/               # Edge functions
β”‚   β”œβ”€β”€ ai-completion/       # AI completion function
β”‚   β”‚   └── index.ts
β”‚   β”œβ”€β”€ create-payment-intent/ # Payment intent creation
β”‚   β”‚   └── index.ts
β”‚   β”œβ”€β”€ create-stripe-checkout/
β”‚   β”‚   └── index.ts
β”‚   β”œβ”€β”€ resend-email/
β”‚   β”‚   └── index.ts
β”‚   β”œβ”€β”€ send-notifications/
β”‚   β”‚   └── index.ts
β”‚   └── stripe-webhooks/
β”‚       └── index.ts
β”‚
β”œβ”€β”€ migrations/
β”‚   └── 20250202000000_init_supabase.sql
β”‚
β”œβ”€β”€ templates/
β”‚   └── invite.html
β”‚
└── config.toml

πŸ“ /types - TypeScript Definitions

Comprehensive TypeScript type definitions for the entire application.

types/
β”œβ”€β”€ ai.d.ts                  # AI chat types
β”œβ”€β”€ auth.d.ts                # Authentication types
β”œβ”€β”€ hooks.d.ts               # Hook types
β”œβ”€β”€ index.ts                 # Type exports
β”œβ”€β”€ navigation.d.ts          # Navigation types
β”œβ”€β”€ onboarding.d.ts          # Onboarding types
β”œβ”€β”€ payment.d.ts             # Payment and subscription types
β”œβ”€β”€ profile.d.ts             # User profile types
β”œβ”€β”€ revenuecat.d.ts          # RevenueCat types
β”œβ”€β”€ settings.d.ts            # Settings types
β”œβ”€β”€ stores.d.ts              # Store types
β”œβ”€β”€ tasks.d.ts               # Task management types
β”œβ”€β”€ theme.d.ts               # Theme types
└── ui.d.ts                  # UI component types

πŸ› οΈ /utils - Utility Functions

Helper functions and utilities used throughout the application.

utils/
β”œβ”€β”€ clearSession.ts          # Session cleanup utilities
└── functionNavigations.ts   # Navigation helper functions

πŸ›οΈ Architecture Principles

ExpoPlate follows clean architecture principles with clear separation of concerns:

πŸ“± Presentation Layer

  • Components: Reusable UI components with clear props interfaces
  • Screens: Route components that compose multiple components
  • Hooks: Custom hooks for component logic and state management

πŸ’Ό Business Logic Layer

  • Stores: Global state management with Zustand
  • Context: React context for specific domains (auth, theme, etc.)
  • Custom Hooks: Encapsulated business logic and API interactions

πŸ”Œ Data Layer

  • Fetch: API service functions for data operations
  • Supabase: Backend-as-a-Service configuration and functions
  • Storage: Local storage utilities (MMKV, Secure Store)

🎨 Presentation Patterns

// Component structure example
const ProfileScreen = () => {
  // 1. Hooks and state
  const { profile, loading, updateProfile } = useProfile();
  const navigation = useNavigation();
  
  // 2. Event handlers
  const handleSave = useCallback(async (data) => {
    await updateProfile(data);
    navigation.goBack();
  }, [updateProfile, navigation]);
  
  // 3. Render logic
  if (loading) return <LoadingSpinner />;
  
  return (
    <ProfileEditForm 
      profile={profile} 
      onSave={handleSave} 
    />
  );
};

πŸ”„ Data Flow

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Screen/Component│───▢│ Custom Hook  │───▢│ API Service │───▢│ Supabase    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
          β–²                     β”‚                                      β”‚
          β”‚                     β–Ό                                      β”‚
          β”‚              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                               β”‚
          └──────────────│ Zustand Storeβ”‚β—€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“‹ Naming Conventions

Files and Folders

  • Components: PascalCase (Button.tsx, LoginForm.tsx)
  • Hooks: camelCase with use prefix (useAuth.ts, useApi.ts)
  • Services: camelCase (profileService.ts, taskService.ts)
  • Utilities: camelCase (formatDate.ts, validation.ts)
  • Folders: camelCase (components, hooks, stores)

Variables and Functions

  • Variables: camelCase (isLoading, userProfile)
  • Constants: SCREAMING_SNAKE_CASE (API_BASE_URL, MAX_RETRY_ATTEMPTS)
  • Functions: camelCase (handleLogin, formatCurrency)
  • Components: PascalCase (LoginScreen, CustomButton)

TypeScript Types

  • Interfaces: PascalCase (User, ApiResponse)
  • Types: PascalCase (TaskStatus, NavigationRoute)
  • Enums: PascalCase (AuthStatus, PaymentStatus)

🎯 Best Practices

Import Organization

// 1. External libraries
import React from 'react';
import { View, Text } from 'react-native';
 
// 2. Internal project imports
import { Button } from '../../components/ui';
import { useAuth } from '../../hooks/useAuth';
import { colors } from '../../constants/colors';
 
// 3. Type imports
import type { LoginScreenProps } from './types';

Centralized Exports

// components/ui/index.ts
export { Button } from './button';
export { Input } from './input';
export { Card } from './card';
export { Dialog } from './dialog';
 
// Usage
import { Button, Input, Card } from '../components/ui';

Component Structure

// Standard component structure
const TaskCard: React.FC<TaskCardProps> = ({ 
  task, 
  onToggleComplete, 
  onEdit, 
  onDelete 
}) => {
  // 1. Hooks and state
  const [isEditing, setIsEditing] = useState(false);
  const { user } = useAuth();
  
  // 2. Event handlers
  const handleEdit = useCallback(() => {
    setIsEditing(true);
  }, []);
  
  // 3. Effects
  useEffect(() => {
    // Component effects
  }, []);
  
  // 4. Render logic
  return (
    <Card className="p-4 mb-2">
      {/* Component JSX */}
    </Card>
  );
};

πŸš€ Next Steps

Now that you understand the structure:

  1. πŸ” Authentication - User management and security
  2. 🎨 Design System - Colors and theming
  3. 🎯 Icons System - Icon color management
  4. πŸ“š Basic Example - Getting started examples

πŸ’‘ Pro Tip

This structure is designed to be scalable and maintainable. Feel free to adapt it according to your specific project needs while maintaining the core architectural principles!