Klaytn Docs
Search…
3. Directory Structure
1
|-- contracts
2
|-- migrations
3
|-- truffle.js
4
|-- static
5
|-- src
6
|-- klaytn
7
|-- caver.js
8
|-- KlaystagramContract.js
9
|-- redux
10
|-- pages
11
|-- AuthPage.js
12
|-- FeedPage.js
13
|-- components
14
|-- UploadPhoto.js
15
|-- Feed.js
16
|-- TransferOwnership.js
17
|-- ...
18
|-- styles
19
|-- utils
20
|-- index.js
21
|-- App.js
Copied!
contracts/: Contains Solidity contract files.
migrations/: Contains JavaScript files that handle smart contract deployments.
truffle.js: Contains Truffle configurations.
src/klaytn: Contains files that support interaction with the Klaytn.
  • src/klaytn/caver.js: Instantiates caver-js within the configured settings.
    cf) caver-js is a RPC call library which makes connections to the Klaytn node, interacts with the nodes and smart contracts deployed on Klaytn.
  • src/klaytn/Klaystagram.js: Creates an instance of the contract using the caver-js API. You can interact with the contract through the instance.
src/redux: Creates API functions that interact with the contract and keep track of consequent data.
src/pages: Contains two page files that compose Klaystagram app.
  • src/pages/AuthPage.js: Contains sign up and login form. You can generate private key in the sign up form and use it to login on the app.
  • src/pages/FeedPage.js: Reads photo data from the contract and show them to users. Also users can upload their pictures in FeedPage.
src/components: Contains component files that compose page.
  • src/components/Feed.js: Reads data from contract and displays photos
  • src/components/UploadPhoto.js: Uploads photo by sending transaction to contract
  • src/components/TransferOwnership.js: Transfers photo's ownership by sending transaction
src/components: Contains frontend component files.
src/styles: Overall style definition regarding stylesheet static/: Contains static files, such as images and fonts. src/index.js: App's index file. ReactDOM.render logic is in here. src/App.js: App's root component file.
Copy link
Edit on GitHub