• Stars
    star
    176
  • Rank 216,924 (Top 5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 7 years ago
  • Updated about 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Truffle, Webpack, React, Redux boilerplate with routing and authentication via a smart contract.

⚠️ No new changes will be made to this box! Truffle no longer actively maintains official boxes that encourage production use of their included contracts. We encourage you to take a look at other boxes in our listing that offer authentication.

React, Redux and Authentication Truffle Box

In addition to Webpack and React, this box adds: react-router, redux and redux-auth-wrapper for authentication powered by a smart contract. Great for building your own auth system.

Installation

  1. Install Truffle globally.

    npm install -g truffle
  2. Download the box. This also takes care of installing the necessary dependencies.

    truffle unbox react-auth
  3. Run the development console.

    truffle develop
  4. Compile and migrate the smart contracts. Note inside the development console we don't preface commands with truffle.

    compile
    migrate
  5. Run the webpack server for front-end hot reloading (outside the development console). Smart contract changes must be manually recompiled and migrated.

    // Serves the front-end on http://localhost:3000
    npm run start
  6. Truffle can run tests written in Solidity or JavaScript against your smart contracts. Note the command varies slightly if you're in or outside of the development console.

    // If inside the development console.
    test
    
    // If outside the development console..
    truffle test
  7. Jest is included for testing React components. Compile your contracts before running Jest, or you may receive some file not found errors.

    // Run Jest outside of the development console for front-end component tests.
    npm run test
  8. To build the application for production, use the build command. A production build will be in the build_webpack folder.

    npm run build

FAQ

  • How do I use this with the EthereumJS TestRPC?

    It's as easy as modifying the config file! Check out our documentation on adding network configurations. Depending on the port you're using, you'll also need to update line 34 of src/util/web3/getWeb3.js.

  • Why is there both a truffle.js file and a truffle-config.js file?

    truffle-config.js is a copy of truffle.js for compatibility with Windows development environments. Feel free to it if it's irrelevant to your platform.

  • Where is my production build?

    The production build will be in the build_webpack folder. This is because Truffle outputs contract compilations to the build folder.

  • Where can I find more documentation?

    This box is a marriage of Truffle and a React setup created with create-react-app. Either one would be a great place to start!

More Repositories

1

react-box

Truffle, Webpack and React boilerplate.
JavaScript
735
star
2

drizzle-box

This box comes with everything you need to start using smart contracts from a react app with Drizzle. It includes drizzle, drizzle-react and drizzle-react-components to give you a complete overview of Drizzle's capabilities.
JavaScript
316
star
3

pet-shop-box

A box containing all you need to get started with our Pet Shop tutorial.
JavaScript
196
star
4

metacoin-box

MetaCoin smart contracts example box
JavaScript
121
star
5

react-uport-box

Truffle, Webpack, React, Redux boilerplate with routing and authentication via a UPort.
JavaScript
98
star
6

webpack-box

Example webpack-based app for Truffle (boilerplate)
JavaScript
58
star
7

tutorialtoken-box

A box containing all you need to get started with our OpenZeppelin (TutorialToken) tutorial.
JavaScript
57
star
8

polygon-box

Boilerplate code for deploying contracts to the Polygon Matic PoS network.
JavaScript
35
star
9

vue-box

Truffle vue box based off Drizzle
Vue
30
star
10

react-native-box

JavaScript
28
star
11

filecoin-box

Filecoin flavored Ganache Truffle box
JavaScript
25
star
12

optimism-box

Truffle box with code to start working with Optimism L2
JavaScript
22
star
13

bare-box

Truffle Box for a bare-minimum Truffle project (`truffle init`)
JavaScript
22
star
14

arbitrum-box

Boilerplate proof of concept to compile, migrate, and test code on the Arbitrum Layer 2.
JavaScript
20
star
15

nft-marketplace-box

JavaScript
17
star
16

drizzle-react-native-box

This box is to help get you started with building dapps with Drizzle on React Native.
JavaScript
17
star
17

blueprint-box

All you need to get started making your own Truffle Box!
JavaScript
16
star
18

tezos-example-box

Simple example box for Tezos development with Truffle
JavaScript
16
star
19

vyper-example-box

Simple example box for Vyper
JavaScript
15
star
20

nft-box

Boilerplate for creating an NFT collection
JavaScript
15
star
21

nightfall-box

A nightfall truffle box
Solidity
15
star
22

tezos-smartpy-example-box

Simple example box for Tezos SmartPy development with Truffle
JavaScript
7
star
23

azure-simple-marketplace-box

Azure Samples - Simple Marketplace
JavaScript
4
star
24

azure-basic-provenance-box

Azure Samples - Basic Provenance
Solidity
4
star
25

tezos-tzip-12-box

A TZIP-12 Token example box for Tezos development with Truffle
JavaScript
4
star
26

security-starter-box

Web3 security knowledge in a box 🔐
TypeScript
4
star
27

tezos-bare-box

Bare Tezos Box for `truffle init`
JavaScript
4
star
28

v5.1-example-box

Example project to show Truffle v5.1 features
JavaScript
3
star
29

infura-nft-sdk-box

JavaScript
3
star
30

azure-asset-transfer-box

Azure Samples - Asset Transfer
JavaScript
3
star
31

azure-hello-blockchain-box

Azure Samples - Hello Blockchain
JavaScript
3
star
32

azure-bazaar-item-listing-box

Azure Samples - Bazaar Item Listing
Solidity
3
star
33

devcon4-box

devcon iv. Truffle Workshop
JavaScript
2
star
34

optimism-bridge-box

Optimism bridge examples.
JavaScript
2
star
35

lens-box

Solidity
2
star
36

truffle-creator-box

Create, save (decentrally), and mint your very own Truffle NFT
JavaScript
1
star
37

next-box

Next.js and Truffle template
TypeScript
1
star
38

preserve-example-box

Example `truffle preserve` box
HTML
1
star
39

dao-box

Solidity
1
star
40

vscode-starter-box

Starter Box for Trufflesuite for VSCode
JavaScript
1
star
41

simplemarketplace-box

Solidity
1
star
42

truffle-box.github.io

Truffle Box GitHub page.
HTML
1
star
43

unity-box

JavaScript
1
star
44

azure-refrigerated-transportation-box

Azure Samples - Refrigerated Transportation
Solidity
1
star
45

v5.2-example-box

Example box to show off features new to Truffle version 5.2.0.
Solidity
1
star