OpenHarvest
OpenHarvest is a web application designed to balance farming production in India. Farmers in India are struggling with marketing their crops. The greatest instance of this was with India's recent onion shortage. Essentially, farmers are being told that the market needs specific goods which results in a massive surplus as all the farmers dedicated their crops to the market's needs. This results in many farmers’ watching entire crops go to waste. These crops can take over a year to grow and leave the farmer in debt rather than making a profit. One of our group members has great insight into this issue as he has family in the farming industry.
OpenHarvest was a top solution created for the 2021 Call for Code IBMer Challenge. It took on a key agricultural challenge prompt in the Call for Code competition.
Contents
Demo video
Demo URL
This is built against master on request.
Available at: https://openharvest.net
Architecture
Technology stack
flowchart LR
subgraph react["React Client"]
direction LR
cc(Carbon Components)
wcc(Watson for IoT Carbon Components)
end
subgraph node["Node.js REST API"]
exp(Express HTTP Framework)
end
react<-->node
node<-->MongoDB
node<-->Twilio
User<-->react
Integrations<-->node
Infrastructure / deployment stack
flowchart LR
subgraph ibm_cloud["IBM Cloud"]
direction TB
ibm_ib(Image Builder)<-->ibm_cr
ibm_ce(Code Engine Running API Image)<-->mongodb(MongoDB Managed Service)
ibm_cr(Private Container Registry)--Deploys API Image-->ibm_ce
end
subgraph dns["Cloudflare DNS"]
domain(OpenHarvest.net)
end
dns-->ibm_cloud
User<-->dns
Long description
More details are available here
Getting started
Prerequisites
- Node and NPM (Included with node)
- Git
- MongoDB Instructions on deploying and configuring this are included below
Building app
Backend
-
Install mkcert. For Mac or Linux:
brew install mkcert
. Windows user can downloadmkcert.exe
from Mkcert GithubInstall ts-node for Windows users in backend folder
npm i -g ts-node
-
Create Certificates
mkcert -install mkcert localhost 127.0.0.1
-
Create Mongodb dData directory, anywhere you want but preferably in the same directory as Docker Compose. This is optional for Windows users.
mkdir {YOUR_PATH}
-
Create docker-compose.yml.
For Mac and Linux:
version: '3.7' services: mongodb_container: image: mongo:latest environment: MONGO_INITDB_ROOT_USERNAME: {YOUR_ROOT_USER} MONGO_INITDB_ROOT_PASSWORD: {YOUR_ROOT_PASSWORD} restart: unless-stopped ports: - 27017:27017 volumes: - {YOUR_MONGO_DB_DATA_DIR}:/data/db
For Windows:
version: '3.7' services: mongodb_container: image: mongo:latest environment: MONGO_INITDB_ROOT_USERNAME: {YOUR_ROOT_USER} MONGO_INITDB_ROOT_PASSWORD: {YOUR_ROOT_PASSWORD} restart: unless-stopped ports: - 27017:27017 volumes: - data:/mongodb/data/db volumes: data: driver: local
-
cd
into/backend
and rename.env.example
to.env
and replace the placeholder values. -
npm i npm start
Frontend
cd react-app
npm install
npm start
Built with
- Carbon Design System - web framework used
- IBM Cloudant - The NoSQL database used
- IBM Cloud
Authors
- Team Lead: Tyler Philips
- Ravi Nain
- Ryan Pereira
- Vikas Jagtap
License
This project is licensed under the Apache 2 License - see the LICENSE file for details.
Acknowledgments
- Based on Call For Code README template.