Welcome to the repository of Power Dapp for building web3 application. This project is designed to provide developers with a robust framework for quickly scaffold and build decentralized applications (dApps) that interact with blockchain technologies, specifically focusing on features like managing NFTs, handling digital wallets, and integrating with DeInfra Network.
- NFT Management: Create and manage NFT posts seamlessly.
- Account Management: Register and manage user accounts with profile settings.
- Blockchain Interaction: Utilize built-in smart contract interactions through predefined ABIs.
- Multi-Language Support: Ready-to-use internationalization setup for global app deployment.
- Authentication: Support for traditional and Single Sign-On (SSO) authentication methods.
- Dynamic Routing: Efficient navigation setup across different components of the application.
- Notification System: Integrated user notification system.
- Asset Management: Manage and showcase digital assets owned by users.
- Node.js (v18.x or later)
- Yarn or npm
- tpe cli
- Clone the repository:
git clone https://github.com/thepower/PowerDapp
cd PowerDapp
- Install dependencies:
yarn install
# or
npm install
-
Set up environment variables:
Copy
.env.example
to.env
and adjust the settings to match your development environment. -
Install the TPE CLI, run the following command:
yarn add @thepowereco/cli
## or
npm i -g @thepowereco/cli
- Start the development server:
yarn start
# or
npm start
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
To get some SK tokens for testing, you can use the faucet at
https://faucet.thepower.io/
Use 1 chain of devnet for testing with free tokens.
yarn build
# or
npm run build
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
To deploy the frontend to the Power DCloud storage, run the following command:
Register an account with tpe:
tpe register
Select the devnet option and make a note of the provided information, as it will be needed later. Here is the example:
✔ Please, select the network: · devnet
Loading... done
Network: devnet
Chain number: 1
Account address: AA100000001677740890
Account seed phrase: peanut shadow approve put grain outdoor hand program angry tiger cry diary
Account wif: L2NzLJEtduehhwxT7cidd13tNDmsnZn9neoYa9wRg9W89gDcdeVu
To replenish the balance of your account please visit: https://faucet.thepower.io
Go to the folder one level above the folder you want to upload. For example, if you want to upload the /home/app
folder, navigate to the /home
folder.
tpe upload ./build
and specify the folder you want to upload, for example ./app.
Enter the address and wif from step 3. The files will be uploaded.
After the files are uploaded, the location where they will be stored will be indicated.
The Power DCloud Web3 Application comes with a set of predefined smart contracts that can be used to interact with the blockchain. These contracts are located in the contracts
directory and can be deployed to the blockchain using the provided scripts.
To deploy the smart contracts to the blockchain, follow these steps:
Compile all contracts using the following command
yarn buildsc
## or
npm buildsc
Compile the single contract using the following command:
yarn solcjs contracts/filename.sol -o build --bin --optimize --abi
## or
npm solcjs contracts/filename.sol -o build --bin --optimize --abi
Fill the utils/test.json
file with the following information:
"account": "wallet.pem",
"bin": "buildsc/contract_name.bin",
"abi": "buildsc/contract_name.abi",
"params": [
"address_of_profiles_contract",
"role_hash"
]
Deploy the contract using the following command:
yarn deploy ./utils/deploy-config.json
## or
npm deploy ./utils/deploy-config.json
For detailed documentation on each module and its functionalities, refer to the individual README files within each directory (src/*
). These documents provide insights into the specific responsibilities and usage of each component.
We welcome contributions from the community! If you'd like to contribute to the Power DCloud Web3 Application, please:
- Fork the repository.
- Create your feature branch (git checkout -b feature/AmazingFeature).
- Commit your changes (git commit -m 'Add some AmazingFeature').
- Push to the branch (git push origin feature/AmazingFeature).
- Open a pull request.
For support, contact support@thepower.io or open an issue in this repository.
This project is licensed under the MIT License - see the LICENSE file for details.