Giter Site home page Giter Site logo

camfairchild / explorer-ui Goto Github PK

View Code? Open in Web Editor NEW

This project forked from polkascan/explorer-ui

0.0 0.0 1.0 2.22 MB

Polkascan Explorer UI

License: GNU General Public License v3.0

JavaScript 0.70% TypeScript 70.30% HTML 21.79% Dockerfile 0.47% SCSS 6.74%

explorer-ui's Introduction

Explorer UI

Explorer UI is a client-sided Angular based application that utilizes PolkADAPT and its Adapters to obtain data from multiple data sources. Its design is based on flat Material component design, styled in Polkascan branding.

Clone with submodules!

Use the following command to clone this repository and polkadapt submodule:

git clone --recurse-submodules <repository_url>

If you already cloned this repository, but without submodules, then you still need to initialize the submodules:

git submodule init
git submodule update

You need the submodule to build and run this application.

Configuration file

You will need to add a file named config.json in src/assets/. This file contains configuration per network for the used PolkADAPT adapters.

The order in which the networks are shown in the UI is also based on this configuration. It is advised to add multiple endpoints for fallback and custom switching capabilities.

{
  "polkadot": {
    "substrateRpcUrlArray": ["wss://rpc.polkadot.io"],
    "explorerWsUrlArray": ["wss://mycustomnode.io/polkadot"]
  },
  "kusama": {
    "substrateRpcUrlArray": ["wss://kusama-rpc.polkadot.io", "wss://other-kusama-node.io"],
    "explorerWsUrlArray": ["wss://mycustomnode.io/kusama"]
  }
}

Build and run with Docker

If you want a quick and easy way to run the application, you can build a Docker image with the included Dockerfile. In a shell, from this project's directory, run the following command to build the Docker image:

docker build -t explorer-ui .

To run the image and start a local webserver with the application:

docker run --rm -p 8000:80 explorer-ui

You can now open your web browser and navigate to http://localhost:8000/ to visit the application.

You can also use the hosted Docker image at Docker Hub, you only need to map a volume to overwrite the config.json in the container:

docker run --rm -it -p 80:80 -v /path/to/your/src/assets/config.json:/usr/share/nginx/html/assets/config.json polkascan/explorer-ui

Build manually

These are the instructions for a manual build. It is advised to use the latest Node LTS. Or at least the node version asked by Angular or Polkadot JS:

You need to install and build polkadapt before you install and build the application:

cd polkadapt
npm i
npm run build
cd ..
npm i
npm run build

The build artifacts will be stored in the dist/ directory.

Development server

For a dev server, open a terminal and run:

cd polkadapt
npm i
npm run build

When making changes in polkadapt source files you have to build again.

Now open a second terminal and run:

npm i
npm run start

Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

explorer-ui's People

Contributors

arjanz avatar camfairchild avatar kriekkop avatar wouterter avatar

Forkers

opentensor

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.