Logo Lanfrica

magrethernestmushi-code/kilimo-hub

Domain:

agriculturesocioeconomic

Record type:

software
Creator:
mag
Host:
Digital Kilimo Hub β€” Tanzania agricultural digital ecosystem (Node 20 + Express + PostgreSQL) # 🌾 Digital Kilimo Hub Tanzania agricultural digital ecosystem β€” Node.js 20 + Express + PostgreSQL API, serving a farmer-facing web app from the same service. ## What's here ``` kilimo-hub-node/ β”œβ”€β”€ src/ β”‚ β”œβ”€β”€ server.js ← entry point (npm start) β”‚ β”œβ”€β”€ db/ β”‚ β”‚ β”œβ”€β”€ schema.sql ← full schema, auto-applied on every boot β”‚ β”‚ └── pool.js ← Postgres connection pool β”‚ β”œβ”€β”€ middleware/auth.js ← JWT verification + role guards β”‚ β”œβ”€β”€ utils/ ← phone/password validation, user serialization β”‚ └── routes/ β”‚ β”œβ”€β”€ auth.js ← register / login / me / logout β”‚ β”œβ”€β”€ users.js ← profile, password change, admin user management β”‚ β”œβ”€β”€ groups.js ← Social Collective Buying β”‚ β”œβ”€β”€ logistics.js ← Dynamic Logistics Link (backhaul matching) β”‚ β”œβ”€β”€ markets.js ← Agri-Intelligence: live crop prices β”‚ β”œβ”€β”€ loans.js ← Credit Scoring Engine β”‚ β”œβ”€β”€ alerts.js ← Agri-Intelligence: pest/weather/market alerts β”‚ └── admin.js ← dashboard stats, user/transaction summaries └── public/ β”œβ”€β”€ index.html ← marketing site (CTAs link to the farmer app) β”œβ”€β”€ app.html ← farmer-facing app (wired to the API above) └── admin.html ← admin dashboard (wired to the API above) ``` Not yet in this repo: driver- and business-buyer-facing UI (the backend supports those roles and a `/products` marketplace, but no frontend was uploaded for them β€” only the farmer app and admin panel had mockups to wire up), and real mobile-money integration (see Security notes below). ## Local setup ```bash npm install cp .env.example .env # then fill in DATABASE_URL, SECRET_KEY, etc. npm start ``` Visit `localhost` to confirm it's running, and `localhost` for the farmer app. The schema is created automatically on boot β€” there's no separate migration step. ## Deploying on Render 1. Push this repo to GitHub. 2. On Rende …