Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pierobassa/x-dapp-template
Vechain VeBetterDAO X-App template π
https://github.com/pierobassa/x-dapp-template
dapp vebetterdao vechain web3
Last synced: 26 days ago
JSON representation
Vechain VeBetterDAO X-App template π
- Host: GitHub
- URL: https://github.com/pierobassa/x-dapp-template
- Owner: pierobassa
- Created: 2024-05-23T07:56:36.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-05-28T10:19:06.000Z (8 months ago)
- Last Synced: 2024-11-07T18:00:29.150Z (3 months ago)
- Topics: dapp, vebetterdao, vechain, web3
- Language: TypeScript
- Homepage:
- Size: 1.05 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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:
- **Node.js (v18 or later):** [Download here](https://nodejs.org/en/download/package-manager) π₯
- **Yarn:** [Install here](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable) π§Ά
- **Docker (for containerization):** [Get Docker](https://docs.docker.com/get-docker/) π³
- **Hardhat (for smart contracts):** [Getting Started with Hardhat](https://hardhat.org/hardhat-runner/docs/getting-started) βοΈ## 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](https://docs.vechain.org/developer-resources/sdks-and-providers/dapp-kit)### 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](https://docs.vechain.org/developer-resources/sdks-and-providers/sdk)
- **OpenAI GPT-Vision-Preview:** Integrate image analysis capabilities. [Explore here](https://platform.openai.com/docs/guides/vision)### 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`:
- **VITE_RECAPTCHA_V3_SITE_KEY:** [Request your RecaptchaV3 site keys](https://developers.google.com/recaptcha/docs/v3)### Backend
Store your environment-specific `.env` files in `apps/backend`:
- **OPENAI_API_KEY:** [Get your GPT-4 OpenAI key](https://platform.openai.com/api-keys) (Enable GPT-4 [here](https://help.openai.com/en/articles/7102672-how-can-i-access-gpt-4-gpt-4-turbo-and-gpt-4o))
- **RECAPTCHA_SECRET_KEY:** [Request your RecaptchaV3 site keys](https://developers.google.com/recaptcha/docs/v3)### 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:
```bash
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
```bash
yarn contracts:deploy:solo
```### Deploying on Testnet
```bash
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:
```bash
yarn dev
```### Setting up rewards π°
Run vechain devpal
```bash
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](https://github.com/pierobassa/x-dapp-template/assets/64158778/53014ebc-c6ea-47d8-9aa1-9d63bc084efb)
- **Approve token:** Approve the EcoEarn contract to spend your tokens
![image](https://github.com/pierobassa/x-dapp-template/assets/64158778/7224c1b7-edda-4943-b7f0-18c4b1997005)
- **Claim rewards:** Claim rewards for the EcoEarn contract
![image](https://github.com/pierobassa/x-dapp-template/assets/64158778/eb54c6ee-aadc-4b68-8d30-e95a8aa0a7e3)
- **Trigger cycle:** Trigger the cycle for the EcoEarn contract
![image](https://github.com/pierobassa/x-dapp-template/assets/64158778/5c002953-b1e4-45c7-a195-7e978f14ee3a)## 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! π