This is a combination between Truffle and ReactJS to create a bootstrapped dApp running on Nexty Platform. It is now easier to deploy smart contracts and smoothly integrate it with your frontend.
npm install -g truffle
git clone https://github.com/nextyio/dapp-template.git
npm install
We have contracts
folder in your cloned directory: dapp-template
. Put your dapps' solidity files here. To learn solidity, you can refer to https://solidity.readthedocs.io
Look at dapp-template/migrations/
and specify your developed smart contracts. Truffle will automatically navigate all files and follow your migrations scenario.
truffle deploy
Remember to specify your private key for deployment in .env
file, which has been sampled in .env.sample
. This .env
files will assign the envirnonment variables to use in truffle_script.js
by dotenv
module and your react application. You can also specify port for running webapp in this file by putting PORT=3006
right below the PRIVATE_KEY
line.
As configured in truffle-config.js
, All deployed contracts' information would be located in src/build/contracts/***.json
. Your frontend scripts can import variables from this directory files, automatically with truffle deployment.
In the project directory, you can run:
npm start
Runs the app in the development mode.
Open http://localhost:3000 / or with your specified port in .env
file, to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
npm test
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
npm run build
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
You can learn more in the Create React App documentation.
To learn React, check out the React documentation.
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify