Retail Demo

Introduction

The Fireblocks Retail Demo application serves as a reference for developing retail-facing use cases. It includes a frontend built with React and a backend powered by Node.js.

The primary goal of this demo is to showcase the implementation flow and best practices when building an application on the Fireblocks platform.

You can find the application in the following public GitHub repository: Retail Demo app.


🚧

To experience the full capabilities of this demo, please ensure the backend application is running before interacting with the frontend. This setup is essential for enabling user login and performing various actions.


Frontend Application

Github Repo - FireX

FireX is a retail cryptocurrency demo platform built with Next.js, MobX, and integrated with Fireblocks for secure asset management. This project aims to provide a reference for Fireblocks integration when building applications to serve retail facing use cases.

Setup and Installation

  1. Clone the repository:
git clone https://github.com/fireblocks/retail-demo-fe
cd firex
  1. Install dependencies:
npm install
  1. Set up environment variables - Create a .env.local file in the root directory and add the following variables:
NEXT_PUBLIC_BACKEND_BASE_URL=http\://localhost:3000  
CMC_API_KEY=your_coinmarketcap_api_key
  • Ensure you have Node.js (version 20 or later) and npm installed on your system.
  1. Start the development server:
npm run dev


Backend Application

Github Repo - Retail Backend

The Backend application is a demo and integration reference for customers buidling retail-facin solutions on Fireblocks, designed to showcase the integration of Fireblocks' services with a typical retail facing use-case.
It provides functionality for user authentication, wallet management, asset handling, and transaction processing.
The demo application implements all the best practices and the recommended integration flows for this use case.

Setup and Installation

Fireblocks API Key Setup

  1. Create a keys directory in the root of the project if it doesn't exist already.
  2. Place your Fireblocks API private key file in the keys directory.
  3. In your .env file, set the FIREBLOCKS_PATH_TO_SECRET variable to point to your key file:
FIREBLOCKS_PATH_TO_SECRET=./keys/your_secret_key_file_name.key

Replace your_secret_key_file_name.key with the actual name of your key file.

Note: The Docker setup will automatically include the keys directory in the container, ensuring that the application can access your Fireblocks API key. Make sure that you also run the front-end applicaiton that can be found here

  1. Install dependencies:
npm install
  1. Set up environment variables: Create a .env file in the root directory and add the necessary variables (see Environment Variables section below)
  2. Build the Docker image:
docker build -t fireblocks-retail-demo .
  1. Run the Docker container:
docker-compose up -d 

  1. Configure a local tunneling like ngrok or expose to recieve webhooks. The webhook endpoint is exposed at the /webhook path which means that you need to configure your Webhook URL in Fireblocks with the base URL you get from the local tunneling tool + /webhook at the end: https://my-base-url.com/webhook
  2. Alternatively you can run it without Docker if you have MySQL installed locally.