Grapevine_Disease_Detection/AGENTS.md
Yanis 001658898e refactor navigation: classic bottom tab bar with FAB + header icons
- Replace floating pill tab bar with classic anchored bottom bar (Home | FAB Scan | Map)
- Add central FAB button (green, elevated) for Scanner
- Move History → Notifications and Profile → Settings (accessible via header icons)
- Add SearchHeader with bell (notifications) and settings icons
- Add MapScreen placeholder
- Extract SearchHeader component from HomeScreen
- Switch to lucide-react-native icons for bottom tab bar
- Fix react-dom version mismatch (19.2.4 → 19.1.0)
- Clean up unused imports in homeheader.tsx
- Update navigation types, deep links, and i18n keys

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 20:14:27 +02:00

2.8 KiB

Repository Guidelines

Monorepo with two components: a Python/TensorFlow CNN for grapevine disease detection and a React Native (Expo) mobile app (VinEye) that runs the model on-device via TFLite.

Project Structure & Module Organization

venv/src/          # Python ML pipeline (training, evaluation, attribution)
venv/models/       # Trained model artifacts (.keras, .tflite)
docs/images/       # Dataset & results visualizations
VinEye/            # Expo React Native mobile app
  src/screens/     # 6 screens: Splash, Home, Scanner, Result, History, Profile
  src/components/  # UI grouped by feature (gamification/, scanner/, history/, ui/)
  src/services/    # TFLite inference, AsyncStorage, haptics
  src/hooks/       # useDetection, useGameProgress, useHistory
  src/navigation/  # React Navigation v7 (BottomTabs + NativeStack)
  src/i18n/        # FR + EN translations (i18next)
  src/theme/       # Design tokens (primary #2D6A4F, accent #7C3AED)

The ML model currently uses a mock TFLite detector in the mobile app (weighted random: 70% vine / 20% uncertain / 10% not_vine). The CNN trains on 9027 images (256x256) across 4 classes: Black Rot, ESCA, Healthy, Leaf Blight.

Build, Test, and Development Commands

VinEye (Mobile)

cd VinEye
pnpm install            # Install dependencies (pnpm only, never npm/yarn)
pnpm start              # Start Expo dev server
pnpm android            # Run on Android
pnpm ios                # Run on iOS
pnpm web                # Run on web

Python ML Pipeline

cd venv/src
python data_split.py       # Split raw data into train/val/test (80/10/10)
python data_explore.py     # EDA: class distribution, sample visualization
python model_train.py      # Train CNN, exports .keras + .tflite to venv/models/
python evaluate_model.py   # Accuracy/loss curves, confusion matrix, top-k predictions
python gradient.py         # Integrated gradients attribution masks

Scripts must be run from venv/src/ — paths are derived relative to that directory.

Coding Style & Naming Conventions

TypeScript (VinEye):

  • Strict mode enabled, path alias @/* maps to src/*
  • Max 300 lines per file
  • NativeWind (TailwindCSS) for styling — no inline styles
  • useEffect must be imported from react, never from react-native-reanimated
  • React Navigation v7 only (Expo Router is forbidden)
  • RN-native UI components only (no web-based component libraries)

Python: TensorFlow/Keras Sequential API, scripts use from module import * pattern.

No linter or formatter configs are enforced.

Commit Guidelines

Commit messages are informal, descriptive, lowercase. No conventional commits format is enforced. Examples from history: add VinEye frontend app + fix hardcoded paths + gitignore, update, maj.