For ease of understanding the Dapp development process we will reuse
the problems already discussed in
the smart contracts course of the specialization course two.
These smart contracts are also available in the solidity documentation.
On completion of this lesson you will be able to present a Dapp problem definition,
outline an approach to solve the problem,
design a high level solution using smart contracts,
and identify components of the Truffle IDE.
We have chosen to discuss the problem specified in the smart contract,
voting dot sol or ballot dot sol of the solidity documentation.
It represents the universal problem of choosing a winner
or a leader using the democratic process of voting.
It represents a wide variety of scenarios from
reviews of a product and it's purchase based on the good reviews it received.
Also, for passing a law on a budget in a governing body.
Let's start with the review of the ballot Dapp.
Our goal is to design and develop a Dapp for voting that
selects among number of items such as a set of proposals or products.
In our case, we'll opt for the popularity of four different fruits.
As a reminder from our previous lessons,
the chairperson organizes the voting.
Voters are identified by their account addresses.
Here is the logic or the rules to implement.
Only the chairperson can register other voters.
A voter can be registered only once.
Only registered voters can vote.
Voters can vote only once.
There is no "write in" that is voters can vote only for the items presented.
And the chairperson's vote has double the weightage of the regular voter.
To maintain the focus solely on the process of Dapp development
we'll not handle the time elements or stages of the balloting.
At this time we'll talk about the four steps that make up the design process.
We'll represent the main logic of the problem using the smart contract and solidity.
We'll begin with data and operations.
To this we'll add modifiers and validation checks
to make sure rules specified in the problem definition are addressed.
We'll design a test smart contract that will ensure all the stated requirements are met.
This like unit testing.
After the successful completion of unit testing we'll
add the front-end component and test the completed Dapp.
This is like integration testing.