Go to file
Linkie Link 3f28ccd09c
feat: handle URLs with or without trailing slash (#803)
* feat: handle URLs with or without trailing slash

* tidy: cleanup slashes
2024-02-14 09:26:10 +01:00
.github update docker CI to node 20 (#797) 2024-02-13 13:54:00 +01:00
.vscode Upgrade next (#100) 2023-02-24 09:47:27 +01:00
public List milkTIA (#757) 2024-01-31 14:37:31 +01:00
src feat: handle URLs with or without trailing slash (#803) 2024-02-14 09:26:10 +01:00
.dockerignore v2.2.2 OS (#794) 2024-02-13 11:33:13 +01:00
.env v2.2.2 OS (#794) 2024-02-13 11:33:13 +01:00
.env.example feat: handle URLs with or without trailing slash (#803) 2024-02-14 09:26:10 +01:00
.env.production v2.2.2 OS (#794) 2024-02-13 11:33:13 +01:00
.eslintignore [task] add LTV to vault tables (#381) 2023-08-21 14:02:32 +03:00
.eslintrc.json feat: refactored the toast responses (#442) 2023-09-11 10:35:13 +02:00
.gitignore v2.2.2 OS (#794) 2024-02-13 11:33:13 +01:00
.prettierignore v2.0.1 (#579) 2023-10-24 16:41:40 +02:00
.prettierrc feat: refactored the toast responses (#442) 2023-09-11 10:35:13 +02:00
Dockerfile Docker CI update (#802) 2024-02-13 21:17:57 +01:00
entrypoint.sh v2.2.2 OS (#794) 2024-02-13 11:33:13 +01:00
generate_types.sh Withdraw assets from account (#43) 2022-11-07 16:36:12 +00:00
install_charting_library.js v2.2.2 OS (#794) 2024-02-13 11:33:13 +01:00
install_charting_library.sh v2.2.2 OS (#794) 2024-02-13 11:33:13 +01:00
install_dummy_charting_library.sh v2.2.2 OS (#794) 2024-02-13 11:33:13 +01:00
LICENSE v2.2.2 OS (#794) 2024-02-13 11:33:13 +01:00
next-config.patch Docker CI update (#802) 2024-02-13 21:17:57 +01:00
next.config.js v2.2.2 OS (#794) 2024-02-13 11:33:13 +01:00
package.json Main update (#801) 2024-02-13 17:30:04 +01:00
postcss.config.js initial setup wip 2022-09-02 15:30:58 +01:00
README.md feat: handle URLs with or without trailing slash (#803) 2024-02-14 09:26:10 +01:00
sentry.client.config.js WIP (#12) 2022-09-29 20:21:31 +01:00
sentry.properties sentry setup 2022-09-02 22:29:22 +01:00
sentry.server.config.js WIP (#12) 2022-09-29 20:21:31 +01:00
tailwind.config.js Morph summary (#763) 2024-02-06 10:05:42 +01:00
tsconfig.json Websocket implementation (#726) 2024-01-12 09:07:55 +01:00
vercel.json Env update (#113) 2023-03-09 10:26:16 +01:00
yarn.lock Main update (#801) 2024-02-13 17:30:04 +01:00

Mars Protocol v2 Outpost Frontend

mars-banner-1200w

1. Web App

This project is a NextJS. React application.

The project utilises React hooks, functional components, Zustand for state management, and useSWR for general data fetching and management.

Styles are handled with Tailwind.

Typescript is added and utilised (but optional if you want to create .jsx or .tsx files).

2. Deployment

Start web server

yarn && yarn dev

2.1 Custom node endpoints using Docker

We allow the use of environment variables to be passed to the Docker container to specify custom endpoints for the app. The variables are:

Variable Description Default
URL_OSMOSIS_REST The Osmosis node REST endpoint to use https://lcd-osmosis.blockapsis.com
URL_OSMOSIS_RPC The Osmosis node RPC endpoint to use https://rpc-osmosis.blockapsis.com
WALLET_CONNECT_ID Your projects WalletConnect v2 ID 0x0x0x0x0x0x0x0x0x0x0x0x0x0x0x0x0x0x0x0x

Sample Docker run command

This command will start the container in interactive mode with port 3000 bound to localhost and print logs to stdout.

docker run -it -p 3000:3000 \
      -e URL_OSMOSIS_REST=https://lcd-osmosis.blockapsis.com \
      -e URL_OSMOSIS_RPC=https://rpc-osmosis.blockapsis.com \
      -e WALLET_CONNECT_ID=0x0x0x0x0x0x0x0x0x0x0x0x0x0x0x0x0x0x0x0x marsprotocol/interface:latest

2.2 Custom node endpoints using non-Docker deployments

Copy .env.example to .env and modify the values to suit your needs.

2.2.1 TradingView library

The Outpost UI has a TradingView implementation, to display charts for the listed assets.

TradingView only works on non-docker deployments (e.g. via vercel). As the docker image already has a fallback installed and can not be updated on docker run

If you are running the UI on a node based server, add the following environment variables to install TradingView.

CHARTING_LIBRARY_USERNAME=YOUR_GIT_USERNAME
CHARTING_LIBRARY_ACCESS_TOKEN=YOUR_TRADING_VIEW_ACCESS_TOKEN
CHARTING_LIBRARY_REPOSITORY=github.com/tradingview/charting_library/

NOTE: You'll also need to have an active TradingView license to obtain those credentials

4. Development practices

4.1 Data orchestration

Data is handled with a combination of container components, useSWR and a caching mechanism. API hooks are responsible for syncing the application state.

5. Contributing

We welcome and encourage contributions! Please create a pull request with as much information about the work you did and what your motivation/intention was.

6. License

Contents of this repository are open source under the Mars Protocol Web Application License Agreement.