Directory Overview
app/ Directory
Theapp/ directory contains all routes and screens using Expo Router’s file-based routing system.
Route Groups
(auth)/ - Authentication Routes
(auth)/ - Authentication Routes
Contains login and authentication-related screens.Files:
login-admin.tsx- Admin/Editor login screen
Route groups in parentheses like
(auth) don’t affect the URL path.(main)/ - Protected Dashboard Routes
(main)/ - Protected Dashboard Routes
Protected routes that require authentication. Contains role-based dashboards.Structure:The
_layout.tsx file acts as an authentication guard:app/(main)/_layout.tsx
landing/ - Public Routes
landing/ - Public Routes
Public-facing screens accessible without authentication.Files:
index.tsx- Landing home with news carouselestrategias.tsx- Health strategies informationestablecimientos.tsx- Health facilities directorytransparencia.tsx- Transparency portalcontacto.tsx- Contact information_layout.tsx- Tab navigation layout
lucide-react-native.external/ - External Pages
external/ - External Pages
Standalone pages for specific public information.Files:
normas-publicas.tsx- Public regulations viewer
Root Files
src/ Directory
Thesrc/ directory contains all business logic, components, and utilities.
components/
Reusable UI components shared across the app. Files:ThemedText.tsx- Text component with theme supportThemedView.tsx- View component with theme supportdashboard/- Dashboard-specific components
hooks/
Custom React hooks for reusable logic.useAuth.tsx
Authentication state management, login/logout, token lifecycle
useDebounce.ts
Debounce values for search inputs
useThemeColor.ts
Theme color management
useFetchNormas.ts
Fetch and manage regulations data
useColorScheme.ts
Detect system color scheme
services/
API clients and external service integrations. Files:apiClient.ts- Axios instance with base configuration and token managementauthService.ts- Authentication service utilities
src/services/apiClient.ts
types/
TypeScript type definitions for type safety. Files:auth.ts- Authentication types (LoginResponse, User)Norma.ts- Regulation typesUser.ts- User model types
src/types/auth.ts
context/
React Context providers for global state. Files:PermissionContext.tsx- Role-based permission management
assets/ Directory
Static assets including images, logos, and splash screens.Configuration Files
app.json
Expo and EAS Build configuration:package.json
Dependencies and scripts:Best Practices
Route Organization: Use route groups
(groupName) to organize screens without affecting URLsComponent Reusability: Keep shared components in
src/components/Type Safety: Define types in
src/types/ and import across the appService Layer: Centralize API calls in
src/services/Custom Hooks: Extract reusable logic into hooks in
src/hooks/Next Steps
Routing
Learn about Expo Router implementation
Authentication
Understand the authentication flow
