Barfinex

Getting started

πŸ”’ Local Certificates Setup

Local certificates enable secure communication between your Barfinex services and Studio.Barfinex during development. This guide shows how to set up HTTPS for local environments to avoid browser errors and ensure all tools work correctly.

Why do you need this?

Our application Studio.Barfinex runs over HTTPS.

πŸ‘‰ In order to connect local services (provider, detector, inspector) and display data in the browser, those services must also be available via HTTPS.

If a service runs only on HTTP, the browser blocks the connection (mixed content error).

That’s why we configure local certificates.


Why is this secure?

  • Certificates are generated locally using mkcert.
  • The browser trusts them because mkcert installs a local CA into your system.
  • Studio.Barfinex does not proxy or cache any data β€” all trading data stays fully on the client side.

Thus, HTTPS is required solely so the browser allows secure connections to your local services.


πŸ”Ή Installation

1. Install mkcert

Windows

# download mkcert binary
cd ...\app-provider

Invoke-WebRequest `
  -Uri "https://github.com/FiloSottile/mkcert/releases/download/v1.4.4/mkcert-v1.4.4-windows-amd64.exe" `
  -OutFile "mkcert.exe"

.\mkcert.exe -install

or

# download mkcert binary
curl -L -o mkcert.exe https://github.com/FiloSottile/mkcert/releases/download/v1.4.4/mkcert-v1.4.4-windows-amd64.exe
.\mkcert.exe -install

macOS

brew install mkcert nss
mkcert -install

Linux (Ubuntu/Debian)

sudo apt install libnss3-tools
mkcert -install

2. Generate certificates manually

From the project root run:

mkcert -key-file cert/localhost+2-key.pem -cert-file cert/localhost+2.pem "localhost" "127.0.0.1" "::1"

This will create a cert/ folder:

cert/
β”œβ”€β”€ localhost+2.pem
└── localhost+2-key.pem

3. Configure .env.local

Create or update your .env.local file:

APP_MODE=local
SSL_KEY=./cert/localhost+2-key.pem
SSL_CERT=./cert/localhost+2.pem

4. Run your service

npm run start:dev

Console output will confirm:

βœ… HTTPS enabled (certificates loaded)
πŸš€ API is running on: https://localhost:8101/api
πŸ“˜ Swagger docs: https://localhost:8101/api/docs

Now your local services can securely integrate with https://studio.barfinex.com.

Let’s Get in Touch

Have questions or want to join Barfinex? Send us a message.