Unified implementation of the Nigeria Farmer Platform PRD v3.3 for NYFN.
- Next.js role-aware PWA frontend
- NestJS modular API
- Shared domain contracts and fixtures
- Local integration stubs for SMS, WhatsApp, payments, LMS, community, weather and search
- GitHub, environment, security, and production-readiness documentation
npm ci
npm run validate
# Run API and web together:
npm run dev
# Or run them separately:
npm run dev -w @agric-platform/api
npm run dev -w @agric-platform/webDefault URLs:
- Web: http://localhost:3000
- API: http://localhost:3001
- API OpenAPI UI: http://localhost:3001/api/v1/docs
The Next.js PWA talks to the NestJS API directly from the browser — no dev
proxy is needed because CORS is configured API-side (CORS_ORIGIN, default
http://localhost:3000).
- Point the web client at an API with
NEXT_PUBLIC_API_BASE_URL(defaulthttp://localhost:3001/api/v1, see.env.example). - Authentication: production clients send
Authorization: Bearer <OIDC JWT>. In development (NODE_ENV !== 'production'on the API) the app sends thex-user-idheader of the seeded user selected in the header's dev role preview (e.g.user-adamu,user-admin). - Offline-first: when the API is unreachable, screens render cached data or clearly-marked fixture fallbacks, and mutations are stored in the on-device sync queue (dashboard → "Sync queue") and replayed with idempotency keys on reconnect.
SPEC.md— implementation contractdocs/prd-analysis.md— PRD interpretationdocs/architecture.md— architecture and data modeldocs/github-strategy.md— repository and operating modeldocs/requirements-traceability.md— PRD-to-implementation traceabilitydocs/security-compliance.md— security controls and launch blockersdocs/integration-matrix.md— provider adapter and credential matrixdocs/production-readiness.md— final readiness assessment
- Root
Dockerfile— all-in-one preview/validation image for the API and web app. infra/docker/api.Dockerfileandinfra/docker/web.Dockerfile— separated production-oriented service images.infra/docker-compose.yml— local dependency and service topology.
The codebase boots with stub providers. Copy .env.example to .env and set production credentials only in your local or cloud secret store. Never commit real secrets.