Environment Setup
This page covers prerequisites, environment variables, customization steps, available scripts, and build configuration for RNCopilot.
Prerequisites
Make sure the following tools are installed before working with RNCopilot:
| Tool | Minimum Version | Notes |
|---|---|---|
| Node.js | 18+ | LTS recommended. Check with node --version |
| npm | Included with Node.js | Check with npm --version |
| Expo CLI | Latest | Used via npx expo — no global install needed |
| iOS Simulator | Xcode 15+ | macOS only. Install Xcode from the Mac App Store |
| Android Emulator | Android Studio | Required for Android development |
You can also test on physical devices using Expo Go. No simulator or emulator is strictly required for initial development.
Environment Variables
RNCopilot uses a .env file for configuration. Copy the example file to get started:
cp .env.example .envAll environment variables are optional. The app boots and functions without any of them configured. Add them as you integrate services.
Available Variables
| Variable | Required | Default | Description |
|---|---|---|---|
EXPO_PUBLIC_SUPABASE_URL | No | — | Your Supabase project URL |
EXPO_PUBLIC_SUPABASE_PUBLISHED_KEY | No | — | Your Supabase anon/public key |
EXPO_PUBLIC_API_BASE_URL | No | https://api.example.com | Base URL for the Axios API client |
EXPO_PUBLIC_SENTRY_DSN | No | — | Sentry DSN for error tracking |
EXPO_PUBLIC_APP_ENV | No | development | App environment: development, staging, or production |
All Expo public environment variables must be prefixed with EXPO_PUBLIC_. Variables without this prefix will not be accessible in the client bundle.
Supabase Setup
To connect Supabase:
Create a Supabase project
Go to supabase.com and create a new project.
Copy your credentials
Find your project URL and anon key in Settings > API.
Add them to .env
EXPO_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
EXPO_PUBLIC_SUPABASE_PUBLISHED_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6...Restart the dev server
Environment variable changes require a server restart:
npm startIf Supabase credentials are missing, the app gracefully degrades. Auth features will not function, but the rest of the app works normally. This makes it easy to develop UI and business logic before setting up a backend.
Customization Checklist
When adapting RNCopilot for your own project, work through these items:
| Item | File(s) | What to Change |
|---|---|---|
| App name and identifiers | app.json | name, slug, scheme, bundleIdentifier, package |
| Package metadata | package.json | name, version, description, repository |
| Environment variables | .env | Supabase URL, API base URL, Sentry DSN |
| Theme colors | src/theme/ | Brand primary, accent, semantic tokens |
| Translations | src/i18n/en.json, ar.json | App-specific strings, remove template strings |
| Storage keys | src/utils/storage/ | Update MMKV key names for your domain |
| Tab screens | app/(main)/(tabs)/ | Add, remove, or rename tabs |
RNCopilot includes an interactive migration wizard. Run npm run migrate for a guided walkthrough of all customization steps, or follow the detailed Migration Guide for manual instructions.
Available Scripts
Development
| Command | Description |
|---|---|
npm start | Start the Expo development server |
npm run ios | Build and run on iOS Simulator |
npm run android | Build and run on Android Emulator |
Code Quality
| Command | Description |
|---|---|
npm run type-check | Run the TypeScript compiler (no emit) |
npm run lint | Run ESLint across the codebase |
npm run lint:fix | Auto-fix ESLint issues |
npm run format | Format all files with Prettier |
npm run format:check | Check formatting without writing changes |
npm run validate | Run all checks: type-check + lint + format |
Run npm run validate before committing to catch all issues at once. This is the same set of checks that Husky runs in the pre-commit hook.
Testing
| Command | Description |
|---|---|
npm test | Run the Jest test suite |
npm run test:coverage | Run tests with a coverage report |
Reset and Migration
| Command | Description |
|---|---|
npm run migrate | Interactive migration wizard |
npm run reset-showcase | Remove home screen showcase content (keeps auth) |
npm run reset-template | Full reset — removes all example content for a blank canvas |
EAS Build
RNCopilot is compatible with Expo Application Services (EAS) for building and submitting to app stores.
Install EAS CLI
npm install -g eas-cliLog in to your Expo account
eas loginConfigure your project
eas build:configureThis generates an eas.json file with build profiles for development, preview, and production.
Create a build
# Development build (includes dev tools)
eas build --platform ios --profile development
eas build --platform android --profile development
# Production build
eas build --platform ios --profile production
eas build --platform android --profile productionSubmit to stores
eas submit --platform ios
eas submit --platform androidEAS Build requires an Expo account. Development builds require a paid EAS subscription for priority queues, though free-tier builds are available with longer wait times.
Next Steps
With your environment configured, explore the rest of the documentation:
- Project Structure — Understand how the codebase is organized
- Quick Start — Get the app running if you haven’t already