This guide will help you set up the backend infrastructure for your mobile app. The infrastructure is ready to use but optional - your base app will work without it until you need these features.
- Frontend: Expo + React Native + TypeScript (your existing base app)
- Authentication: Supabase Auth (ready when needed)
- Backend: Expo API Routes (for future business logic)
- Database: Supabase PostgreSQL + Drizzle ORM (ready when needed)
- File Storage: Supabase Storage (ready when needed)
- State Management: Zustand + TanStack Query (ready when needed)
- Validation: Zod schemas
- Build System: EAS Build
- Deployment: EAS Submit
-
Create a Supabase project: https://supabase.com/dashboard
-
Get your credentials:
- Project URL
- Anon key
- Service role key (keep this secret!)
- Database connection string
-
Enable authentication providers (when you add auth):
- Go to Authentication > Providers
- Enable Email provider
- Enable Google provider (add OAuth credentials)
Copy env.example
to .env.local
and fill in your values:
cp env.example .env.local
# Generate database migrations
npm run db:generate
# Apply migrations to your Supabase database
npm run db:migrate
# Optional: Open Drizzle Studio to manage your database
npm run db:studio
# Install EAS CLI globally
npm install -g eas-cli
# Login to your Expo account
eas login
# Initialize EAS in your project
eas build:configure
-
Apple Developer Account:
- Sign up at https://developer.apple.com
- Cost: $99/year
- Required for publishing to App Store
-
Bundle Identifier (
expo.ios.bundleIdentifier
):- Format:
com.yourcompany.yourappname
- Example:
com.johnsmith.appname
- Must be unique across all iOS apps
- Register in Apple Developer Console > Certificates, Identifiers & Profiles > Identifiers
- Format:
-
App Store Connect Setup:
- Go to https://appstoreconnect.apple.com
- Create new app with your bundle identifier
- Fill app information, categories, pricing
-
Google Play Console Account:
- Sign up at https://play.google.com/console
- One-time fee: $25
- Required for publishing to Google Play Store
-
Package Name (
expo.android.package
):- Format:
com.yourcompany.yourappname
(same as iOS for consistency) - Must be unique across all Android apps
- Cannot be changed after first upload to Play Store
- Format:
-
App Signing Setup:
- Google Play App Signing is recommended (managed by Google)
- EAS Build automatically handles signing keys
- Alternative: Upload your own signing keys
-
Play Console App Setup:
- Create new app in Google Play Console
- Fill app details, store listing, content rating
- Set up app categories and target audience
Update your app configuration:
{
"expo": {
"name": "Your App Name",
"slug": "your-app-slug",
"ios": {
"bundleIdentifier": "com.yourcompany.yourappname",
"buildNumber": "1"
},
"android": {
"package": "com.yourcompany.yourappname",
"versionCode": 1
},
"extra": {
"eas": {
"projectId": "your-eas-project-id"
}
}
}
}
iOS Requirements:
- Apple Developer Account ($99/year)
- Unique Bundle Identifier
- App Store Connect app created
- App privacy policy (if collecting data)
- App screenshots (multiple sizes)
- App description and keywords
- Age rating completed
Android Requirements:
- Google Play Console Account ($25 one-time)
- Unique Package Name
- Play Console app created
- Content rating questionnaire completed
- Privacy policy (if collecting data)
- App screenshots (multiple sizes)
- Store listing completed
- Target SDK requirements met
# Start development server
npm start
# Run on iOS simulator
npm run ios
# Run on Android emulator
npm run android
# Run on web
npm run web
# Development build (for testing on devices)
eas build --profile development --platform all
# Preview build (for internal testing)
eas build --profile preview --platform all
# Production build (for app stores)
eas build --profile production --platform all
# Build for specific platform only
eas build --profile production --platform ios
eas build --profile production --platform android
# Submit to both app stores
eas submit --platform all
# Submit to specific stores
eas submit --platform ios
eas submit --platform android
# Create internal distribution build
eas build --profile preview
# Share with TestFlight (iOS) or Internal Testing (Android)
eas submit --platform ios --channel testflight
eas submit --platform android --channel internal
mobile-app-boilerplate/
βββ app/ # Your existing Expo Router app
β βββ api/ # API routes (ready for backend logic)
β β βββ auth/ # Authentication endpoints
β β βββ user/ # User management endpoints
β βββ (tabs)/ # Your existing tab navigation
β βββ _layout.tsx # Root layout (unchanged)
βββ lib/ # Backend infrastructure (ready to use)
β βββ api/ # API client and hooks
β βββ auth/ # Authentication logic
β βββ db/ # Database schema and connection
β βββ store/ # State management
β βββ supabase/ # Supabase client
βββ components/ # Your existing components
βββ env.example # Environment variables template
βββ eas.json # Build configuration
βββ assets/ # Your existing assets
-
Database Setup: Ready for when you need data persistence
- User management schema
- Migration system
- Type-safe database operations
-
Authentication System: Ready for when you need user accounts
- Supabase Auth integration
- JWT token handling
- User profile management
-
API Layer: Ready for backend business logic
- Type-safe API client
- React Query hooks for server state
- Authentication middleware
-
Build System: Ready for app store deployment
- EAS Build configuration
- Multiple build profiles
- App store submission setup
Your existing tabs-based app will work exactly as before. The infrastructure is there when you need it, but doesn't interfere with your current app.
- iOS: Apple Developer Account ($99/year)
- Android: Google Play Console ($25 one-time)
# Update app.json with your unique identifiers
"ios": { "bundleIdentifier": "com.yourcompany.yourappname" }
"android": { "package": "com.yourcompany.yourappname" }
eas login
eas build:configure
# Build for both platforms
eas build --profile production --platform all
# Submit to both stores
eas submit --platform all
When you're ready to add features:
-
Add Authentication:
- Wrap your app with AuthProvider
- Use the pre-built auth hooks
-
Add Database:
- Set up Supabase
- Run migrations
- Use the API hooks
-
Add File Upload:
- Configure Supabase Storage
- Use the upload utilities
-
Add Business Logic:
- Create API routes in
app/api/
- Use the authentication middleware
- Create API routes in
- Environment variables configured properly
- Authentication token verification ready
- Database access secured through API routes
- All sensitive operations use server-side keys
- App Transport Security (HTTPS required)
- iOS 14+ Privacy Labels required
- App Store Review Guidelines compliance
- Human Interface Guidelines
- Target SDK 34+ required (2024)
- Play Store Data Safety requirements
- Material Design Guidelines
- Google Play Policies compliance
Your app is ready to publish on both iOS and Android now, and ready to scale later! π