Skip to content

Latest commit

 

History

History
31 lines (20 loc) · 1.52 KB

README.md

File metadata and controls

31 lines (20 loc) · 1.52 KB

player-bff

This folder contains the source code for the Player backend-for-frontend (BFF) of SSL Core. It is an application written in Go that provides the data needed by the player-mfe.

graph LR

 player-mfe --> player-bff
 player-bff --> backend
Loading

How it works

The Player BFF mediates communication between the microfrontend and the backend. It handles presentation and interaction logic without embedding any business logic.In Domain-driven Design terms, it maps the backend subdomain (robot control and strategy) to the frontend subdomain (user features).

The BFF communicates with the backend through the gateway, using gRPC and with the clients via WebSocket. It maintains a single persistent connection to handle the livestream use case and notify all subscribed WebSocket connections from the player-mfe when a packet is received. Other features follow a flow where a client sends a message in the format { event: string, data: map[string]interface{} }, the BFF sends a request to the gateway, processes the response, and sends it back to the client.

Development

To run the application, use the following commands:

make setup
make run

Codemap

  • cmd: Entry point of the BFF.
  • internal: Internal packages and core application logic.
  • transport: Transmission and receiving of messages.