# Agoric Dapp
This is a generic guide to Agoric Dapp projects
A Dapp is a distributed application which typically has a browser-based user interface, a public API server, and a contract running on the Agoric blockchain.
# Using a Dapp
If you have installed the Agoric CLI and you just want to try running a Dapp locally (on a simulated Agoric VM, not an actual public chain), you can:
# Clone a local version of the dapp. Here we chose the encouragement dapp git clone https://github.com/Agoric/dapp-encouragement.git cd dapp-encouragement # Install the project dependencies agoric install # Start the Agoric VM agoric start --reset
Leave this command running (it is your simulated environment). Then, in a separate terminal:
# Start the user interface cd ui && yarn start
Then in a third terminal, deploy the contract and API to the VM.
# Deploy a new instance of the contract to the VM agoric deploy contract/deploy.js # Reset the VM's API server agoric deploy api/deploy.js
You can then navigate to http://localhost:3000 to view your Dapp.
# Modifying this Dapp
The following are the important directories in an Agoric Dapp project:
contractdefine and deploy the on-chain contract
apidefine and deploy the chain-connected server's
uithe browser user interface that connects between the user's personal wallet and the API server
Other files and directories in this toplevel folder should not typically be modified.
# Contract directory
contract directory, you can find the following files to edit:
initcontract initialization modules, starting with
srccontract source code, starting with
Other files and folders that you don't typically need to edit:
deploy.jsgeneric Agoric contract deployment script
liblibrary modules provided by Agoric and used by the contract
api directory, you can find the following files to edit:
src/api endpoint handler, starting with
Other files and folders that you don't typicaly need to edit:
deploy.jsgeneric Agoric API handler deployment script
ui directory is almost completely under your control. The only files and folders that you don't typically need to edit:
public/libAgoric UI library
public/confconfiguration files that are generated by the
# More information
You can learn more about the Agoric smart contract platform and how to create Agoric Dapps.