How aresu-1704/tomato-disease-detect works
Project type and purpose
• This is a full-stack mobile application for tomato leaf disease detection.
• Frontend: Flutter app (Android & iOS) that captures or selects leaf images, handles authentication, and displays prediction results & history.
• Backend: FastAPI service hosting YOLO deep-learning models (YOLOv8–YOLOv12 Nano) for object detection and a CNN for disease classification. It also manages user accounts, OTP, and prediction history persisted in PostgreSQL.
File structure
• Top-level folders:
• frontend – Flutter project with Android, iOS, Dart code (models, services, view_models, views)
• backend – FastAPI app structured by controllers, services, repositories, models, utils, ai_models
• database – SQL schema file
• Backend breakdown:
• app/controllers – HTTP endpoints (auth, predict, disease_history)
• app/services & IR interfaces – business logic
• app/repositories & IR interfaces – data access to PostgreSQL
• app/ai_models – YOLO model weights and inference code
• app/utils – connections (PostgreSQL, Redis for OTP), hashing, email OTP senders
• executor_pool – parallel model inference
• config.py / main.py – app configuration & server startup
• Frontend breakdown:
• lib/constants – API base URL
• lib/models, repositories, services – data layer & HTTP calls
• lib/view_models – state management for each screen
• lib/views – UI screens for auth, camera, results, history
• Config & deployment files:
• backend/requirements.txt, Docker-style scripts can be inferred
• frontend/pubspec.yaml, Android/iOS native build files
README
• Confirms two main components: Flutter mobile UI and FastAPI+YOLO backend
• Lists API endpoints for authentication, prediction, history
• Mentions PostgreSQL, Redis (implied by OTP storage), Uvicorn, Pydantic
• Shows swagger UI for API