This directory contains the source code and tooling for the front-end for the Astria bridge.
public/index.html- html meta stuff, import styles and fonts
- define React root element
src/index.tsx- React application setup
- import styles
src/App.tsx- main application component
- define routes
- use context providers
src/components- More general React components for the app, e.g. Navbar, Dropdown, CopyToClipboardButton, etcsrc/config- Configuration for the web appsrc/config/chainConfigs- Celestia and Astria chain informationsrc/config/contexts- Config context and context providersrc/config/hooks- Custom hook to make config easy to usesrc/config/env.ts- Environment variable definitions plus utilities for consuming themsrc/config/index.ts- AppConfig and exports
src/features- Organizes components, contexts, hooks, services, types, and utils for different featuressrc/features/EthWallet- Used for interacting with EVM walletssrc/features/KeplrWallet- User for interacting with Keplr walletsrc/features/Notifications- Used for displaying notifications and toasts
src/pages- React components for each page
src/pages/Layout.tsx- page layout component using
<Outlet /> - contains
<Navbar />,<Notification />
- page layout component using
src/styles- all style definitions
- using scss
- using bulma css framework
# install npm deps and run web app locally
just web init-env
just web install
just web run
# build web app static files
just web build- How to add new chain configs for a new environment (e.g. you want to add new
chain configs for "mainnet")
-
create file that will contain the config values
touch web/src/config/chainConfigs/ChainConfigsMainnet.ts
-
import new configs in
astria-bridge-web-app/web/src/config/chainConfigs/index.ts, while renaming themimport { evmChains as mainnetEvmChains, ibcChains as mainnetIbcChains, } from "./ChainConfigsMainnet";
-
add entry to
EVM_CHAIN_CONFIGSconst ENV_CHAIN_CONFIGS = { local: { evm: localEvmChains, ibc: localIbcChains }, dusk: { evm: duskEvmChains, ibc: duskIbcChains }, dawn: { evm: dawnEvmChains, ibc: dawnIbcChains }, mainnet: { evm: mainnetEvmChains, ibc: mainnetIbcChains }, } as const;
-