Skip to content

AjayZordan/LFSS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌾 Local Farmer Support System

Multilingual Agricultural Advisory Platform

A full-stack web application that delivers hyper-local, real-time crop recommendations to rural farmers using GPS-based geolocation and live weather data — built to be accessible across multiple languages with instant, zero-page-reload switching.

Angular Node.js Express MySQL OpenWeather REST API


📌 Problem

Rural farmers often lack easy access to localized, real-time agricultural guidance due to language barriers, low digital literacy, and limited access to weather/crop data tailored to their exact location.

💡 Solution

This platform bridges that gap by combining GPS geolocation, live weather data, and multilingual support to deliver crop recommendations that are immediately relevant to a farmer's specific location, climate conditions, and language — no manual data entry required.

✨ Key Features

  • 📍 GPS-Based Geolocation — Automatically detects the farmer's location in-browser to personalize advisory content
  • 🌦️ Live Weather Integration — Pulls real-time weather data from the OpenWeather API to factor temperature, humidity, and forecast into crop suggestions
  • 🌐 Multilingual UI — Full interface translation with instant language switching, no page reload
  • 🔢 Localized Number Formatting — Adapts numeric display for regional readability
  • 🗄️ Normalized MySQL Schema — Structured relational database for crop, weather, and user advisory data
  • 🔌 RESTful API Backend — Clean Express.js REST API separating business logic from the Angular frontend

🏗️ Architecture

Angular Frontend ──▶ Express.js REST API ──▶ MySQL Database

│ │

└──────────────▶ OpenWeather API

🔌 REST API Endpoints

Built with Express.js, the backend exposes RESTful routes for crop and weather-based advisory data:

Method Endpoint Description
GET /api/crops Fetch list of available crop recommendations
GET /api/crops/:id Get details for a specific crop
POST /api/crops Add a new crop recommendation entry
GET /api/weather?lat=&lon= Fetch live weather data via OpenWeather API for given coordinates

Routes are defined in farmer-backend/routes/cropRoutes.js and handled in farmer-backend/controllers/cropController.js. Database connection is managed in farmer-backend/models/db.js.

🛠️ Tech Stack

Category Tools
Frontend Angular
Backend Node.js, Express.js
Database MySQL
External API OpenWeather API
Architecture RESTful API

🚀 Getting Started

Prerequisites

Installation

git clone https://github.com/AjayZordan/LFSS.git
cd LFSS

# Backend setup
cd farmer-backend
npm install
# Configure your MySQL credentials in models/db.js
node server.js

# Frontend setup (in a new terminal)
cd ../farmer-frontend
npm install
ng serve

⚠️ You'll need to add your own OpenWeather API key in:

  • farmer-frontend/src/environments/environment.ts
  • farmer-frontend/src/environments/environment.prod.ts

Replace 'YOUR_OPENWEATHER_API_KEY' with your actual key before running.

Database Setup

Import the schema using:

mysql -u root -p < farmer-backend/data/sample.sql

📂 Project Structure

LFSS/

├── farmer-backend/

│ ├── controllers/ # Request handlers (cropController.js)

│ ├── models/ # DB connection (db.js)

│ ├── routes/ # API route definitions (cropRoutes.js)

│ ├── data/ # Sample SQL schema

│ └── server.js # Express app entry point

└── farmer-frontend/

├── src/app/ # Angular components

└── src/environments/ # Environment configs (API keys)

👤 Author

R. Ajay Kumar LinkedIn · ajaykumar040702@gmail.com

About

Multilingual agricultural advisory platform delivering hyper-local, real-time crop recommendations using GPS geolocation and live weather data

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors