Quick Start Guide
Get the RIS Gran Chimú mobile app up and running on your device in just a few minutes.Prerequisites Checklist
Before starting, ensure you have:- ✅ Node.js (v18+) and npm installed
- ✅ Expo Go app installed on your mobile device
- ✅ Source code downloaded or cloned
If you haven’t set these up yet, visit the Installation Guide for detailed instructions.
Getting Started
Install Dependencies
Navigate to the project directory and install all dependencies:This typically takes 2-3 minutes depending on your internet connection.
Configure API Endpoint
The app comes pre-configured to use the production backend. If you need to change it, edit Common configurations:
src/services/apiClient.ts:src/services/apiClient.ts
Start the Development Server
Launch the Expo development server:You’ll see output similar to:The server runs on port 8081 by default and provides a QR code for easy access.
Open on Your Device
There are two ways to open the app:Option 1: Scan QR Code (Recommended)
- Android: Open the Expo Go app and tap “Scan QR Code”
- iOS: Open the native Camera app and point it at the QR code
a- Open on Android emulator/devicei- Open on iOS simulatorw- Open in web browser
Make sure your computer and mobile device are on the same Wi-Fi network.
Explore the App
Once the app loads on your device, you can:
- Browse institutional news on the landing page
- View health facility information
- Access official regulations and documents
- Test the login flow (if you have admin credentials)
Development Commands
Here are the most commonly used commands during development:Understanding the App Flow
For Public Users
- Landing Page (
app/index.tsx): Main entry point showing institutional news carousel - News Section (
app/landing/noticias.tsx): Detailed news articles - Contact Page (
app/landing/contacto.tsx): Citizen service channels - Health Guide: Information about facilities, services, and strategies
For Administrators
- Login (
app/(auth)/): Authentication with JWT tokens - Dashboard (
app/(main)/dashboard/): Role-based control panel - Content Management: Create and edit news, facilities, and services
The app implements “Lazy Auth” - it remains functional even when the backend is slow to respond, providing a better user experience.
API Client Configuration
The app uses Axios with custom configuration for API calls. Here’s how it works:src/services/apiClient.ts
- Automatic Token Injection: JWT tokens are automatically added to requests
- Session Persistence: Tokens are stored securely using
expo-secure-store - Auto-logout: 401 responses trigger automatic redirect to login
- 10-second timeout: Requests fail gracefully if the server doesn’t respond
Troubleshooting
QR code not scanning
QR code not scanning
If the QR code doesn’t work:
- Ensure your phone and computer are on the same Wi-Fi network
- Try manually entering the URL shown in the terminal into Expo Go
- Restart the development server with
npx expo start --clear
App shows 'Unable to connect to server'
App shows 'Unable to connect to server'
Check your API configuration:
- Verify the
BASE_URLinsrc/services/apiClient.ts - If using localhost, replace with your computer’s IP address
- Ensure the backend server is running and accessible
- Test the API endpoint in a browser:
https://ris-gran-chimu-backend.vercel.app/api
Metro bundler errors
Metro bundler errors
Clear the cache and restart:
App crashes on startup
App crashes on startup
Check for common issues:
- Ensure all dependencies are installed:
npm install - Verify Node.js version:
node --version(should be 18+) - Check for TypeScript errors:
npx tsc --noEmit - Review the error logs in the Expo Go app or terminal
Building for Production
Once you’re ready to create a production build:The production build process requires an Expo account. Sign up at expo.dev if you don’t have one.
Next Steps
Architecture
Understand the app’s structure and file organization
API Integration
Learn how to work with the backend API
Authentication
Implement secure login and token management
Deployment
Deploy your app to production
Support
If you encounter issues not covered in this guide, check:- Expo Documentation
- React Native Documentation
- Backend API repository for server-related issues
