Backend EngineerSoil Suitability Platform
The platform read the soil — nitrogen, phosphorus, potassium, pH, moisture — and told farmers what would grow in it. The trouble was that it had been built as one piece. When the AI model went down, everything went down with it.
Gaurav cut it apart. Three stateless services now stand where one stood before, and a model outage dims a single feature instead of the whole app.
Ship's log
- Split the FastAPI backend into 3 isolated microservices — sensor ingestion, crop lookup and Gemini-powered analysis — behind a dedicated health-check endpoint.
- Closed the AI route to prompt injection by allow-listing and type-casting the 5 expected sensor fields and discarding everything else before it reached the prompt.
- Rebuilt the React/Next.js dashboard on a 500 ms refresh cycle with live NPK, pH, moisture and climate readings and per-crop suitability verdicts.
- Wrote a tolerance-buffered rules engine (10% band on NPK, 0.3 on pH) that maps deficiencies to a deduplicated organic-amendment lookup.
- Python
- FastAPI
- Next.js
- React
- PostgreSQL
- Gemini API