The files for the frontend will be added to a new directory, src/, placed in the root of our overall project. By making use of CDNs, we can keep the number of files to a minimum. The files we will need to create are shown in the following directory structure:
...
|
|--- src/
| |
| +--- js/
| | |
| | +--- app.js
| |
| +--- index.html
...
The index.html file will contain the HTML for our single-page site, while the app.js file will contain the JavaScript required to handle user interactions. There is no separate css/ directory, since we will be using Bootstrap for styling.
Together with these files, we will also be using JavaScript code sourced from CDNs for the following:
- Bootstrap, to provide the styling for the user interface
- Web3, to allow our frontend to interact with the blockchain
- Truffle Contract, to provide a more intuitive interface for our frontend code to interact with the deployed contracts
- jQuery, which is required by Bootstrap