Farm IoT and AI dashboard
# Kenya Farm IoT
Full-stack IoT dashboard for smart farming in Kenya: **Node.js/Express** backend, **React/Vite** frontend, **PostgreSQL**, JWT auth, and SMS (Africa's Talking).
## Project structure
```
kenya-farm-iot/
├── backend/ # Express API (Node 18, TypeScript)
│ ├── package.json
│ ├── package-lock.json
│ ├── Dockerfile
│ ├── src/
│ │ ├── app.ts
│ │ ├── index.ts
│ │ ├── db/ # PostgreSQL, migrations
│ │ ├── middleware/
│ │ └── routes/ # auth, farmers
│ └── .env # (create from .env.example; not committed)
├── frontend/ # React + Vite + Tailwind
│ ├── package.json
│ ├── package-lock.json
│ ├── Dockerfile
│ ├── nginx.conf
│ └── src/
├── docs/ # Installation & User manuals (PDF)
├── .gitignore
├── render.yaml # Optional: Render.com deployment
└── README.md
```
## Required files checklist
| Item | Location |
|------|----------|
| package.json | `backend/`, `frontend/` |
| package-lock.json | `backend/`, `frontend/` (and root if present) |
| .gitignore | Root (excludes `node_modules/`, `.env`) |
| Dockerfile | `backend/`, `frontend/` |
| render.yaml | Root (optional) |
| README.md | Root (this file) |
## Prerequisites
- **Node.js 18.x** (see `backend/package.json` engines)
- **PostgreSQL** (local or Docker)
- **npm** (or yarn)
## Setup
### 1. Clone and install
```bash
git clone
github.com
cd kenya-farm-iot
```
### 2. Backend
```bash
cd backend
cp .env.example .env # or create .env with required vars
# Edit .env: set DATABASE_URL, JWT_SECRET at minimum
npm install
npm run db:migrate
npm run dev #
localhost
```
### 3. Frontend
```bash
cd frontend
npm install
# Optional: create .env with VITE_API_URL=
localhost
npm run dev #
localhost
```
### 4. Environment variables
**Backend (`.env` in `backend/`):**
- `PORT` – default 3000
- `DATABASE_URL` – e.g. `p …