The Node/Express API for schemes, support requests, and crop intelligence. Version 2 is designed for serverless reuse: database connections are cached, payload sizes are bounded, writes are protected, and the exported 96-tree model runs in-process without a fragile external ML runtime.
cp .env.example .env
npm install
npm run devThe API is available at http://localhost:4000; readiness is reported by
GET /api/health.
POST /api/crops/recommend— validated, in-process model inferenceGET /api/schemes— searchable, paginated schemesGET /api/schemes/:id— one schemePOST /api/schemes— administrator-only scheme creationPOST /api/message/send— validated support request
See .env.example for deployment configuration. Never commit the real MongoDB
URI or administrator key.