# Agri Sync Africa
A full-stack farm management platform for Rwandan agriculture, maintained by RN StarHope Groupe Limited.
## What is included
- Next.js 16 and React 19 web application
- Express 5 REST API
- PostgreSQL schema creation and migrations at API startup
- JWT authentication, password login, email OTP, and role-based access
- Farms, crops, livestock, finance, inventory, weather, advisory, community, chat, notifications, reports, cooperatives, and administration
- Optional AgriSync Python AI service, with built-in agricultural guidance as a fallback
- English, French, and Kinyarwanda UI content
- GitHub Actions checks for the backend, frontend lint/build, and dependency audits
## Requirements
- Node.js 22 LTS (Next.js requires Node.js 20.9 or newer)
- npm
- PostgreSQL 15 or newer
- Optional: the sibling `agrisync-ai` service for local model responses
## Local setup
1. Create a PostgreSQL database:
```sql
CREATE DATABASE agrisync;
```
2. Install dependencies:
```bash
npm install
npm install --prefix backend
npm install --prefix frontend
```
3. Copy the environment templates:
```bash
cp backend/.env.example backend/.env
cp frontend/.env.example frontend/.env.local
```
On Windows PowerShell, use `Copy-Item` instead of `cp` if needed.
4. Update `backend/.env` with your PostgreSQL password and a JWT secret.
5. Start both applications:
```bash
npm start
```
The frontend runs at
localhost and the API at
localhost. The API health endpoint is
localhost.
## Environment variables
Backend variables are documented in `backend/.env.example`.
Important production settings:
- `NODE_ENV=production`
- `JWT_SECRET`: required and at least 32 characters
- `FRONTEND_URL`: deployed frontend origin; use comma-separated origins when needed
- `DATABASE_URL`: recommended for managed PostgreSQL
- `DB_SSL=true`: enable when required by the database provider
- `SEED_DEMO_DATA=false`: prevents creation of public demo ac …