基于区块链的毕业设计Ethical-Eating – 合乎道德的饮食

本文提供基于区块链的毕业设计国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,基于区块链的毕业设计Ethical-Eating – 合乎道德的饮食 是一篇很好的国外资料

Ethical-Eating

Project Team

  • Steve Peters-Luciani (peterst5@oregonstate.edu)
  • Jack Edwards (edwajack@oregonstate.edu)
  • Abigail Lam (lamab@oregonstate.edu)
  • Kyeongnam Kim (kimkyeon@oregonstate.edu)
  • Ryan Murphy (murphyr2@oregonstate.edu)

MySQL Setup

First, follow these instructions to connect to the OSU VPN service.

Next, get your username, password, and the database host name from Canvas. Enter the information from Canvas in the db_config.js file.

DO NOT COMMIT YOUR CREDENTIALS TO GITHUB!

Finally, run the db_conn_test.js script to make sure everything is working:

  1. cd ./Ethical-Eating/node
  2. npm install mysql
  3. node scripts/db_conn_test.js

Running the application

  1. Create 2 terminal windows, 1 for Node and 1 for React
    • Leave the node terminal in the core directory
    • Change the directory to client ‘cd client’
  2. Make sure all node_modules are installed from the core (Node) and client (React) directories
    • In the Node terminal, run ‘npm install’
    • In the React terminal, run ‘npm install’
  3. Start Node and React
    • If starting Node terminal for Development*, run ‘npm run dev’
    • If starting Node terminal for Production, run ‘npm start’
    • To start the React terminal, run ‘npm start’

*The Development run will watch for updates in Node and update htem in the browser in real time.


Creating Page Routes – Express portion

You should only have to create a route in Express if you are importing data from the database to use in a page.

  1. Check to see if a category for your route exists in the ./routes directory before creating a new one

  2. Add the function call for the route into the ./routes/{category}.js and setting an export keyword that describes the functionality

     exports.index = function(req, res) {      /* Routes all non-assigned routes to React home */      res.sendFile(path.join(__dirname + '/client/build/index.html'));  } 
  3. In server.js, if a new category was created, require the file path for the category file

     const site = require('./routes/site') 
  4. Create the API call (GET, POST, PUT) with the route and the function

     app.get('*', site.index) 

Creating Page Routes – React portion

If you’re creating a page that doesn’t require database access, you can just create it in React

  1. Create a {pagename}.jsx file in ./client/src/App/pages and fill with the necessary code
  2. Add the page export to the index.js file in the pages directory
  3. Add the page to the ./pages import array on App.js
  4. Add a new Route to the Switch in the Router, setting the path to be your desired URL path and the component to your page function

We use optional third-party analytics cookies to understand how you use GitHub.com so we can build better products. Learn more.


道德饮食

项目团队彼得斯·卢西亚尼(peterst5@oregonstate.edu)杰克·爱德华兹(edwajack@oregonstate.edu)林亚碧(lamab@oregonstate.edu)金敬南(kimkyeon@oregonstate.edu)
  • 瑞安·墨菲(murphyr2@oregonstate.edu)
  • cd./Ethical Eating/node
  • npm安装mysql
  • node脚本/数据库连接_测试.js
  • 创建两个终端窗口,1表示Node,1表示React将节点终端保留在核心目录中,将目录更改为client“cd client”
  • 将节点终端保留在核心目录中
  • 将目录更改为client“cd client”
  • 确保所有节点模块都是从节点的core(Node)和client(React)目录安装的终端,在React终端运行“npm install”,在节点终端运行“npm install”
  • ,在React终端运行“npm install”
  • ,运行“npm install”
  • 启动节点,如果启动节点终端进行开发,则运行“npm run dev”;如果启动节点终端进行生产,则运行“npm Start”以启动React终端,运行“npm start”
  • 如果正在启动节点终端进行开发*,则运行“npm run dev”
  • 如果正在启动节点终端进行生产,则运行“npm start”
  • 以启动React终端,请参见在目录中创建一个新的关键字来创建一个新的目录出口.索引=功能(req,res){/*路由所有未分配的路由以响应home*/res.sendFile文件(路径.连接(u dirname+’/client/build/索引.html’);}
  • 在服务器.js,如果创建了新类别,则需要类别文件const site=require(’./routes/site’)的文件路径。
  • 使用路由和功能应用程序获取(‘*’, 站点.索引)
  • 在./client/src/App/pages中创建一个{pagename}.jsx文件,并填充必要的代码
  • 将页面导出添加到索引.js将页面添加到./pages import数组中应用程序js
  • 向路由器中的交换机添加新路由,设置所需的URL路径和页面函数的组件
    • 瑞安·墨菲(murphyr2@oregonstate.edu)
    • cd./Ethical Eating/node
    • npm安装mysql
    • node脚本/数据库连接_测试.js
    • 创建两个终端窗口,1表示Node,1表示React将节点终端保留在核心目录中,将目录更改为client“cd client”

    MySQL Setup

    首先,按照以下说明连接到OSU VPN服务。

    接下来,从Canvas获取用户名、密码和数据库主机名。在数据库中输入来自画布的信息_配置文件文件。

    不要向GITHUB提交您的凭据!

    最后,运行数据库连接_测试.js确保一切正常的脚本:

    1. 将节点终端保留在核心目录中
    2. 将目录更改为client“cd client”
    3. 确保所有节点模块都是从节点的core(Node)和client(React)目录安装的终端,在React终端运行“npm install”,在节点终端运行“npm install”

    Running the application

    1. ,在React终端运行“npm install”
    2. 如果正在启动节点终端进行开发*,则运行“npm run dev”
    3. 在服务器.js,如果创建了新类别,则需要类别文件const site=require(’./routes/site’)的文件路径。

    *开发运行将监视Node中的更新,并在浏览器中实时更新htem。


    Creating Page Routes – Express portion

    如果要从数据库导入数据以在页面中使用,则只需在Express中创建路由。

    1. 向路由器中的交换机添加新路由,设置所需的URL路径和页面函数的组件
    2. 将该路由的函数调用添加到./routes/{category}.js中,并设置一个描述中功能的export关键字服务器.js,如果创建了新类别,需要类别文件的文件路径

       exports.index = function(req, res) {      /* Routes all non-assigned routes to React home */      res.sendFile(path.join(__dirname + '/client/build/index.html'));  } 
    3. 使用路由和函数创建API调用(GET、POST、PUT)

       const site = require('./routes/site') 
    4. 如果您要创建一个不需要数据库访问的页面,您可以在React中创建它

       app.get('*', site.index) 

    Creating Page Routes – React portion

    我们使用可选的第三方分析cookie来了解您如何使用GitHub.com网站所以我们可以打造更好的产品。了解更多。

    1. Create a {pagename}.jsx file in ./client/src/App/pages and fill with the necessary code
    2. Add the page export to the index.js file in the pages directory
    3. Add the page to the ./pages import array on App.js
    4. Add a new Route to the Switch in the Router, setting the path to be your desired URL path and the component to your page function

    我们使用可选的第三方分析cookies来了解您如何使用GitHub.com网站所以我们可以制造更好的产品。
    您可以随时通过单击页面底部的Cookie首选项来更新您的选择。有关更多信息,请参阅我们的隐私声明。

    部分转自网络,侵权联系删除区块链源码网

    www.interchains.cc

    https://www.interchains.cc/18409.html

    区块链毕设网(www.interchains.cc)全网最靠谱的原创区块链毕设代做网站 部分资料来自网络,侵权联系删除! 最全最大的区块链源码站 !
    区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » 基于区块链的毕业设计Ethical-Eating – 合乎道德的饮食

    提供最优质的资源集合

    立即查看 了解详情