All Projects → FoodPrintLabs → foodprint

FoodPrintLabs / foodprint

Licence: MIT license
Algorand dApp for blockchain-enabled food transparency and traceability in local food supply chains. For use by smallholder farmers, food co-operatives and consumers.

Programming Languages

HTML
75241 projects
javascript
184084 projects - #8 most used programming language
EJS
674 projects
CSS
56736 projects
SCSS
7915 projects

Projects that are alternatives of or similar to foodprint

Trace
Supply chain transparency platform proof-of-concept based on the Ethereum blockchain ✍️
Stars: ✭ 52 (+20.93%)
Mutual labels:  dapp, transparency, web3
nft-swap-sdk
Ethereum's missing p2p NFT and token swap library for web3 developers. Written in TypeScript. Powered by 0x.
Stars: ✭ 200 (+365.12%)
Mutual labels:  dapp, web3
NFT-Dapp-Boilerplate
A highly scalable NFT and DEFI boilerplate with pre added web3 and different wallets with a focus on performance and best practices
Stars: ✭ 51 (+18.6%)
Mutual labels:  dapp, web3
SkyGallery
Create galleries by uploading images and videos. Powered by Sia Skynet.
Stars: ✭ 23 (-46.51%)
Mutual labels:  dapp, web3
trystero
🤝 Serverless WebRTC matchmaking for painless P2P — Make any site multiplayer in a few lines — Use BitTorrent, IPFS, or Firebase
Stars: ✭ 512 (+1090.7%)
Mutual labels:  dapp, web3
erebos
JavaScript client and CLI for Swarm
Stars: ✭ 47 (+9.3%)
Mutual labels:  dapp, web3
nextjs-dapp-starter-ts
A fullstack monorepo template to develop ethereum dapps
Stars: ✭ 228 (+430.23%)
Mutual labels:  dapp, web3
Golden Wallet React Native
Golden - Best Wallet Ever
Stars: ✭ 201 (+367.44%)
Mutual labels:  dapp, web3
create-react-native-dapp
Your next Ethereum application starts here. ⚛️ 💪 🦄
Stars: ✭ 410 (+853.49%)
Mutual labels:  dapp, web3
dtube
Decentralized video sharing & social media platform on Ethereum blockchain.
Stars: ✭ 70 (+62.79%)
Mutual labels:  dapp, web3
LunDAO
LunDAO 是一個鼓勵撰寫與 Ethereum 社群相關的中深度的中文文章,透過一個短期的實驗專案嘗試 DAO 可以如何進行社群治理以及回饋社群貢獻。
Stars: ✭ 50 (+16.28%)
Mutual labels:  dapp, web3
dxvote
Governance Dapp of DXdao
Stars: ✭ 28 (-34.88%)
Mutual labels:  dapp, web3
Web3swift
Elegant Web3js functionality in Swift. Native ABI parsing and smart contract interactions.
Stars: ✭ 237 (+451.16%)
Mutual labels:  dapp, web3
airswap-web
AirSwap Web App
Stars: ✭ 94 (+118.6%)
Mutual labels:  dapp, web3
Frame
System-wide Web3 for macOS, Windows and Linux
Stars: ✭ 225 (+423.26%)
Mutual labels:  dapp, web3
circles-myxogastria
Webapp and mobile client for Circles
Stars: ✭ 32 (-25.58%)
Mutual labels:  dapp, web3
vue-web3
🐙 Web3 blockchain bindings for Vue.js (inspired by Vuefire and Drizzle)
Stars: ✭ 63 (+46.51%)
Mutual labels:  dapp, web3
Eth Vue
Featured in Awesome Vue [https://github.com/vuejs/awesome-vue], a curated list maintained by vuejs of awesome things related to the Vue.js framework, and Awesome List [https://awesomelists.net/150-Vue.js/3863-Open+Source/18749-DOkwufulueze-eth-vue], this Truffle Box provides everything you need to quickly build Ethereum dApps that have authentication features with vue, including configuration for easy deployment to the Ropsten Network. It's also Gravatar-enabled. Connecting to a running Ganache blockchain network from Truffle is also possible -- for fast development and testing purposes. Built on Truffle 5 and Vue 3, eth-vue uses vuex for state management, vuex-persist for local storage of app state, and vue-router for routing. Authentication functionalities are handled by Smart Contracts running on the Ethereum blockchain.
Stars: ✭ 171 (+297.67%)
Mutual labels:  dapp, web3
Use Wallet
👛 useWallet() · All-in-one solution to connect a dapp to an Ethereum provider.
Stars: ✭ 182 (+323.26%)
Mutual labels:  dapp, web3
zksync-dapp-checkout
zkCheckout — trustable permissionless DeFi payment gateway. Brand new zkSync dApp w/t all L2 perks: fast&cheap transfers / simple&quick withdrawal
Stars: ✭ 37 (-13.95%)
Mutual labels:  dapp, web3

FoodPrint

FoodPrint is a digital, blockchain-enabled, farm-to-fork (fresh produce) supply chain platform for smallholder farmers, primarily in developing countries. FoodPrint is designed to:

  • Simplify production and harvest data collection for smallholder farmers.
  • Directly connect them to market opportunities - including but not limited to intermediaries such as markets and retailers, as well as consumers.
  • Provide them with access to blockchain-based financial and transactional services.

Overview

FoodPrint has 5 types of users:

  • Super User Admin

The Super User is responsible for setting up the infrastructure and system configuration.

  • System Admin

The System Admin is responsible for the day-to-day running of the platform, providing user support (on-boarding and operations) and basic configuration.

  • Farmer

The Farmer is responsible for capturing produce data at harvest time onto FoodPrint. The Farmer also transports the produce to the Market as per order from Market Admin.

  • Intermediary e.g. Wholesaler, Retailers, Farmers Market Admin etc

The Intermediary is responsible for receiving produce from the Farmer and capturing the relevant data onto FoodPrint.

  • Consumer

The consumer is the final actor in a food supply chain. They purchase fresh produce from an intermediary. The consumer can scan a barcode associated with produce and view the verified produce information and supply chain stories i.e. view information on the produce they are buying, it's source and journey, hence from farm-to-fork. Android versions 8 & 9 and iOS versions 11 & 12 can automatically scan QR codes using the camera app.

Documentation

TODO

IDE Setup

IDE of choice is VS Code

Code Formatter is Prettier

Make sure prettier is installed i.e. npm install --save-dev --save-exact prettier

Project specific Prettier config file is .prettierrc.json which is in the project root

Make sure Prettier extension is installed in VS Code (run following command in VS Code ext install esbenp.prettier-vscode)

Project specific VS Code config file is .vscode/settings.json

To run Prettier CLI npm run format (which is defined in package.json)

To run Prettier manually for specific file formats prettier --write 'src/**/*.{ts,tsx}'

Credit - https://glebbahmutov.com/blog/configure-prettier-in-vscode/

Installation (Development Environment)

In order to run FoodPrint, an environment with the following is required:

  • Node.js
  • Algosdk
  • Bootstrap
  • MySQL
  1. Install node dependencies.
$npm install
  1. Create a blank MySQL database

  2. Create a .env file in the root directory of your project. Add environment-specific variables on new lines in the form of NAME=VALUE. For example

NODE_ENV=staging
PORT=3000
APP_NAME=REPLACE_ME
SESSION_SECRET=REPLACE_ME
EMAIL_ADDRESS=GMAIL_EMAIL_ADDRESS
EMAIL_PASSWORD=GMAIL_EMAIL_PASSWORD
WEBAPP_PASSWORD=WEBAPP_PASSWORD
EMAIL_HOST=EMAIL_HOST
EMAIL_PORT=EMAIL_PORT
TEST_EMAIL_ADDRESS=TEST_EMAIL_ADDRESS
EMAIL_OVERRIDE=OVERRIDE_EMAIL_ADDRESS
BLOCKCHAINENV=TESTNET
DEV_ALGOD_API_KEY=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
DEV_ALGOD_SERVER=http://localhost
DEV_ALGOD_PORT=4001
DEV_ALGOINDEXER_PORT=8980
TESTNET_ALGOD_API_KEY=REPLACE_ME
TESTNET_ALGOD_SERVER=https://testnet-algorand.api.purestake.io/ps2
TESTNET_ALGOINDEXER_SERVER=https://testnet-algorand.api.purestake.io/idx2
TESTNET_ALGOD_PORT=
MAINNET_ALGOD_API_KEY=REPLACE_ME
MAINNET_ALGOD_SERVER=https:https://mainnet-algorand.api.purestake.io/ps2
MAINNET_ALGOINDEXER_SERVER=https://mainnet-algorand.api.purestake.io/idx2
MAINNET_ALGOD_PORT=
ACCOUNT1_ADDRESS=REPLACE_ME
ACCOUNT1_MNEMONIC=REPLACE_ME
ACCOUNT2_ADDRESS=REPLACE_ME
ACCOUNT2_MNEMONIC=REPLACE_ME
DB_USERNAME=REPLACE_ME
DB_PASSWORD=REPLACE_ME
DB_DATABASE=REPLACE_ME
DB_HOST=REPLACE_ME
DB_DIALECT=REPLACE_ME
DB_URL=REPLACE_ME
USER1_PASSWORD=REPLACE_ME
USER2_PASSWORD=REPLACE_ME
USER3_PASSWORD=REPLACE_ME
USER4_PASSWORD=REPLACE_ME
USER5_PASSWORD=REPLACE_ME
USER6_PASSWORD=REPLACE_ME
USER7_PASSWORD=REPLACE_ME
DO_BUCKET_NAME=REPLACE_ME
DO_KEY_ID=REPLACE_ME
DO_SECRET=REPLACE_ME
DO_ENDPOINT=REPLACE_ME

You can then access the variables in your code using process.env e.g. console.log(process.env.NODE_ENV)

  1. Start the web server (Express) and navigate to http://localhost:3000/ in your browser.
$npm run dev

Production Deployment

  1. To deploy to a production server e.g. heroku, first bundle and uglify then deploy
$npm run build
$npm run start

Other

  • Generating Sequelize Models from an existing database using Sequelize Auto. For convenience Sequelize Auto provides a programmatic api that can be used in the generation of models in addition to their cli. You can use the convenience script src/js/sequelise_auto_export.js to generate required models by supplying the table names in the tables section of the options object. The script establishes a connection to the database using the config data specified in step 3. Execute the command below within src/js to generate the models for the specified tables:
node sequelise_auto_export.js

The generated models can be found in ./models

  • Generate test UUID's from command line (i.e. server side).
$node
>const uuidv4 = require('uuid/v4')
>uuidv4()
  • Generate test QRCode's from command line (i.e. server side).
$node
>var QRCode = require('qrcode');
>let produceUrl = "http://www.google.com";
>let supplier = "supplier";
>let produce = "Storage";
>var res2 = await QRCode.toDataURL(produceUrl);
>res2

Deploy to Heroku

Summary

Create app on Heroku

login to Heroku via command line i.e. heroku login

add heroku remote to your local repo i.e. heroku git:remote -a app name

Link to Git Repo

Update env variables

Create database addon Postgres (natively supported by Heroku) or ClearDB which is MySQL -
https://devcenter.heroku.com/articles/cleardb


$ heroku addons:create cleardb:ignite
$ heroku config | findstr CLEARDB_DATABASE_URL
$ heroku config | set DATABASE_URL= # MySQL database url retrieved from above line

Deploy repo to Heroku

$ git push heroku main

Install Heroku releases retry plugin (if you deploy to heroku and it fails, you no longer have to commit a dummy txt file in order to bump up the latest commit hash so that your next push up to heroku will trigger a deploy.)

$ heroku plugins:install heroku-releases-retry

Then to retry failed deploy

$ heroku releases:retry

Login to Heroku bash

$ heroku run bash

If everything went well, you’ve successfully deployed your Node.js app to Heroku. To open your app, run:

$ heroku open

If you ever need to restart/stop the Heroku app

$ heroku ps:restart web -a nameofapp
$ heroku ps:stop web -a nameofapp

If you need to run sequelize migrations in Heroku (although this is included in the build step in package.json)

$ heroku run npx sequelize-cli db:migrate --url 'mysql://root:password@mysql_host.com/database_name' --app nameofapp

Tail Heroku logs

$ heroku logs --tail

Migrate data from MySQL to local Postgres using pgloader

$ pgloader mysql://username:password@localhost/mysqldbname postgresql:///pgdbname

Push local Postgres to Heroku (v1)

$ heroku pg:psql heroku-db-name --app nameofapp

Push local Postgres to Heroku (v2)

$ PGUSER=postgres PGPASSWORD=password123  heroku pg:push postgres://localhost/example <heroku-db-name>

Reset Heroku Postgres database (i.e. truncate)

$ heroku pg:reset

Backup Heroku Postgres database

$ heroku pg:backups:capture
$ heroku pg:backups:download

Previous contract details

Initial contract was deployed at Ethereum Testnet (rinkeby) at address https://rinkeby.etherscan.io/address/0xfC4d26073650887069dFa7Da686A491535ab8Fd4.

This was followed by a deployment to the Matic Testnet (mumbai) at address https://mumbai.polygonscan.com/address/0x650168110ADa1f089D443904c6759b7349576A0d,

Latest version of FoodPrint is integrated with the Algorand TestNet via the algosdk and PureStake service.

Supported Browsers

IE / Edge
IE / Edge
Firefox
Firefox
Chrome
Chrome
Safari
Safari
iOS Safari
iOS Safari
Samsung
Samsung
Opera
Opera
IE11, Edge Supported Supported Supported Supported Supported Supported
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].