Overview
The Launch mobile app follows a well-organized structure that makes it easy for developers to find components, understand data flow, and maintain the codebase.Prerequisites
- Basic familiarity with Expo Router
Steps
Directory Structure
Key Patterns
Component Organization
Components live primarily in a flatcomponents/ folder. Grouping is done by
naming and usage instead of deep subfolders (e.g., auth-button.tsx,
model-select.tsx, screen-container.tsx). Small subfolders like __tests__
exist for tests, but the main component surface stays flat for easy imports.
Configuration & Feature Flags
There is nolaunch.config.ts in the repo. App configuration and feature
flags live in:
app.config.ts(Expo config, plugins, bundle identifiers)features/feature-registry.tsx(feature enable/disable, providers)
app.config.ts is required by Expo to wire native identifiers (bundle ID /
package name), deep link schemes, and plugin configuration. The repo ships
placeholder values so you can commit safely—replace them with your own before
building.
Screen Patterns
Authentication Flow
Feature Registry
The feature registry composes optional modules (payments, AI, uploads, Sentry) in one place:Component Composition
Design System Integration
Spacing
Use predefined spacing tokens instead of arbitrary values:Colors
Colors are defined in the theme system and accessed consistently:Typography
Font families are configured in the design system:Best Practices
Component Creation
- Reusable components go in
components/(flat, with minimal subfolders) - Screen-specific components can stay in the screen file if they won’t be reused
- Always export from the folder’s
index.tsfile - Use TypeScript interfaces for props
State Management
- Authentication state - Use
authClient.useSession() - Theme state - Use
useTheme()hook - Form factor detection - Use
useResponsive()for device types - Local state - Use React’s
useStateanduseEffect
Styling Approach
- NativeWind classes for most styling
- Style objects when dynamic values are needed
- Theme system for colors and fonts
- Spacing tokens for consistent layout
Adding New Features
New Screen
- Create screen file in
app/ - Add route group or stack entry if needed
- Gate behind feature registry when optional
- Extract reusable components to
components/
New Component
- Create component in
components/ - Write TypeScript interface for props
- Add to the calling screen or feature module
Troubleshooting
- File not routing: confirm file name and path under
app/ - Import issues: use
@/aliases consistently