Skip to content
Back to projects
2025 — 2026 · Final Year Project

FarmKonnect

Full-stack agricultural marketplace with real-time chat, commodity price intelligence, and ML-based price forecasting — deployed on AWS EC2.

ReactNode.jsExpressMongoDBSocket.ioPythonLightGBMDockerNginxAWS EC2

The problem

Smallholder farmers in Pakistan trade commodities through informal intermediaries who set opaque prices and absorb most of the margin. Buyers, in turn, struggle to source reliably without travelling between mandis. The team set out to build a direct farmer-to-buyer marketplace with negotiation, payments, and transparent reference pricing — accessible to users with limited connectivity and modest hardware.

The solution

FarmKonnect is a MERN-stack web and mobile platform with three core surfaces: a marketplace for listing and discovering produce, a real-time chat for price negotiation, and a price-intelligence layer that shows historical and forecasted commodity prices so both sides negotiate from the same factual baseline.

The whole system runs on a single AWS EC2 instance via Docker Compose, behind an Nginx reverse proxy with Let's Encrypt SSL. Frontend, backend, scraper, and prediction service are independent containers that can be rolled forward individually.

Architecture at a glance

Client (React Web / Mobile)
        │  HTTPS · WSS
        ▼
   Nginx reverse proxy  ──── Let's Encrypt SSL
        │
        ├── Node/Express API ── MongoDB (Mongoose + DAL Repository Pattern)
        │        │
        │        └── Socket.io ── JWT-authed chat channels
        │
        ├── Python scraper ── daily prices for 50+ cities → MongoDB
        │
        └── Python prediction service ── LightGBM router
                 │
                 └── Rolling-MAPE drift monitor → alarms collection

My contributions

I led the 4-person team and contributed 140+ commits across 5 merged PRs covering the fintech marketplace, infrastructure & services, community / admin surfaces, the marketplace UI & transaction flows, and the mobile app integration. I also owned the ML prediction service end-to-end and wrote the 2,000+ line system documentation that on-boards new contributors.

Technical highlights

Real-time messaging

Socket.io-based chat with JWT auth, supporting price negotiation workflows between farmers and buyers. Designed message persistence and read-receipts on top of MongoDB change streams.

Containerised AWS deployment

Deployed on AWS EC2 via Docker Compose + Nginx reverse proxy + Let's Encrypt SSL with auto-renewal. Zero-downtime updates by rolling individual services behind the proxy.

ML price prediction service

Python service ingests daily commodity prices from 50+ cities, trains LightGBM models with a router across (commodity × horizon) cells, and serves weekly forecasts. Rolling-MAPE drift monitoring writes alarms to a separate Mongo collection for retraining triggers.

Lessons learned

  • Drift monitoring matters more than initial accuracy. We shipped LightGBM with respectable MAPE, but the monitoring pipeline is what kept it useful across seasons and policy regimes.
  • DAL repository pattern paid off. Centralising MongoDB access made auth checks, aggregation pipelines, and indexes consistent across endpoints — and made it trivial to swap test fixtures in.
  • Single-host Docker Compose was the right boring choice for an FYP-scale project. Kubernetes would have eaten weeks we didn't have.