Front end Preparation - cogeorg/teaching GitHub Wiki
By unboxing, we initialized an npm project. Its dependencies are defined in the package.json
file. Let's go ahead and install those
$ cd CryptoZombies/
$ npm install
Note: The unboxing of the truffle box actually already installed the dependencies
Now, you should have a node_modules/ folder in your project directory. The only package in there worth mentioning is the lite-server- Lite Server is a lightweight HTTP server that will serve our DApp when we run
$ npm run dev
In the package.json
file, you may change the name, version number, and the author.
The source code of our web application can be found in src/. It contains the following files on creation
src/
├── css
│ ├── bootstrap.min.css
│ └── bootstrap.min.css.map
├── fonts
│ ├── glyphicons-halflings-regular.eot
│ ├── glyphicons-halflings-regular.svg
│ ├── glyphicons-halflings-regular.ttf
│ ├── glyphicons-halflings-regular.woff
│ └── glyphicons-halflings-regular.woff2
├── index.html
└── js
├── app.js
├── bootstrap.min.js // CSS framework
├── truffle-contract.js // Ethereum contract abstraction
└── web3.min.js // Ethereum RPC wrapper
Another file that we have not seen before is bs-config.json
. It is a configuration file for the Lite Server, defining where the source files and the compiled contract files are located.