How amaannaseh/kisan-kranti works
Main Components
• AI Crop Disease Prediction Service (located in the “flask-crop-diseases” folder):
– A Python/Flask application that serves crop disease detection functionality.
– Contains several pre-trained AI models (H5 files) and accompanying static assets (JavaScript, CSS, HTML templates) to support visualization and user interaction.
• Market/E-Commerce Module (located in “kisan-e-dukaan”):
– Comprises two parts: the backend (an Express/Node.js service managing controllers, routes, and models for authentication, products, cart, coupons, orders, etc.) and the frontend (a separate React/Vite-based client).
– This module supports digital marketing and commercialization for farmers.
• Main Application / Web Frontend (located in “kisan-kranti”):
– Acts as the central hub integrating various functionalities and pages (crop prices, FAQs, crop reports, organic farming, chatbot, etc.)
– The folder includes components for navigating different aspects of the service (for example, AI-driven pages, brochure pages, complaint handling, and more).
Relationships & Interactions
• The AI Crop Disease Prediction Service will function as a microservice exposing endpoints (via Flask) to accept images, process them using the stored H5 models, and return predictions.
– Data flow: Client (or even the main frontend) sends an image → Flask server processes the request → Returns AI results.
• The Market Module entails interaction between its RESTful Node.js backend and its dedicated frontend.
– The backend handles API requests from the frontend for products, authentication, cart management, analytics, etc.
– It may also have interaction (possibly via cross-module API calls or shared services) with the main application.
• The Main Frontend (Kisan-Kranti) acts as an aggregator interface where users can access the market page, the AI-based disease prediction service (either by direct integration or through a link/API call), weather insights, crop reports, and additional farmer support features.
Architectural Patterns and Design Principles
• Separation of Concerns: The system is clearly segmented into specialized modules:
– AI service (Flask microservice),
– E-commerce service (Node.js backend with a separate React frontend), and
– The overall web/mobile interface (Kisan-Kranti).
• Microservices/Modular Architecture: Each subsystem (e.g., Flask-based AI service, Node.js backend) can be deployed and scaled independently.
• Client-Server Interaction: Clear API boundaries exist between the frontends and their corresponding backends.
• Reusability and Extensibility: The static assets, controllers, and models are organized for modularity, ensuring that new features (like future blockchain support or hardware integration) can be added with minimal rework.
Final Reminders for the Principal Software Engineer
– The main frontend (Kisan-Kranti) and the two services (Flask AI and the e-commerce backend).
– The interaction within the e-commerce system (frontend-to-backend) and within the AI microservice components.
• Component is as granular as needed – break down internal structures (controllers, models, static assets) where clarity is essential.
• Capturing the integration points (API calls, data flow) to not overcomplicate the overall architecture but to ensure all essential paths are visible.