#######
################
####################
########### #########
######### #########
####### ######### #########
######### ######### ##########
########## ######## ####################
########## ######### #########################
################### ############################
################# ########## ########
############## ### ########
############ #########
########## ##########
######## ###########
### ############
##############
#################
##############
#########
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. 🌟
Ensure your development environment is set up with the following:
- Node.js (v18 or later): Download here 📥
- Yarn: Install here 🧶
- Docker (for containerization): Get Docker 🐳
- Hardhat (for smart contracts): Getting Started with Hardhat ⛑️
A blazing-fast React application powered by Vite:
- Vechain dapp-kit: Streamline wallet connections and interactions. Learn more
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
Smart contracts in Solidity, managed with Hardhat for deployment on the Vechain Thor network.
Shared configurations and utility functions to unify and simplify your development process.
Configure your environment variables for seamless integration:
Place your .env files in apps/frontend:
- VITE_RECAPTCHA_V3_SITE_KEY: Request your RecaptchaV3 site keys
Store your environment-specific .env files in apps/backend. .env.development.local & .env.production.local allow for custom environment variables based on the environment:
- OPENAI_API_KEY: Get your GPT-4 OpenAI key (Enable GPT-4 here)
- RECAPTCHA_SECRET_KEY: Request your RecaptchaV3 site keys
Manage deployment parameters and network configurations in hardhat.config.js under apps/contracts:
- MNEMONIC: Mnemonic of the deploying wallet
Clone the repository and install dependencies with ease:
yarn install # Run this at the root level of the projectDeploy your contracts effortlessly on either the Testnet or Solo networks:
yarn contracts:deploy:soloyarn contracts:deploy:testnetRun the Frontend and Backend, connected to the Solo network and pointing to your deployed contracts. Ensure all environment variables are properly configured:
yarn dev Run vechain devpal
npx @vechain/devpal http://localhost:8669Open the Inspector tab and perform the following transactions:
- Add Contracts: Add the EcoEarn contract and the Token contract deployed previously. Addresses can be found in the
config-contractspackage. ABIs can be found in the artifacts folder of thecontractsapp.
- Approve token: Approve the EcoEarn contract to spend your tokens

- Claim rewards: Claim rewards for the EcoEarn contract

- Trigger cycle: Trigger the cycle for the EcoEarn contract

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! 😄