Logo Lanfrica

Jackson-tj74/smart-farmer-weather-api

Domain:

agriculture

Record type:

software
Creator:
Jac
Host:
A Node.js API service that fetches weather data for Rwandan districts and generates actionable agricultural advice based on conditions like rainfall and humidity. 🌦️ SMART FARMER WEATHER API This service provides weather data and farming advice specifically optimized for the Rwandan agricultural context. FEATURES Current Weather: Temperature, humidity, wind speed, and description. Forecast: 3 to 5-day weather prediction. Agri-Logic: Smart recommendations on spraying, planting, and harvesting based on weather conditions. Location Support: Supports all major Rwandan districts. INSTALLATION 1) Clone the repo git clone github.com smart-farmer-weather-api 2) Install Dependencies npm install 3) ENVIRNOMENT VARIABLES PORT=5000 WEATHER_API_KEY=your_openweathermap_api_key_here WEATHER_BASE_URL=api.openweathermap.org 4) Run Server npm run dev STRUCTURE smart-farmer-weather-api/ β”œβ”€β”€ src/ β”‚ β”œβ”€β”€ config/ β”‚ β”‚ β”œβ”€β”€ database.ts # (Optional, if you save user profiles) β”‚ β”‚ └── weather.config.ts # Stores the API Key base URL β”‚ β”œβ”€β”€ controllers/ β”‚ β”‚ └── weather.controller.ts # Handles fetch requests β”‚ β”œβ”€β”€ services/ β”‚ β”‚ β”œβ”€β”€ weather.service.ts # Calls External API (OpenWeatherMap) β”‚ β”‚ └── location.service.ts # Maps Districts to Lat/Lon β”‚ β”œβ”€β”€ utils/ β”‚ β”‚ └── advice.utils.ts # Logic: "If rain, do X" β”‚ β”œβ”€β”€ types/ β”‚ β”‚ └── weather.types.ts # Interfaces for Weather Data β”‚ └── index.ts β”œβ”€β”€ .env.example β”œβ”€β”€ package.json └── tsconfig.json

Languages