Skip to content

radixdlt/dapps-monorepo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1,507 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Radix dApps Monorepo πŸ‘‹

Prerequisites

You need to have the following tools installed to run the local development server:

Getting started

Fastest way to getting a dev server running on your local machine is to run the following bash script in your terminal from the repo top directory.

./dev-setup.sh

Running scripts

dApps monorepo is built on Turbo repo for faster npm script execution through caching and parallelization.

Run npm scripts from the repo top directory

Install all dependencies

npm install

Start development servers

npm run dev

Linting, testing, pre-compiling

npm run pre-push

Test

npm run test

dApps

Dashboard

Mainnet β€’ Stokenet β€’ Development

Search for addresses and transactions on the Radix Network. Participate in Radix Network staking using XRD tokens.

Console

Mainnet β€’ Stokenet β€’ Development

A collection of utility pages to help you during development of your own dApps.

Sandbox

Mainnet β€’ Stokenet β€’ Development

A configurable dApp frontend simulator to let you experiment with Radix Wallet logins and requests for data. Development environment contains additional pages which can be used to play around with various wallet and network features.

Packages

common

Wrapper package for dependencies reused in different dApps. It contains dependencies that almost every Radix-based project needs like RDT, Gateway SDK, Core SDK, Rola, RET.

ui

Set of svelte components reused between Dev Console and Dashboard apps. Contains main dApp layout - header, side menu and other smaller components.

eslint-config-custom

Custom ESLint configuration used by other packages and apps.

Deployment

Each app is a SvelteKit application. The default adapter is @sveltejs/adapter-node, which produces a standalone Node.js server. But, you can easily deploy to a serverless environment like Vercel, instructions are included below.

Environment variables

The apps use the following environment variables (set via .env files or your platform's environment configuration):

Variable Description
PUBLIC_NETWORK_NAME Radix network to target (e.g. mainnet, stokenet)
PUBLIC_DAPP_DEFINITION_ADDRESS dApp definition address (optional, overrides the default for the selected network)
PUBLIC_AMPLITUDE_API_KEY Amplitude analytics key (optional)
PUBLIC_APP_ENV App environment identifier (e.g. production, development)

dApp Definition

Each deployed instance of Console or Dashboard needs a dApp definition on the Radix Network. To set one up:

  1. Follow the dApp Definition Setup Guide to create a dApp definition account on the network you are targeting.
  2. Set the PUBLIC_DAPP_DEFINITION_ADDRESS environment variable to the address of the account you created.

If left empty, the apps will fall back to the default addresses defined in packages/ui/src/constants.ts, which do not point to your front-end and will cause errors.

Node.js (default)

Build and run an individual app:

npm install
npx turbo run build --filter=dashboard
node apps/dashboard/build

Replace dashboard with console or sandbox as needed.

The build output is written to apps/<app>/build/ by default. The Node.js server listens on port 3000 (configurable via the PORT environment variable).

Serverless (Vercel)

To deploy on Vercel, you need to switch SvelteKit from the Node adapter to the Vercel adapter:

  1. In packages/ui/svelte.config.js, change the import from @sveltejs/adapter-node to @sveltejs/adapter-vercel, and change adapter: adapter({ out: 'build' }) to adapter: adapter().

  2. In the devDependencies of each app's package.json (apps/console/package.json, apps/dashboard/package.json) and packages/ui/package.json, replace "@sveltejs/adapter-auto" with "@sveltejs/adapter-vercel": "^5".

  3. Deploy on Vercel (repeat for each app you want to deploy):

    1. Go to vercel.com and open your dashboard.
    2. Click Add New β†’ Project.
    3. Select this repository (fork/clone it to your GitHub account first if needed). Vercel should automatically detect it as a Turborepo monorepo.
    4. Under Root Directory, change it to the app you want to deploy (e.g. apps/dashboard, apps/console, or apps/sandbox).
    5. Configure the environment variables listed above under Environment Variables.
    6. Click Deploy.

    You need to create a separate Vercel project for each app you want to deploy.

License

About

The Dashboard dApp, which is home to to a network explorer and a staking interface.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors