Directory Overview
The project is organized into several key directories undersrc/:
App Directory
Theapp/ directory uses Expo Router’s file-based routing system. Each file automatically becomes a route in your application.
Route Structure
Route Structure
Main Layout
File:src/app/_layout.tsxThe root layout configures the navigation theme and sets up the main stack navigator:src/app/_layout.tsx
- Automatic theme switching based on device settings
- Stack navigation with tab and modal screens
- Global status bar configuration
Tab Navigation
Directory:src/app/(tabs)/The (tabs) directory contains the main tabbed navigation structure. Parentheses indicate a route group that doesn’t add a path segment.Routes:index.tsx- Home screen (accessed at/)explore.tsx- Explore screen (accessed at/explore)_layout.tsx- Tab navigation configuration
Modal Routes
File:src/app/modal.tsxModal screens are presented on top of the main navigation stack with a modal presentation style.Components Directory
Reusable components are organized by functionality:- Core Components
- Layout Components
- Interactive Components
ThemedText
File:src/components/themed-text.tsxA text component that automatically adapts to light and dark themes:default- Standard body text (16px)title- Large heading (32px, bold)defaultSemiBold- Semibold body text (16px)subtitle- Section heading (20px, bold)link- Link styled text
ThemedView
File:src/components/themed-view.tsxA view container with automatic theme-aware background colors:UI Components
Directory:src/components/ui/
Specialized UI components:
IconSymbol
Cross-platform icon component using SF Symbols (iOS) and Material Icons (Android/Web)
Collapsible
Expandable/collapsible content sections
Constants Directory
Application-wide constants and configuration: File:src/constants/theme.ts
Contains color schemes and font definitions. See Theme System for details.
Hooks Directory
Custom React hooks for common functionality:useColorScheme
useColorScheme
File:
src/hooks/use-color-scheme.tsDetects the device color scheme:useThemeColor
useThemeColor
File:
src/hooks/use-theme-color.tsGets theme-specific colors with optional overrides:Path Aliases
The project uses TypeScript path aliases for clean imports:@/→src/@assets/→assets/
File Naming Conventions
Follow these conventions for consistency:
- Components: kebab-case (e.g.,
themed-text.tsx) - Screens: kebab-case (e.g.,
index.tsx,explore.tsx) - Hooks: kebab-case with
use-prefix (e.g.,use-color-scheme.ts) - Constants: kebab-case (e.g.,
theme.ts) - Types: PascalCase for interfaces and types
Key Dependencies
The project relies on these core libraries:| Package | Purpose |
|---|---|
expo-router | File-based navigation |
react-native-reanimated | Smooth animations |
expo-haptics | Haptic feedback |
expo-symbols | SF Symbols support |
@expo/vector-icons | Icon library |
Next Steps
Theme System
Learn about colors and theming
Navigation
Configure routes and navigation
Components
Explore available components