Cliff Hall
Software Architect, Author, Musician, Dude.
Create a system wherein developers of Ethereum-based apps or games with in-app purchases can mint the items they sell as ERC-721 tokens (like CryptoKitties).
It would handle most of the heavy lifting so that those developers could get on with the business of writing a kick-ass product.
Holders of tokens could sell, trade, or even rent them on the open market, so their investment in game items doesn't have to be a total loss when they leave it.
Many of the well-known Ethereum hacks must be taken into account when coding our contracts.
Newer languages like Bamboo are said to defeat some of these hacks, e.g., reentrancy, making them safer by default.
a. How will I authenticate and authorize users?
b. How will I interact with the blockchain?
c. How will I make sure I’m implementing best practices?
Short answer: Delegation
An intermediary will authenticate the user and pass their Ethereum addresses to your app.
A Few Options
Short answer: The Truffle Suite
Short answer: Leverage the community
a. Which application architecture will I use?
b. Which component framework will I use?
c. How will I style my components?
Short answer: React / Redux
Short answer: Bootstrap
Short answer: CSS in JS via Styled Components
A Few Options
Although it's not the most common approach, with React, CSS in JS is an easy choice, made manageable by Styled Components
One big and possibly confusing monorepo that tightly couples the client and blockchain parts
Separate projects for client and blockchain that lead to constant switching between fat IDE instances
Short answer: Big honkin' monorepo
What does the application that communicates with the blockchain to perform shop maintenance need to do?
Until connected to MetaMask (or directly to local Ganache node via fallback) don't show any menus or forms that the user can interact with.
Once connected, user can create a Shop, choose an existing Shop, switch Accounts, or view Account on Etherscan.
If connected to MetaMask, you'll only see one Account, with Ganache direct, you'll see 10. Once connected, auto-select the first Account so the user doesn't have to if there's only one.
Shops have Name, Description, and Fiat Currency.
If the user has existing Shops, show them, but don't auto-select. Create Shop menu item takes you back to splash page if on Shop edit page, otherwise it's disabled.
Categories have a Name and Description and serve only to group the Shop's Items.
Items are priced in the Shop's fiat currency, can be consumable, and/or rare.
When a Shop is selected, the Balance menu is shown. If there is a non-zero balance, the user can transfer that balance to their Ethereum address.
git clone https://github.com/cliffhall/in-app-pro-shop.git
Install Node 8.11 or above (also installs npm)
cd path/to/in-app-pro-shop; npm install
npm install -g ganache-cli
npm install -g truffle
npm run ganache:start
truffle console
migrate --reset
test
The In App Pro Shop Docs
Live Demo on Ropsten Testnet
Project Github Repository
By Cliff Hall
With Solidity and React