https://github.com/avaprotocol/xcm-demo-app
Web app for Mangata DEX auto-compound demo
https://github.com/avaprotocol/xcm-demo-app
Last synced: 8 months ago
JSON representation
Web app for Mangata DEX auto-compound demo
- Host: GitHub
- URL: https://github.com/avaprotocol/xcm-demo-app
- Owner: AvaProtocol
- Created: 2022-11-21T04:10:39.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-11-24T23:11:22.000Z (over 3 years ago)
- Last Synced: 2024-12-27T17:31:50.669Z (over 1 year ago)
- Language: JavaScript
- Size: 9.99 MB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# XCM Demo Web App
## Development
### Pre-requisite: Configure Fontawesome Pro
The icons we use this repo are through paid subscription, so a secret needs to be set before package installation.
**Option 1: NPM Global Set up**
Globally set fontawesome secret in npm, so it works in any project.
```
`npm config set "@fortawesome:registry" https://npm.fontawesome.com/`
`npm config set "//npm.fontawesome.com/:_authToken" 56D593CA-ADCD-46AC-99D9-8762640B6BD9`
```
**Option 2: Set in this project**
If you’d prefer a per-project setting, create a `.npmrc` file in the root of the project (where you have your package.json file).
```
@fortawesome:registry=https://npm.fontawesome.com/
//npm.fontawesome.com/:_authToken=
```
### Install dependencies
Run `yarn`
### Start up the program
Run `yarn dev` for local dev run, and a browser tab of `http://localhost:3005/` should pop up.
### Code Formatting with ESLint
`yarn run eslint filename.js`
## Configuration
Please create the following configuration files in the project directory and refer to the `.env` file for configuration.
The default values of variables set in `.env` will be overridden by variables in the following files or environment variables set externally.
1. `.env`
It is the default configuration file, and running `yarn run dev` will read it.
2. `.env.product`.
It is read when `yarn run export` is run.
By default environment variables are only available in the Node.js environment, meaning they won't be exposed to the browser.
In order to expose a variable to the browser you have to prefix the variable with `NEXT_PUBLIC_`.
**Note: In some static resources servers (such as Amazon S3), next.js cannot correctly route the access path to the corresponding page. So we need to set `ASSET_PREFIX` in order to generate the directory corresponding to the page.**
## Deployment
In order to create correct subpath URL so users could visit https://oak.tech/team directly, we need to specify the target domain name as `prefix` in `./next.config.js`. The static files in `./out` folder is generated by separate yarn commands for `staging` and `production` environments.
1. For `production` environment, run `yarn export` to generate static files in `./out` folder.
2. For deployment to custom domain, run `./node_modules/dotenv-cli/cli.js -e -- bash -c yarn export`.