PetLove Application in Internet Computer Platform for Moledao Hackathon 2021. The app is deployed on the IC chain for demonstration. You can visit it here.
The project is submitted using the HackerLink Account: https://hackerlink.io/hacker/33614.
Since Internet Computer is a comparatively slow network. We optimized our user experience using the most most advanced front-end technology like React.js and Material-UI.
We used the IC wallet to get the user identity, including the principal and an actor that in a representitive of the user to interact with our backend. With the actor, we were able to secure the user while providing login and cryptocurrency transfer services.
We are able to trade with the help of a canister that issues a cryptocurrency of our own. And the user can get an initial account balance to try our service.
- Clone the project
$ git clone https://github.com/Bill0412/pet-love.git
$ cd pet-love
$ npm install
- Create a user config file In the project root, run the following commands
$ mkdir config
$ cd config
$ touch user.json
Then you can open the config/user.json
file with your favorite text editor to edit it. Following is an example,
{
"backendCanisterId": "szbmr-7yaaa-aaaai-abaoa-cai",
"cryptoCanisterId": "kfj54-ziaaa-aaaai-qbd2a-cai"
}
backendCanisterId
: the id for your specific backendcryptoCanisterId
: the id of the canister that we published a cryptocurrency in accordance with ERC20
- Deploy the project on the Internet Computer
$ npm install
$ dfx deploy --network ic --argument '(principal "'$(dfx identity get-principal)'")'
You should have npm
, node.js
, dfx
installed in advance.
Each time before you push to remote origin, please make sure your code is up to date. (pull from remote before you commit)
$ git commit -m 'your commit message'
$ git pull origin <branch name>
$ git push origin <branch name>
The frontend code is at src/PetLove_assets/src
and backend code is at src/PetLove/src
. You can follow the following instructions to start your development.
- You should switch to your target branch for development.
$ git checkout <your branch>
- Install
npm
package dependencies
$ npm install
- Start development.
$ dfx start --background
$ dfx deploy --argument '(principal "'$(dfx identity get-principal)'")'
$ npm start
- Fork this repository
- Create a new Feat_xxx branch
- Submit your code
- Create a Pull Request