Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/pwa #520

Draft
wants to merge 23 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 61 additions & 59 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,59 +1,61 @@
# polkaswap-exchange-web

## Project deploy info
There is `public/env.json` file which contains `BASE_API_URL` and `DEFAULT_NETWORKS` variables.

`BASE_API_URL` will be used for the address of the current stand.

`DEFAULT_NETWORKS` variable has the following format:

```
"DEFAULT_NETWORKS": [
{
"chain": "SORA-staging Testnet",
"name": "SORA",
"address": "wss://ws.stage.sora2.soramitsu.co.jp"
}
]
```

`"chain"` is used as the chain name.
`"name"` is used as the node name.
`"address"` is used for the address of the node to which the frontend project will be connected.

`DEFAULT_NETWORKS[0]` must be a Soramitsu trusted node. App used it's `genesisHash` to check custom user node for connection

`CHAIN_GENESIS_HASH` should be defined for 'prod' & 'stage' environments, to not polling nodes for getting it (because genesis hash for these env's not changing).

## Project setup
```
yarn install
```

### Compiles and hot-reloads for development
```
yarn serve
```

### Compiles and minifies for production
```
yarn build
```

### Run your unit tests
```
yarn test:unit
```

### Run your end-to-end tests
```
yarn test:e2e
```

### Lints and fixes files
```
yarn lint
```

### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
# polkaswap-exchange-web

## Project deploy info
There is `public/env.json` file which contains `BASE_API_URL` and `DEFAULT_NETWORKS` variables.

`BASE_API_URL` will be used for the address of the current stand.

`DEFAULT_NETWORKS` variable has the following format:

```
"DEFAULT_NETWORKS": [
{
"chain": "SORA-staging Testnet",
"name": "SORA",
"address": "wss://ws.stage.sora2.soramitsu.co.jp"
}
]
```

`"chain"` is used as the chain name.
`"name"` is used as the node name.
`"address"` is used for the address of the node to which the frontend project will be connected.

`DEFAULT_NETWORKS[0]` must be a Soramitsu trusted node. App used it's `genesisHash` to check custom user node for connection

`CHAIN_GENESIS_HASH` should be defined for 'prod' & 'stage' environments, to not polling nodes for getting it (because genesis hash for these env's not changing).

`NETWORK_RUNTIME_VERSION` this is the `specVersion` of substrate network with which the application is compatible. If the connected network has a version less than specified in this parameter, the maintenance page will be shown

## Project setup
```
yarn install
```

### Compiles and hot-reloads for development
```
yarn serve
```

### Compiles and minifies for production
```
yarn build
```

### Run your unit tests
```
yarn test:unit
```

### Run your end-to-end tests
```
yarn test:e2e
```

### Lints and fixes files
```
yarn lint
```

### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"build": "vue-cli-service build",
"test:unit": "vue-cli-service test:unit --silent",
"test:e2e": "vue-cli-service test:e2e",
"test:all": "yarn test:unit",
"lint": "vue-cli-service lint",
"generate-lang-json": "ts-node ./scripts/generateLocaleJson.ts"
"generate-lang-json": "ts-node ./scripts/generateLocaleJson.ts",
"test:all": "yarn test:unit"
},
"dependencies": {
"@metamask/detect-provider": "^1.2.0",
Expand All @@ -20,6 +20,7 @@
"core-js": "^3.6.4",
"ethers": "^5.3.1",
"lodash": "^4.17.21",
"register-service-worker": "^1.7.2",
"vue": "^2.6.14",
"vue-class-component": "^7.2.6",
"vue-i18n": "^8.11.2",
Expand All @@ -39,6 +40,7 @@
"@vue/cli-plugin-babel": "^5.0.0-beta.4",
"@vue/cli-plugin-e2e-cypress": "^5.0.0-beta.4",
"@vue/cli-plugin-eslint": "^5.0.0-beta.4",
"@vue/cli-plugin-pwa": "^5.0.0-rc.0",
"@vue/cli-plugin-router": "^5.0.0-beta.4",
"@vue/cli-plugin-typescript": "^5.0.0-beta.4",
"@vue/cli-plugin-unit-jest": "^5.0.0-beta.4",
Expand Down Expand Up @@ -72,6 +74,7 @@
"gitHooks": {
"pre-commit": "lint-staged"
},
"license": "Apache-2.0",
"lint-staged": {
"*.{js,jsx,vue,ts,tsx}": [
"vue-cli-service lint",
Expand Down
1 change: 1 addition & 0 deletions public/env.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
}
],
"NETWORK_TYPE": "Dev",
"NETWORK_RUNTIME_VERSION": 20,
"CHAIN_GENESIS_HASH": "",
"SUB_NETWORKS": [
{
Expand Down
Binary file added public/img/icons/android-icon-144x144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/icons/android-icon-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/icons/android-icon-36x36.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/icons/android-icon-48x48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/icons/android-icon-72x72.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/icons/android-icon-96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/icons/apple-touch-icon-120x120.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/icons/apple-touch-icon-152x152.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/icons/apple-touch-icon-180x180.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/icons/apple-touch-icon-60x60.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/icons/apple-touch-icon-76x76.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/icons/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/icons/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/icons/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions public/img/icons/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/icons/msapplication-icon-144x144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/icons/mstile-150x150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
102 changes: 51 additions & 51 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
<!DOCTYPE html>
<html lang="en">
<head>
<script>
if ('<%= NODE_ENV %>' !== 'development') {
const https = 'https:'
if (window.location.protocol !== https) {
window.location.protocol = https
}
}
const pathname = window.location.pathname
if (pathname !== '/' && pathname.slice(-1) !== '/') {
const paths = pathname.split('/')
paths.pop()
paths.push('')
window.location.pathname = paths.join('/')
}
</script>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>Polkaswap — The DEX for the Interoperable Future.</title>
<meta name="title" property="title" content="Polkaswap — The DEX for the Interoperable Future." />
<meta name="description" property="description" content="Cross-chain exchange of assets, simple creation and listing of new assets, and the easiest swaps ever. The interoperable future of Polkadot is here and we are at the forefront!">
<meta name="keywords" property="keywords" content="Polkaswap, DEX, Cross-chain, DeFi, AMM, Polkadot, Ecosystem, Interoperable, Future, SORA, SORA network, Kusama">
<meta name="author" property="author" content="SORA">
<meta name="twitter:title" content="Polkaswap — The DEX for the Interoperable Future." />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:image" content="<%= BASE_URL %>polkaswap-share-image.jpg" />
<meta name="twitter:site" content="@polkaswap" />
<meta name="twitter:description" content="Cross-chain exchange of assets, simple creation and listing of new assets, and the easiest swaps ever. The interoperable future of Polkadot is here and we are at the forefront!" />
<meta property="og:title" content="Polkaswap — The DEX for the Interoperable Future.">
<meta property="og:description" content="Cross-chain exchange of assets, simple creation and listing of new assets, and the easiest swaps ever. The interoperable future of Polkadot is here and we are at the forefront!" />
<meta property="og:site_name" content="Polkaswap" />
<meta property="og:type" content="website">
<meta property="og:url" content="https://polkaswap.io/">
<meta property="og:image" content="<%= BASE_URL %>polkaswap-share-image.jpg">
<meta property="og:image:secure_url" content="<%= BASE_URL %>polkaswap-share-image.jpg" />
<meta property="og:image:width" content="1280" />
<meta property="og:image:height" content="630" />
</head>
<body>
<noscript>
<strong>We're sorry but Polkaswap doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<script>
if ('<%= NODE_ENV %>' !== 'development') {
const https = 'https:'
if (window.location.protocol !== https) {
window.location.protocol = https
}
}
const pathname = window.location.pathname
if (pathname !== '/' && pathname.slice(-1) !== '/') {
const paths = pathname.split('/')
paths.pop()
paths.push('')
window.location.pathname = paths.join('/')
}
</script>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>Polkaswap — The DEX for the Interoperable Future.</title>
<meta name="title" property="title" content="Polkaswap — The DEX for the Interoperable Future." />
<meta name="description" property="description" content="Cross-chain exchange of assets, simple creation and listing of new assets, and the easiest swaps ever. The interoperable future of Polkadot is here and we are at the forefront!">
<meta name="keywords" property="keywords" content="Polkaswap, DEX, Cross-chain, DeFi, AMM, Polkadot, Ecosystem, Interoperable, Future, SORA, SORA network, Kusama">
<meta name="author" property="author" content="SORA">
<meta name="twitter:title" content="Polkaswap — The DEX for the Interoperable Future." />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:image" content="<%= BASE_URL %>polkaswap-share-image.jpg" />
<meta name="twitter:site" content="@polkaswap" />
<meta name="twitter:description" content="Cross-chain exchange of assets, simple creation and listing of new assets, and the easiest swaps ever. The interoperable future of Polkadot is here and we are at the forefront!" />
<meta property="og:title" content="Polkaswap — The DEX for the Interoperable Future.">
<meta property="og:description" content="Cross-chain exchange of assets, simple creation and listing of new assets, and the easiest swaps ever. The interoperable future of Polkadot is here and we are at the forefront!" />
<meta property="og:site_name" content="Polkaswap" />
<meta property="og:type" content="website">
<meta property="og:url" content="https://polkaswap.io/">
<meta property="og:image" content="<%= BASE_URL %>polkaswap-share-image.jpg">
<meta property="og:image:secure_url" content="<%= BASE_URL %>polkaswap-share-image.jpg" />
<meta property="og:image:width" content="1280" />
<meta property="og:image:height" content="630" />
</head>
<body>
<noscript>
<strong>We're sorry but Polkaswap doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
2 changes: 2 additions & 0 deletions public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User-agent: *
Disallow:
Loading