A modern, beautiful mobile application for bird identification using AI-powered image recognition with the Gemini API. Built with React Native, Expo, Supabase, and TypeScript.
- π Authentication: Secure user authentication with Supabase
- πΈ Bird Recognition: Real-time bird identification using Google's Gemini API
- π³ Credit System: Track analysis credits with real-time updates
- π Dark Mode: Automatic theme switching with manual override
- π Multi-language: Support for English and Turkish
- π¨ Modern UI: Clean, minimalist design with smooth animations
- π± Mobile-First: Optimized for iOS and Android with platform-native behaviors
- Frontend: React Native + Expo (TypeScript)
- Backend: Supabase (Authentication & Database)
- AI: Google Gemini API (Bird Recognition)
- State Management: React Context API
- Navigation: React Navigation v6
- Styling: React Native StyleSheet with theme system
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher)
- npm or yarn
- Expo CLI (
npm install -g expo-cli) - iOS Simulator (macOS) or Android Studio (for Android development)
- Expo Go app on your mobile device (for testing)
cd orniva_appnpm installThe Supabase connection is already configured in src/config/env.ts.
Important: The Gemini API key is now configured server-side in Supabase Edge Functions for security. You do NOT need to add it to the client-side code.
For detailed Edge Function deployment and secret configuration, see:
EDGE_FUNCTION_DEPLOYMENT.md- Complete deployment guidesupabase/functions/identify-bird/- Edge Function source code
To configure the Gemini API key in Supabase:
# Set the secret in Supabase
supabase secrets set GEMINI_API_KEY=your_api_key_here
# Deploy the Edge Function
supabase functions deploy identify-birdClient-side configuration (already set up):
export const ENV = {
SUPABASE_URL: 'https://coowimujsrlgrcifebhm.supabase.co',
SUPABASE_ANON_KEY: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...',
} as const;The database is already configured and running on Supabase with the following tables:
- user_profiles: Stores user data and credits
- bird_analyses: Tracks analysis history
The database includes:
- Row Level Security (RLS) policies
- Automatic profile creation on signup
- Credit management system
npm startThis will start the Expo development server. You can then:
- Press
ito open iOS Simulator - Press
ato open Android Emulator - Scan the QR code with Expo Go app on your phone
npm run iosnpm run androidnpm run weborniva_app/
βββ src/
β βββ components/ # Reusable UI components
β β βββ Button.tsx
β β βββ Input.tsx
β βββ config/ # Configuration files
β β βββ env.ts
β β βββ supabase.ts
β βββ contexts/ # React Context providers
β β βββ AuthContext.tsx
β β βββ ThemeContext.tsx
β βββ screens/ # Application screens
β β βββ AuthScreen.tsx
β β βββ HomeScreen.tsx
β β βββ AnalysisScreen.tsx
β β βββ ResultsScreen.tsx
β β βββ SettingsScreen.tsx
β βββ services/ # API and business logic
β β βββ authService.ts
β β βββ edgeFunctionService.ts
β βββ types/ # TypeScript type definitions
β β βββ index.ts
β βββ utils/ # Utility functions
β βββ i18n.ts
βββ App.tsx # Root component
βββ app.json # Expo configuration
βββ package.json # Dependencies
- Users sign up or sign in with email/password
- Supabase handles authentication and session management
- User profiles are automatically created with 10 initial credits
- Sessions persist across app restarts
- User uploads a bird photo (camera or gallery)
- Check if user has sufficient credits
- Deduct 1 credit from user account
- Convert image to base64 data URI (using modern Expo File API)
- Send to Supabase Edge Function (secure server-side processing)
- Edge Function calls Gemini API with API key stored in Supabase Secrets
- Parse and display results
- Update user's credit balance
Security Benefits:
- β Gemini API key never exposed to client
- β Server-side rate limiting and validation
- β Cross-platform compatible (base64 data URIs work everywhere)
- New users receive 10 credits
- Each analysis costs 1 credit
- Credits are deducted before analysis
- Real-time credit updates across all screens
- Transaction is atomic (all-or-nothing)
Edit colors in src/types/index.ts:
export const lightColors = {
primary: '#4A90E2', // Main brand color
secondary: '#50C878', // Accent color
background: '#FFFFFF', // Background
// ... more colors
};Add or modify translations in src/utils/i18n.ts:
export const translations = {
en: {
// English translations
},
tr: {
// Turkish translations
},
};Solution: Make sure the Gemini API key is configured in Supabase Secrets:
supabase secrets set GEMINI_API_KEY=your_api_key_hereThen redeploy the Edge Function:
supabase functions deploy identify-birdSolution: The demo starts with 10 credits. For production, implement a credit purchase system or reset credits manually in Supabase dashboard.
Solution:
- Check your internet connection
- Verify Gemini API key is valid
- Ensure Supabase URL is accessible
Solution: Grant camera and photo library permissions when prompted. On iOS, check Settings > Orniva. On Android, check App Settings > Permissions.
id UUID (Primary Key, references auth.users)
email TEXT
username TEXT (nullable)
credits INTEGER (default: 10)
language TEXT (default: 'en')
created_at TIMESTAMP
updated_at TIMESTAMPid UUID (Primary Key)
user_id UUID (Foreign Key -> auth.users)
bird_species TEXT
confidence NUMERIC(5,2)
description TEXT
image_url TEXT
created_at TIMESTAMP- β Row Level Security (RLS) enabled on all tables
- β Secure function execution with proper search paths
- β Gemini API key stored server-side in Supabase Secrets (never exposed to client)
- β Edge Function architecture prevents API key leakage
- β Input validation on all forms
- β Secure session management with AsyncStorage
- β Base64 image transmission (no local file path vulnerabilities)
eas build --platform ioseas build --platform androidFor production, use Expo's environment variable system:
- Create
eas.json - Add environment-specific configurations
- Use
expo-constantsto access variables securely
This project is licensed under the MIT License.
- Supabase for the amazing backend-as-a-service
- Google Gemini for powerful AI capabilities
- Expo for the excellent React Native development experience
For issues or questions:
- Check the Issues page
- Contact: support@orniva.app
Built with β€οΈ using React Native, Expo, Supabase, and Gemini AI