Project Root Structure
Core Directories
/app - Expo Router
File-based Routing
Expo Router uses file system for navigation
Files in
app/ automatically become routes. Learn more about Expo Router./src - Clean Architecture
The src/ directory contains the application’s core logic organized by architectural layers.
Domain Layer
Location
src/domain/Example Files
Domain entities are plain TypeScript interfaces - no classes, no framework dependencies.
Application Layer
Location
src/application/Services
Services contain business logic and coordinate between repositories and UI.Validators
Error Handling
Infrastructure Layer
Location
src/infraestructure/Database
Repositories
Repositories abstract database operations.Presentation Layer
Location
src/presentation/Custom Hooks
Hooks bridge the UI and application layers.Components
Shared Directories
/components - Shared UI Components
/hooks - Shared Hooks
/constants
Configuration Files
app.json
Expo configuration:
tsconfig.json
TypeScript configuration:
package.json
Key dependencies:
Import Aliases
The project uses@/ as an import alias for the root directory:
File Naming Conventions
TypeScript Files
TypeScript Files
- PascalCase for components and classes:
RecordService.ts,RecordCard.tsx - camelCase for utilities and hooks:
useRecords.ts,getErrorMessage.ts
Component Files
Component Files
- Use
.tsxextension for React components - Use
.tsfor non-React TypeScript files
Test Files
Test Files
- Co-locate tests:
RecordService.test.ts - Use
.test.tsor.spec.tsextension
Best Practices
One Entity Per File
Each entity, service, or component gets its own file
Index Exports
Use
index.ts to re-export from directoriesColocate Tests
Keep test files next to the code they test
Shared Code
Put reusable code in shared directories
Next Steps
Clean Architecture
Learn about the architectural layers
Data Flow
Understand how data moves through the system
Development Guide
Start building features
API Reference
Explore the API documentation