Inspiration

Fitness Ventures was inspired by a fitness instructor in Massachusetts. She had asked me if I could build a blockchain-based credentialing system for her studio. The credentials would be offered to her students after completing a series of her classes.

What it does

It allows (1) the creation of a fitness club (organized as a DAO) and (2) the fee-based sign-up of new members to an existing club by means of an NFT minter.

How I built it

On the backend, it relies upon node, Express.js, bash, and heavily upon Hardhat libraries which are called directly by Express. JavaScript and RegEx are used to sanitize user inputs to conform with smart contract name conventions. Jimp-compact was used for image manipulation, all which was done on the backend.

Express is used to call a custom bash script. The script serves as a workhorse which duplicates and customizes DAO contract templates. Specifically, based on information provided by the end user, the bash script customizes and modifies:

  1. Contract Name
  2. Total Memberships (token supply)
  3. Token Pricing
  4. Contract URI (contract metadata consisting of description and logo)

Hardhat is the the star of the show. It compiles and deploys the contracts to the block chain. Hardhat has a JS library that allows for native non command line use on node.

Frontend

The frontend uses React functional components. I began learning React in August 2020 using a strict Model-View-Controller (MVC)] design pattern with a Class Component a the Controller. With that pattern, I would send props downstream (prop-drilling) to my functional components. Facebook's React team now encourages devs to use Functional Components instead.

The CSS classes are semi-custom. The original CSS classes for contract read and write buttons are from Chainlink's VRF2 Subscription Manager. The website design is from Illdy. Illdy is an older (2016 - 2018), open sourced WordPress theme based on Bootstrap 3.

Challenges I ran into

NFT JSON metadata and images are programmatically pinned to IPFS by the minter through an intermediary. IPFS CIDs cannot be read by many browsers, so Piñata was chosen to programmatically pin and manage images on IPFS.

Using Express on the backend was initially challenging. It is unopinionated, thus obligating the developer to research and choose suitable plugins.

However, the biggest challenge was learning how the various DAO contracts (e.g., Governor, Timelock, and Minter) worked together for ensure proper governance.

What I learned

I was able to sharpen my React and Solidity development skills. I also learned about DAOs and the contracts needed for proper governance.

What's next for Fitness Ventures

I would like to receive funding to build out this along with my other Blockchain projects. I can easily assemble a team of up to 3 core developers.

This project is part of a portfolio of blockchain dApps I'm developing. My goal is to use NFTs as primitives to provide cashflow entitlements, blockchain-based credentialing, proof of provenance, proof of work (completed labor), and proof of attendance (of events) for individuals in real life scenarios.

Returning to this particular project, next steps would be to:

  1. Test Governance token functionality (i.e., proposals, delegation, and voting) with an online tool.
  2. Use a multi-sig wallet from Gnosis for the Timelock contract.
  3. Deploy app to a live website via Vercel or Heroku, then to a more robust backend with a database and NGINX
  4. Add money splitting functionality to demo a proof-of-concept of paying out Team cash prizes to members.
  5. Deploy to Mainnet

Built With

Share this project:

Updates