# Starting a Project

This document shows how to start a new Agoric project. Our demos are called Dapps (distributed applications), which typically have a browser-based user interface, a public API server, and a contract running on the Agoric blockchain.

Before doing the steps given in this document, be sure you have done the necessary prerequisites specified in Before Using Agoric.

For complete documentation on the Agoric CLI commands (those starting with agoric) used here, see the Agoric CLI Guide.

Also, for what needs to be done after you modify a project's code, see Development Cycle

Step Action Explanation
1
Go to or open a shell and cd <directory-where-you-want-to-install-Dapp-code> When you initialize your project/Dapp in the next step, its initial code is copied into your current directory (permissions allowing).
2
Run agoric init demoInitializes a Dapp (Distributed application) project.

init creates a sub-directory with the specified name (demo in this case) in your current directory and copies an existing project's files into it. You can give the project any name you like. This documentation assumes you used demo.

There are optional arguments that let you specify which project you want copied into the specified directory. By default, their values are set to use the Encouragement Dapp we wrote to provide a simple skeleton for a smart contract. To specify a different project, use the optional arguments:
--dapp-template <name> Use the project specified by this <name> as the template copied into your current directory.
--dapp-base <base-url> Look under this directory for the Dapp template.

If this doesn't work, use echo $PATH to check that your Agoric CLI install directory is in your $PATH If not, add it to $PATH
3
cd demo Move to the directory where your project (the demo) is located.
4
agoric install Install JavaScript dependencies, which may take a while.
5
agoric start --reset
(leave this shell up with the process running)
Start the Agoric VM. --reset discards any prior Agoric state. This creates the vats in which smart contract code runs. The VM continues to run in this shell, making it unusable for running commands.
6
Open another shell, go to your demo directory For the remainer of this table, we call this the deploy shell.

Use the same project directory name and location as you used in Step 2. In this example, we used demo but you may have used a different name in Step 2.
7
In the deploy shell, agoric deploy ./contract/deploy.js ./api/deploy.js Deploy the Dapp on an Agoric VM, install the Dapp's smart contract and web API, as well as JavaScript code that implements the Agoric APIs for writing and implementing contracts.
8
In the deploy shell, cd ui Move into the sub-directory that stores the demo project's UI
9
In the deploy shell, yarn install Install NPM dependencies
10
In the deploy shell, yarn start start is a yarn sub-command implemented by Agoric. It launches the React development server.
11
Go to a browser and open http://localhost:3000 to see the Dapp. If you used the default values for agoric init in Step 2, you'll see the Encouragement demo Dapp, described in the next cell. If you used the agoric init defaults in Step 2, you'll see our Encouragement Dapp, which lets you get encouragement, either for free or by making a tip. The latter requires interaction with your wallet where your assets are stored. See the next step.
12
Go to another tab or browser and open http://localhost:8000/ to see and interact with a basic wallet and a REPL REPL is Read-Eval-Print Loop. Your Encouragement Dapp wallet is seeded with a few purses.