Skip to content

Commit

Permalink
Remove Unused Libraries, Unifying Files Naming and Update README.md F…
Browse files Browse the repository at this point in the history
…iles (#1451)
  • Loading branch information
AtelyPham authored Jul 20, 2023
1 parent 659e707 commit 6c000a5
Show file tree
Hide file tree
Showing 95 changed files with 614 additions and 944 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/check-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ jobs:
- name: Link Checker
uses: lycheeverse/[email protected]
with:
# Ignore the README.md file as some social sharing links are not valid
args: --verbose --no-progress --exclude-path 'README.md' './**/*.md' './**/*.html' './**/*.rst'
fail: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
163 changes: 77 additions & 86 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,120 +10,74 @@
# Webb Monorepo

<p align="left">
<strong>🚀 Decentralized interfaces into the Webb protocol 🚀</strong>
<strong>Decentralized interfaces into the Webb protocol</strong>
<br />
</p>

[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/webb-tools/webb-dapp/check-build.yml?branch=develop&style=flat-square)](https://github.com/webb-tools/webb-dapp/actions) [![License Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=flat-square)](https://opensource.org/license/apache2-0-php/) [![Twitter](https://img.shields.io/badge/follow-%40webbprotocol-1DA1F2?logo=twitter&style=flat-square)](https://twitter.com/webbprotocol) [![Telegram](https://img.shields.io/badge/Telegram-gray?logo=telegram)](https://t.me/webbprotocol) [![Discord](https://img.shields.io/discord/833784453251596298.svg?style=flat-square&label=Discord&logo=discord)](https://discord.gg/cv8EfJu3Tn)

<!-- TABLE OF CONTENTS -->
<h2 id="table-of-contents" style=border:0!important> 📖 Table of Contents</h2>
<h2 id="table-of-contents" style=border:0!important> Table of Contents </h2>

<details open="open">
<summary>Table of Contents</summary>
<summary id="#table-of-contents">Table of Contents</summary>
<ul>
<li><a href="#start"> Getting Started</a></li>
<li><a href="#start">Getting Started</a></li>
<li><a href="#apps">Applications</a></li>
<li><a href="#libs">Libraries</a></li>
<li><a href="#test">Testing</a></li>
<li><a href="#contribute">Contributing</a></li>
<li><a href="#license">License</a></li>
<li><a href="#help">Need help?</a></li>
</ul>
</details>

<h2 id="start"> Getting Started 🎉 </h2>
<h2 id="start"> Getting Started </h2>

This repo is a monorepo containing decentralized interfaces into the Webb protocol! It makes use of [nx.dev](https://nx.dev/) for fast and extensible build system. The repo consists of 3 notable areas:
This is a monorepo for decentralized interfaces in the Webb protocol. It uses [nx.dev](https://nx.dev/) for fast and extensible building. The `apps` directory contains the protocol's interfaces while `libs` contains the necessary code and logic.

- [bridge-dapp:](https://github.com/webb-tools/webb-dapp/tree/develop/apps/bridge-dapp) an interface for interacting and bridging assets cross-chain using Webb's Asset Protocol.
- [stats-dapp:](https://github.com/webb-tools/webb-dapp/tree/develop/apps/stats-dapp) an interface for displaying statistics data of Webb's Tangle Network.
- [webbsite:](https://github.com/webb-tools/webb-dapp/tree/develop/apps/webbsite) an interface for the Webb ecosystem and development.
- [webb-ui-components:](https://github.com/webb-tools/webb-dapp/tree/develop/libs/webb-ui-components) a collection of reusable components for building interfaces quickly.
### Prerequisites

For additional information, please refer to the [Webb Official Documentation](https://docs.webb.tools/) 📝. Have feedback on how to improve the webb-dapp interface? Or have a specific question to ask? Checkout the [Webb Dapp Feedback Discussion](https://github.com/webb-tools/feedback/discussions/categories/webb-dapp-feedback) 💬.

## Prerequisites

This repository makes use of yarn, nodejs, and requires version node v18. To install node.js binaries, installers, and source tarballs, please visit https://nodejs.org/en/download/. Once node.js is installed you may proceed to install [`yarn`](https://classic.yarnpkg.com/en/docs/install):
This repository makes use of yarn, nodejs, and requires version node v18. To install node.js binaries, installers, and source tarballs, please visit https://nodejs.org/en/download/. Once node.js is installed you may proceed to install [yarn](https://classic.yarnpkg.com/en/docs/install):

```bash
npm install --global yarn
```

Great! Now your **Node** environment is ready! 🚀🚀

## Run Hubble bridge locally 💻

Once the development environment is set up, you may proceed to install the required dependencies and run the dapp locally.

1. Clone this repo

```bash
git clone [email protected]:webb-tools/webb-dapp.git && cd webb-dapp
```

2. Install dependencies by `yarn`
Great! Now your **Node** environment is ready!

```bash
yarn install
```
<div align="right"><a href="#table-of-contents">↑ Back to top ↑</a></div>

3. Start the bridge-dapp:
<h2 id="apps"> Applications </h2>

```bash
yarn start:bridge
```
- [bridge-dapp](./apps/bridge-dapp/README.md): an interface for interacting and bridging assets cross-chain using Webb's Asset Protocol.
- [faucet](./apps/faucet/README.md): an interface for requesting cryptocurrencies (assets) on the Webb Protocol System.
- [hubble-stats](./apps/hubble-stats/README.md): an interface for displaying statistical data of the Cross-chain Bridging System.
- [stats-dapp](./apps/stats-dapp/README.md): an interface for displaying statistical data of Webb's Tangle Network (DKG system).
- [tangle-website](./apps/tangle-website/README.md): an interface for the Tangle ecosystem and development.
- [webbsite](./apps/webbsite/README.md): an interface for the Webb ecosystem and development.

Visit `http://localhost:3000/` to see the Webb Bridge Dapp UI! 🕸️ 🚀 If you would like to utilize the Hubble bridge
with a local EVM network and local relayer refer to the instructions [here](https://github.com/webb-tools/webb-dapp/tree/develop/apps/bridge-dapp#webb-hubble-bridge).
<div align="right"><a href="#table-of-contents">↑ Back to top ↑</a></div>

### Setting Up a Local EVM Network with Hubble Bridge
<h2 id="libs"> Libraries </h2>

If you want to create a local EVM network with a local relayer and Hubble bridge, we have step-by-step instructions you can follow [here](https://github.com/webb-tools/webb-dapp/tree/develop/apps/bridge-dapp#webb-hubble-bridge). Before setting up a local EVM network be sure to clear your `localStorage`.
- `abstract-api-provider`: a collection of base and abstract classes that unify the API across multiple providers.
- `api-provider-environment`: contains the React context definitions, the app event, and functions for handling interactive feedback errors for the bridge app.
- `browser-utils`: contains all the browser utility functions, such as fetch with caching, download file and string, the customized logger class, get browser platform, and the storage factory function for interacting with local storage.
- `dapp-config`: contains all configurations (chains, wallets, etc.) for the bridge dApp.
- `dapp-types`: contains all the sharable TypeScript types and interfaces across the apps.
- `icons`: contains all the sharable icons across the apps.
- `note-manager`: contains all the logic for storing note account data.
- `polkadot-api-provider`: the Substrate (or Polkadot) provider for the bridge.
- `react-hooks`: contains all the sharable hooks across the apps.
- `relayer-manager-factory`: contains all the logic for interacting with the relayer.
- `tailwind-preset`: the Webb TailwindCSS preset for all the apps.
- `web3-api-provider`: the EVM provider for the bridge.
- [webb-ui-components](./libs/webb-ui-components/README.md): a collection of reusable components for building interfaces quickly.

If you're comfortable running scripts and using a macOS environment, you can use the following scripts in the `/tools/scripts/` directory to quickly set up a local testing environment:
- `contracts.sh`: This script compiles Webb smart contracts from [protocol-solidity](https://github.com/webb-tools/protocol-solidity), sets up an EVM localnet (e.g. Hermes, Athena, and Demeter), and populates required fixtures. You can use this script on its own.
- `relayer.sh`: This script sets up the required `.env` variables for running a [Webb relayer](https://github.com/webb-tools/relayer) for the EVM localnets, fetches the `webb-relayer` binary, and executes it. You must have an EVM localnet running to use this script.
- `bridge.sh`: This script sets up and starts the Hubble bridge at `localhost:3000`. You can use this script on its own.
- `local-bridge-network.sh`: This script runs all the above scripts for an entire local network setup. It compiles the Webb smart contracts, sets up the EVM localnet, adds the required `.env` variables, fetches the `webb-relayer` binary, executes it, and starts the local Hubble bridge at `localhost:3000`. It opens three Terminal windows and can only be run in a macOS environment.
We now have our local environment running, next we will want to setup our MetaMask wallet to add test tokens and **reset the account** on Metamask to reset the account’s nonce and tx history. Please refer to the support article [here](https://metamask.zendesk.com/hc/en-us/articles/360015488891-How-to-reset-an-account) for instructions on how to reset a MetaMask account.
Lastly, we will want to one of the following accounts to obtain test tokens.
```
// Any of these keys has 1000 ETH on each testnet
0x0000000000000000000000000000000000000000000000000000000000000001
0x0000000000000000000000000000000000000000000000000000000000000002
0xc0d375903fd6f6ad3edafc2c5428900c0757ce1da10e5dd864fe387b32b91d7e
```
If you are unfamiliar with how to import an account with MetaMask, please refer to the support article [here](https://metamask.zendesk.com/hc/en-us/articles/360015489331-How-to-import-an-account#:~:text=Click%20the%20circle%20icon%20at,key%20and%20click%20%E2%80%9CImport%E2%80%9D).
## Run stats-dapp locally 💻
Once the development environment is set up, you may proceed to install the required dependencies and run the dapp locally.
1. Clone this repo
```bash
git clone [email protected]:webb-tools/webb-dapp.git && cd webb-dapp
```
<div align="right"><a href="#table-of-contents">↑ Back to top ↑</a></div>

2. Install dependencies by `yarn`
```bash
yarn install
```
3. Start the stats-dapp:
```bash
yarn start:stats
```
Visit `http://localhost:3000/` to see the Webb Stats UI! 🕸️ 🚀 If you would like to setup a local SubQuery backend please refer to the instructions [here](https://github.com/webb-tools/webb-subql#webb-subquery).
<h2 id="test"> Testing 🧪 </h2>
<h2 id="test"> Testing </h2>

The following instructions outlines how to run Webb Dapp test suite.

Expand All @@ -147,15 +101,17 @@ yarn test
yarn nx storybook webb-ui-components
```

Visit `http://localhost:4400/` to see the Webb Component Library! 🕸️ 🚀
Visit `http://localhost:4400/` to see the Webb Component Library!

<div align="right"><a href="#table-of-contents">↑ Back to top ↑</a></div>

<h2 id="contribute"> Contributing </h2>

Interested in contributing to the Webb Dapp interface? Thank you so much for your interest! We are always appreciative for contributions from the open-source community!

If you have a contribution in mind, please check out our [Contribution Guide](./.github/CONTRIBUTING.md) for information on how to do so. We are excited for your first contribution!
If you would like to contribute, please refer to our [Contribution Guide](./.github/CONTRIBUTING.md) for instructions. We are excited for your first contribution!

### Lint before you push! 🪥
### Lint before you push!

Please ensure you lint and format your changes prior to opening a PR.

Expand All @@ -177,8 +133,43 @@ yarn format
yarn build
```
<div align="right"><a href="#table-of-contents">↑ Back to top ↑</a></div>
<h2 id="license"> License </h2>
Licensed under <a href="LICENSE">Apache 2.0 license</a>.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache 2.0 license, shall be licensed as above, without any additional terms or conditions.
<div align="right"><a href="#table-of-contents">↑ Back to top ↑</a></div>
<h2 id="help"> Need help? </h2>
If you need help or you want to additional information please:
- Refer to the [Webb Official Documentation](https://docs.webb.tools/).
- If you have feedback on how to improve the Webb Dapp interface or you have a specific question? Check out the [Webb Dapp Feedback Discussion](https://github.com/webb-tools/feedback/discussions/categories/webb-dapp-feedback).
- If you found a bug please [open an issue](https://github.com/webb-tools/webb-dapp/issues/new/choose) or [join our Discord](https://discord.gg/jUDeFpggrR) server to report it.
---
**Follow us at**
[![Follow us on twitter](https://img.shields.io/twitter/follow/webbprotocol.svg?style=social)](https://twitter.com/intent/follow?screen_name=webbprotocol)
[![Follow us on LinkedIn](https://img.shields.io/badge/LinkedIn-webbprotocol-blue?style=flat&logo=linkedin&logoColor=b0c0c0&labelColor=363D44)](https://www.linkedin.com/company/webb-protocol/)
---
**Share** the project link with your network on social media.
<a href="https://www.linkedin.com/shareArticle?mini=true&url=https%3A//github.com/webb-tools/webb-dapp" target="_blank">
<img src="https://img.shields.io/twitter/url?label=LinkedIn&logo=LinkedIn&style=social&url=https%3A%2F%2Fgithub.com%2Fwebb-tools%2Fwebb-dapp" alt="Share on LinkedIn"/>
</a>
<a href="https://twitter.com/intent/tweet?text=%F0%9F%9A%80%20Explore%20%60webb-tools/webb-dapp%60%20Monorepo%20on%20Github%3A%20your%20%23zeroKnowledgeApp%20in%20%23blockchain.%20Secure%2c%20efficient%20%23crypto%20interactions%20await!%0A%0ADive%20in%20%E2%9E%A1%EF%B8%8F%20https%3A//github.com/webb-tools/webb-dapp%20%23webbEcosystem" target="_blank">
<img src="https://img.shields.io/twitter/url?label=Twitter&logo=Twitter&style=social&url=https%3A%2F%2Fgithub.com%2Fwebb-tools%2Fwebb-dapp" alt="Shared on Twitter"/>
</a>
<a href="https://t.me/share/url?text=%F0%9F%9A%80%20Explore%20%60webb-tools/webb-dapp%60%20Monorepo%20on%20Github%3A%20your%20%23zeroKnowledgeApp%20in%20%23blockchain.%20Secure%2c%20efficient%20%23crypto%20interactions%20await!%0A%0ADive%20in%20%E2%9E%A1%EF%B8%8F%20https%3A//github.com/webb-tools/webb-dapp%20%23webbEcosystem&url=https%3A%2F%2Fgithub.com%2Fwebb-tools%2Fwebb-dapp" target="_blank">
<img src="https://img.shields.io/twitter/url?label=Telegram&logo=Telegram&style=social&url=https%3A%2F%2Fgithub.com%2Fawebb-tools%webb-dapp" alt="Share on Telegram"/>
</a>
<div align="right"><a href="#table-of-contents">↑ Back to top ↑</a></div>
18 changes: 13 additions & 5 deletions apps/bridge-dapp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@
# Webb Hubble Bridge

<p align="left">
<strong>🔭 Private cross-chain bridge for digital assets 🚀</strong>
<strong> Private cross-chain bridge for digital assets </strong>
<br />
</p>

## Run Hubble Bridge 💻
## Run Hubble Bridge

Once the development environment is set up, you may proceed to install the required dependencies and run the dapp locally.

1. Clone this repo

```bash
git clone [email protected]:webb-tools/webb-dapp.git && cd webb-dapp
git clone [email protected]:webb-tools/webb-dapp.git
```

2. Install dependencies by `yarn`
Expand All @@ -36,7 +36,7 @@ Once the development environment is set up, you may proceed to install the requi
yarn start:bridge
```

Visit `http://localhost:3000/` to see the Webb Bridge Dapp UI! 🕸️ 🚀
Visit `http://localhost:3000/` to see the Webb Bridge Dapp UI!

### Run local Webb relayer and local network alongside Hubble bridge

Expand Down Expand Up @@ -190,4 +190,12 @@ You have now successfully setup:
- local Hubble bridge
- configured your MetaMask wallet for testing / development

Happy hacking! 🚀💻
Happy hacking!

<h2 id="help"> Need help? </h2>

If you need help or you want to additional information please:

- Refer to the [Webb Official Documentation](https://docs.webb.tools/).
- If you have feedback on how to improve the Webb Dapp interface or you have a specific question? Check out the [Webb Dapp Feedback Discussion](https://github.com/webb-tools/feedback/discussions/categories/webb-dapp-feedback).
- If you found a bug please [open an issue](https://github.com/webb-tools/webb-dapp/issues/new/choose) or [join our Discord](https://discord.gg/jUDeFpggrR) server to report it.
7 changes: 5 additions & 2 deletions apps/bridge-dapp/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { AppEvent, WebbProvider } from '@webb-tools/api-provider-environment';
import { RouterProvider } from '@webb-tools/react-environment';
import {
AppEvent,
RouterProvider,
WebbProvider,
} from '@webb-tools/api-provider-environment';
import { FC } from 'react';

import { WebbUIProvider } from '@webb-tools/webb-ui-components';
Expand Down
2 changes: 1 addition & 1 deletion apps/bridge-dapp/src/routes/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { RouterConfigData } from '@webb-tools/api-provider-environment';
import { BareProps } from '@webb-tools/dapp-types';
import { Spinner } from '@webb-tools/icons';
import { RouterConfigData } from '@webb-tools/react-environment';
import { FC, lazy, Suspense } from 'react';
import { Layout } from '../containers';

Expand Down
4 changes: 2 additions & 2 deletions apps/faucet/.env.local.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NEXT_PUBLIC_AMOUNT="10"
NEXT_PUBLIC_FAUCET_BACKEND_URL="http://127.0.0.1:8000"
NEXT_PUBLIC_AMOUNT="20"
NEXT_PUBLIC_FAUCET_BACKEND_URL="https://faucet-backend.webb.tools"
NEXT_PUBLIC_TWITTER_CLIENT_ID="<YOUR_TWITTER_CLIENT_ID>"
TWITTER_CLIENT_SECRET="<YOUR_TWITTER_CLIENT_SECRET>"
67 changes: 67 additions & 0 deletions apps/faucet/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<div align="center">
<a href="https://www.webb.tools/">

![Webb Logo](../../.github/assets/webb_banner_light.png#gh-light-mode-only)
![Webb Logo](../../.github/assets/webb_banner_dark.png#gh-dark-mode-only)
</a>

</div>

# Webb Faucet

<p align="left">
<strong>Funding cryptocurrencies (assets) on the Webb Protocol System.</strong>
<br />
</p>

## Run the Faucet

After setting up the development environment, you can proceed to run the faucet dapp locally by installing the required dependencies, copying the environment variables and running the faucet.

1. Clone this repo

```bash
git clone [email protected]:webb-tools/webb-dapp.git
```

2. Install dependencies by `yarn`

```bash
yarn install
```

3. Prepare the Twitter Application for Development

To run the faucet app locally, you need to create a new Twitter Application for development purposes. You can find the instructions for doing so [here](https://developer.twitter.com/en/docs/twitter-api/getting-started/getting-access-to-the-twitter-api).

**Notes**:

- For 'App permissions', select 'Read' permissions.
- For 'Type of App', select 'Native App'.
- For 'App info', fill in the 'Website URL' and 'Callback URLs' fields. Set the 'Callback URLs' field to `http://127.0.0.1:4200` and `http://localhost:4200`.
Next, initialize the environment variables by running the following command:
```bash
cp .env.example .env && cp apps/faucet/.env.local.example apps/faucet/.env.local
```
Replace the placeholder values for `NEXT_PUBLIC_TWITTER_CLIENT_ID` and `TWITTER_CLIENT_SECRET` with your Twitter Client ID and Twitter Client Secret, respectively. You can find these values in your created Twitter Application on the developer portal. Read more about this process [here](https://developer.twitter.com/en/docs/authentication/oauth-1-0a/api-key-and-secret).
Visit `http://localhost:4200/` to see the Webb Faucet UI!
## Run with the Faucet backend
To use the faucet backend, follow the instructions here to set it up.
Then, update the `NEXT_PUBLIC_FAUCET_BACKEND_URL` in the `apps/faucet/.env.local` file to point to the locally running faucet backend.
Happy hacking!
<h2 id="help"> Need help? </h2>
If you need help or you want to additional information please:
- Refer to the [Webb Official Documentation](https://docs.webb.tools/).
- If you have feedback on how to improve the Webb Dapp interface or you have a specific question? Check out the [Webb Dapp Feedback Discussion](https://github.com/webb-tools/feedback/discussions/categories/webb-dapp-feedback).
- If you found a bug please [open an issue](https://github.com/webb-tools/webb-dapp/issues/new/choose) or [join our Discord](https://discord.gg/jUDeFpggrR) server to report it.
Loading

0 comments on commit 6c000a5

Please sign in to comment.