Skip to content

nymtech/bity-interface

Repository files navigation

Nym Exchange Interface

Web exchange interface built with Bity API. The server side is built with axum.

Install

First provide the required environment variables. For convenience you can copy over the content of .env.sample into a new .env file.

Then you need to provide Bity configuration. For convenience you can copy over the content of bity_config.sample.json into a new bity_config.json file. For reference see https://www.npmjs.com/package/@bity/preact-exchange-client

The server uses GeoLite2 database for IPs geolocation (in order to prevent exchange service access to US american IPs, and to stay compliant with the US law).

To automatically install (and update) the binary database you can use the provided docker service:

docker compose up -d

Dev

cargo run

NOTE: to run the UI locally, first change in assets/index.html the config URL:

 // const res = await fetch("https://buy.nymtech.net/config");
 const res = await fetch("http://localhost:4000/config");

Build

cargo build --release

Production

The binary server needs access to:

  • assets directory containing the website static files
  • Bity config file bity_config.json
  • GeoLite2 country database file

Paths to these files can be provided respectively by the following env variables: ASSETS_DIRECTORY, BITY_CONFIG_PATH and GEOIP_DB_PATH.

How it is built

In assets folder some files have been imported (copied as is) from @bity/preact-exchange-client sources

  • bity-preact-exchange-client.js
  • index.css

bity.css has been imported from @bity/styles sources