Directory Overview
The project uses TypeScript throughout, with
.tsx for components and .ts for utilities.Key Directories
app/
app/
The
app/ directory contains all your screens and implements Expo Router’s file-based routing.- Each file automatically becomes a route
- Folders with
()are route groups that don’t affect the URL - Files named
_layout.tsxdefine nested layouts - Files named
index.tsxare the default route in that directory
components/
components/
Contains all reusable React components organized by purpose:
- UI components (
components/ui/): Low-level primitives like icons and collapsibles - Themed components: Components that automatically adapt to light/dark mode
- Feature components: Complex components like
ParallaxScrollView,HelloWave
constants/
constants/
Houses app-wide constants including:
- theme.ts: Color palettes and font definitions for light and dark modes
- Future constants for API endpoints, feature flags, etc.
hooks/
hooks/
Custom React hooks for common functionality:
use-color-scheme.ts: Detects system color scheme (light/dark)use-theme-color.ts: Returns themed colors based on current scheme- Platform-specific variants (e.g.,
use-color-scheme.web.ts)
File Naming Conventions
- Components
- Screens
- Hooks
- Use kebab-case:
themed-text.tsx,haptic-tab.tsx - Platform-specific:
icon-symbol.ios.tsx - Folders for related components:
components/ui/
TypeScript Configuration
The project uses path aliases for cleaner imports:@/ instead of relative paths:
Always use the
@/ alias for imports within the project. This makes refactoring easier and prevents broken import paths.Package Structure
Key dependencies frompackage.json:
Next Steps
Routing
Learn how file-based routing works in GymApp
Theming
Understand the theming system and color schemes