/x-dapp-template

Vechain VeBetterDAO X-App template πŸš€

Primary LanguageTypeScript

X-App Template for VeBetterDAO πŸš€

                                 #######
                            ################
                          ####################
                        ###########   #########
                       #########      #########
     #######          #########       #########
     #########       #########      ##########
      ##########     ########     ####################
       ##########   #########  #########################
         ################### ############################
          #################  ##########          ########
            ##############      ###              ########
             ############                       #########
               ##########                     ##########
                ########                    ###########
                  ###                    ############
                                     ##############
                               #################
                              ##############
                              #########

Unlock the potential of decentralized application development on Vechain with our X-App template for VeBetterDAO. Designed for the Vechain Thor blockchain, this template integrates cutting-edge technologies such as React, TypeScript, Hardhat, and Express, ensuring a seamless and efficient DApp development experience. 🌟

Requirements

Ensure your development environment is set up with the following:

Project Structure

Our project is meticulously organized into three main components:

Frontend (apps/frontend) 🌐

A blazing-fast React application powered by Vite:

  • Vechain dapp-kit: Streamline wallet connections and interactions. Learn more

Backend (apps/backend) πŸ”™

An Express server crafted with TypeScript for robust API development:

  • Vechain SDK: Seamlessly fetch and perform transactions with the VechainThor blockchain. Learn more
  • OpenAI GPT-Vision-Preview: Integrate image analysis capabilities. Explore here

Contracts (apps/contracts) πŸ“œ

Smart contracts in Solidity, managed with Hardhat for deployment on the Vechain Thor network.

Packages πŸ“¦

Shared configurations and utility functions to unify and simplify your development process.

Environment Variables βš™οΈ

Configure your environment variables for seamless integration:

Frontend

Place your .env files in apps/frontend:

Backend

Store your environment-specific .env files in apps/backend:

Contracts

Manage deployment parameters and network configurations in hardhat.config.js under apps/contracts:

  • MNEMONIC: Mnemonic of the deploying wallet

Getting Started 🏁

Clone the repository and install dependencies with ease:

yarn install # Run this at the root level of the project

Deploying Contracts πŸš€

Deploy your contracts effortlessly on either the Testnet or Solo networks:

Deploying on Solo Network

yarn contracts:deploy:solo

Deploying on Testnet

yarn contracts:deploy:testnet

Running on Solo Network πŸ”§

Run the Frontend and Backend, connected to the Solo network and pointing to your deployed contracts. Ensure all environment variables are properly configured:

yarn dev 

Setting up rewards πŸ’°

Run vechain devpal

npx @vechain/devpal http://localhost:8669

Open the Inspector tab and perform the following transactions. All transactions must be made with the account used to deploy the contracts previously.

  • Add Contracts: Add the EcoEarn contract and the Token contract deployed previously. Addresses can be found in the config-contracts package. ABIs can be found in the artifacts folder of the contracts app. image
  • Approve token: Approve the EcoEarn contract to spend your tokens image
  • Claim rewards: Claim rewards for the EcoEarn contract image
  • Trigger cycle: Trigger the cycle for the EcoEarn contract image

Disclaimer ⚠️

This template serves as a foundational starting point and should be thoroughly reviewed and customized to suit your project’s specific requirements. Pay special attention to configurations, security settings, and environment variables to ensure a secure and efficient deployment.


Embrace the power of VeBetterDAO's X-Apps template and transform your DApp development experience. Happy coding! πŸ˜„