Technology Stack
The application leverages the following core technologies:Expo SDK 54
Modern React Native framework with over-the-air updates and streamlined build process
Expo Router
File-based routing system for type-safe navigation
TypeScript
Strong typing for improved developer experience and code quality
Axios
HTTP client with interceptors for API communication
Architecture Principles
File-Based Routing
The app uses Expo Router for navigation, providing automatic type-safe routing based on the file structure in theapp/ directory. This approach:
- Eliminates manual route configuration
- Provides automatic deep linking support
- Enables better code splitting and lazy loading
- Simplifies navigation logic
Component-Based Architecture
The codebase follows a clear separation of concerns:Authentication Flow
The app implements a JWT-based authentication system with the following features:API Integration Pattern
The app communicates with the backend API using a centralized Axios instance located atsrc/services/apiClient.ts:
src/services/apiClient.ts
Token Management
Authentication tokens are automatically attached to all requests:src/services/apiClient.ts
State Management
The app uses React Context API for global state management:Key Context Providers
- AuthProvider: Manages user authentication state, login/logout, and token lifecycle
- PermissionProvider: Handles role-based access control for admin and editor features
Platform Configuration
The app includes platform-specific configuration for Android:app/_layout.tsx
Offline Support
The app implements a “Lazy Auth” system that maintains functionality even when the backend is slow to respond:If token validation fails due to network issues, the app validates the JWT locally and allows the user to continue if the token hasn’t expired.
src/hooks/useAuth.tsx
Next Steps
Project Structure
Detailed breakdown of directories and files
Routing
Learn about Expo Router implementation
Authentication
Deep dive into JWT authentication flow
