How nikhil-kadaparthi/lumpy-skin-disease-prediction-in-cattle works
Project Type and Purpose
• FarmFriend is a full-stack application that offers cattle health assessments through AI-powered image analysis (using YOLOv8 and PyTorch) and weather data analysis (using a RandomForest model and OpenWeatherMap & GoMaps APIs).
• It integrates user authentication and profile management via Firebase, alongside a FastAPI backend for machine learning inference and API endpoint management, and a React + TypeScript frontend built with Vite.
Main Components
a. Front-End:
• React Application (located in the src folder) that includes pages (Dashboard, Login, Register, etc.) and components (Navbar, Footer, Animated components).
• Vite build tooling and Tailwind CSS for responsive styling, along with libraries such as Framer Motion for animations.
• AuthContext for managing user authentication state (with Firebase).
• API services to communicate with the backend (see src/api.ts).
b. Back-End:
• A FastAPI application (api.py) serving as the REST API server.
• The backend is built with Python using Uvicorn as the ASGI server.
• Integration of machine learning models: YOLOv8 model for image processing (stored as best.pt) and a RandomForest model for weather-based risk analysis (stored in random_forest_model_weather_data.pkl).
• Endpoints to process image uploads, fetch and integrate weather data, and update assessments with RT-PCR results.
c. Machine Learning & Data Processing:
• The image processing component (YOLOv8) and weather risk analysis, tied into the backend, represent key specialized services.
• How the models are loaded and used to process input data.
d. External Services & Data Storage:
• Firebase for handling user authentication and real-time database functions.
• Integration with external APIs: OpenWeatherMap for weather data and GoMaps API for geocoding.
Relationships and Interactions
• Back-End ⇄ Machine Learning Models: The backend loads and utilizes the ML models for cattle image analysis and weather-based forecasting.
• Back-End ⇄ Firebase: Authentication and data persistence are managed via Firebase connections.
• Back-End ⇄ External APIs: The backend makes API calls to OpenWeatherMap and GoMaps to retrieve live weather data and geolocation details.
Architectural Patterns & Design Principles
• Clear separation of concerns:
• Frontend: Focused on user experience, authentication, and presentation.
• Backend: REST API design that integrates machine learning and external service communication.
• Modularization: The project structure (with separate directories for components, pages, and context in the frontend) reflects a modular design pattern.
• Integration layers: Highlight the API client layer in the frontend (src/api.ts) and the service layer in the FastAPI backend that connects to ML models and external APIs.
Detail and Simplicity
• Do not hesitate to break down the system into as many components or layers as necessary to show all critical interactions.
• Additional details where possible (such as environment configurations, deployment options, or development vs. production flows if relevant).