A modern React Native mobile application that uses AI-powered image recognition to help farmers identify common potato plant diseases. Built with Expo and featuring a sleek, user-friendly interface with advanced gesture controls and bookmarking capabilities.
- AI Disease Detection: Upload or capture images of potato plants for instant disease identification
- Comprehensive Disease Library: Browse detailed information about common potato diseases
- Bookmarking System: Save important diseases for quick reference
- Search & Filter: Find specific diseases quickly with real-time search
- Daily Tips: Get randomized farming tips to improve plant health
- Swipe Gestures: Intuitive swipe-to-reveal actions for bookmarking and details
- Modern UI: Clean, cozy design with smooth animations and transitions
- Dark/Light Mode: Automatic theme adaptation based on system preferences
- Offline Storage: Bookmarks persist locally using AsyncStorage
- Recent Images: Quick access to previously analyzed images
- Cross-Platform: Works on both iOS and Android
- Gesture Handler: Advanced touch interactions with react-native-gesture-handler
- Animated UI: Smooth animations using react-native-reanimated
- Custom Fonts: Beautiful Poppins font family for enhanced readability
- Safe Area Support: Proper handling of device notches and status bars
- Node.js (v16 or higher)
- npm or yarn
- Expo CLI
- iOS Simulator (for iOS development) or Android Studio (for Android development)
-
Clone the repository
git clone https://github.com/TroyMoses/potato-disease-detection.git cd potato-disease-detection
-
Install dependencies
npm install # or yarn install
-
Start the development server
npx expo start
-
Run on device/simulator
- Press
i
for iOS simulator - Press
a
for Android emulator - Scan QR code with Expo Go app on your physical device
- Press
Create a .env
file in the root directory and add your API configuration:
API_URL=http://your-api-endpoint:8000/predict
app/
βββ (tabs)/ # Tab-based navigation screens
β βββ index.tsx # Home screen
β βββ explore.tsx # Disease library with search
β βββ predict.tsx # AI prediction screen
β βββ bookmarks.tsx # Saved diseases
β βββ about.tsx # App information
β βββ _layout.tsx # Tab navigation layout
βββ _layout.tsx # Root layout with providers
βββ +not-found.tsx # 404 error screen
βββ assets/ # Static assets
βββ fonts/ # Custom font files
βββ images/ # Disease images and backgrounds
components/
βββ ui/ # Reusable UI components
β βββ IconSymbol.tsx # Cross-platform icons
β βββ TabBarBackground.tsx # Tab bar styling
βββ TipOfTheDay.tsx # Daily tips component
βββ HapticTab.tsx # Haptic feedback for tabs
βββ ... # Other utility components
constants/
βββ Colors.ts # App color scheme
βββ diseaseData.ts # Disease information database
context/
βββ BookmarkContext.tsx # Bookmark state management
hooks/
βββ useColorScheme.ts # Theme detection
βββ useThemeColor.ts # Color utilities
- Primary Font: Poppins (Regular, Medium, SemiBold, Bold)
- Monospace Font: Space Mono (for code/technical content)
- Primary Blue: #007AFF
- Success Green: #4CAF50
- Warning Orange: #FF9800
- Error Red: #FF3B30
- Background: Dynamic based on theme
- Cards: Rounded corners (16px), subtle shadows
- Buttons: Consistent padding, haptic feedback
- Icons: SF Symbols (iOS) / Material Icons (Android)
The app expects a REST API endpoint that accepts image uploads:
POST /predict
Content-Type: multipart/form-data
Body: {
file: ImageFile
}
Response: {
class: string, // Disease name
confidence: number // Confidence score (0-1 or 0-100)
}
For development, the app includes mock responses:
const mockResponses = {
"early-blight": { class: "Early Blight", confidence: "0.925" },
"late-blight": { class: "Late Blight", confidence: "0.897" },
// ... more diseases
}
The app includes information for 7 common potato diseases:
- Early Blight - Dark target-like spots on older leaves
- Late Blight - Rapidly spreading brown lesions
- Potato Leaf Roll - Upward rolling of leaves with yellowing
- Septoria Leaf Spot - Small dark spots with yellow halos
- Psyllid Yellows - Yellowing and curling of upper leaves
- Black Dot - Small black dots on stems and tubers
- Blackleg - Black stem base and wilting
Each disease entry includes:
- High-quality reference images
- Short description for quick identification
- Detailed symptoms, impact, and management information
- Swipe Left on Disease Cards: Reveal bookmark and details actions
- Swipe Left/Right on Images: Clear current prediction
- Pull to Refresh: Refresh disease library (planned feature)
- Pinch to Zoom: Zoom into disease images (planned feature)
- Home Screen: Overview and quick access to main features
- Explore Screen: Browse and search disease library
- Predict Screen: Capture/upload images for analysis
- Bookmarks Screen: View saved diseases
- About Screen: App information and contact details
- Bookmarks: Persisted disease IDs
- Recent Images: Image URIs for quick access
- User Preferences: Theme settings, tip preferences
- All disease information is bundled with the app
- No user accounts or cloud storage needed
- Fully functional offline (except for AI predictions)
# Run unit tests
npm test
# Run with coverage
npm run test:coverage
# Run E2E tests (if configured)
npm run test:e2e
- Component rendering
- Gesture interactions
- API integration
- Local storage operations
- Navigation flows
- SF Symbols for native icon appearance
- Haptic feedback on interactions
- Blur effects for tab bar
- Native navigation animations
- Material Design icons
- Edge-to-edge display support
- Android-specific animations
- Adaptive icon support
# Build for iOS
npx expo build:ios
# Build for Android
npx expo build:android
# Or use EAS Build (recommended)
npx eas build --platform all
-
iOS App Store
- Configure app.json with proper bundle identifier
- Add required privacy descriptions
- Submit through App Store Connect
-
Google Play Store
- Generate signed APK/AAB
- Configure store listing
- Submit through Google Play Console
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- Use TypeScript for type safety
- Follow React Native best practices
- Use Prettier for code formatting
- Add JSDoc comments for complex functions
- Add disease images to
assets/images/
- Update
constants/diseaseData.ts
with new disease information - Test the new disease in the explore and prediction screens
-
Gesture Handler Errors
- Ensure GestureHandlerRootView wraps the entire app
- Check react-native-gesture-handler installation
-
Font Loading Issues
- Verify font files are in the correct directory
- Check font names match exactly in the code
-
Image Picker Permissions
- Add camera and photo library permissions to app.json
- Handle permission requests properly
-
API Connection Issues
- Verify API_URL in environment configuration
- Check network connectivity
- Ensure API endpoint is accessible from device
- Use
React.memo
for expensive components - Implement lazy loading for large image lists
- Optimize image sizes and formats
- Use FlatList for large datasets
This project is licensed under the MIT License - see the LICENSE file for details.
- Developer: TroyLegacy
- Email: troylegacy256@gmail.com
- Website: https://troylegacy.vercel.app
- Disease information sourced from agricultural research institutions
- Icons provided by SF Symbols and Material Design
- Background images from agricultural photography collections
- AI model training data from plant pathology databases
- Offline AI model for predictions
- Multi-language support
- Weather integration for disease risk assessment
- Community forum for farmers
- Treatment recommendation system
- Crop rotation planning tools
- Push notifications for disease alerts
- v1.0.0 - Initial release with core features
- v1.1.0 - Added gesture controls and bookmarking
- v1.2.0 - Enhanced UI with custom fonts and animations
For more information, visit our documentation site or contact our support team.