Skip to main content

Prerequisites

Before building any KYBER component, ensure you have:
  • Cloned the repository with --recurse-submodules or run git submodule --init --recursive
  • Downloaded and installed Protoc and ensure protoc is in your PATH

Monorepo Structure

KYBER uses a monorepo structure with the following components:
ComponentLanguageDescription
ModuleC++Game module injected into the game client
LauncherFlutter/DartDesktop launcher application
CLIFlutter/DartCommand-line interface tools
APIGoBackend API service
ProxyRustServer proxy
PackagesDartShared Dart packages

Dart/Flutter Projects

The Launcher, CLI, and Packages are built using Flutter and Dart.

Prerequisites

  • Flutter (master channel)
  • Rust (nightly toolchain)
  • Melos: dart pub global activate melos

Bootstrapping

1

Bootstrap the workspace

From the repository root, run:
melos bootstrap
This command:
  • Installs all dependencies
  • Generates protocol buffer bindings
  • Runs code generation
  • Sets up FFI bindings

Launcher

The Launcher is a Flutter desktop application for Windows, macOS, and Linux.

Building the Launcher

1

Generate FFI bindings

Navigate to the Launcher directory and generate FFI bindings:
cd Launcher
dart run tool/ffigen.dart
2

Run in debug mode

Launch the application in development mode:
flutter run
3

Build release binaries

Build for your target platform:
flutter build windows

Building the Installer (Windows)

To build the Windows installer:
  1. Install Inno Setup
  2. Use the provided installer.iss script in the installer folder
  3. Compile with Inno Setup

CLI

The CLI provides command-line tools for KYBER management.

Building the CLI

1

Install dependencies

Navigate to the CLI directory:
cd CLI
flutter pub get
2

Generate FFI bindings

Generate Rust-Dart bindings:
flutter_rust_bridge_codegen generate
3

Build the CLI binary

Build the CLI executable:
dart build cli bin/kyber_cli.dart
The binary will be output to build/cli/<platform>/bundle/bin/

Using the Built CLI

The CLI requires additional runtime dependencies to function correctly.
1

Copy Rust library

Copy the Rust library from build/cli/<platform>/bundle/lib/ next to the binary.
2

Copy Maxima dependencies

Build Maxima first, then copy the following files next to the binary:
maxima-service.exe
maxima-bootstrap.exe

Module

The KYBER Module is the C++ component that gets injected into the game client.
The KYBER Module can only be compiled on Windows with MSVC.

Prerequisites

  • Windows with MSVC (Visual Studio)
  • Bazelisk installed as bazel.exe in your PATH
  • MSYS2 installed to C:\msys64

Building the Module

1

Install Bazelisk

Download bazelisk-windows-amd64.exe and rename it to bazel.exe, then add it to your PATH.
2

Create Bazel output directory

Due to a bug with long build paths in Windows, create a short path for Bazel’s intermediary files:
mkdir C:\bz
3

Install MSYS2

Download and install MSYS2 to C:\msys64.
4

Build the module

From the repository root, run:
bazel --output_user_root="C:\bz" build --config=release Kyber
Alternatively, use the provided batch file:
.\build.bat
This will take a while on first build. The module requires --config=release flag. Building without it (debug mode) will lead to crashes.

Using the Built Module

Once built, the module DLL is located at Module/bazel-bin/Kyber.dll. To test your changes:
copy Module\bazel-bin\Kyber.dll C:\ProgramData\Kyber\Module\Kyber.dll

Code Completion

The module is developed using Visual Studio Code with the clangd extension. To generate compile_commands.json:
cd Module
clangd\refresh.bat

API

The API service is written in Go and provides the backend API.

Prerequisites

  • Go 1.24 or later
  • Protocol buffer compiler with Go plugins:
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest

Building the API

1

Generate protocol buffers

cd API
./scripts/gen-proto.sh
2

Build the binary

go build -o kyber-api ./cmd/server

Proxy

The Proxy component is written in Rust and handles server proxying.

Prerequisites

  • Rust nightly toolchain
  • Protocol buffer compiler (protoc)

Building the Proxy

1

Navigate to Proxy directory

cd Proxy
2

Build with Cargo

cargo build --release
The output binary will be located at target/release/kyber_proxy

Troubleshooting

Submodule Issues

If you encounter missing dependencies:
git submodule update --init --recursive

Melos Bootstrap Failures

If melos bootstrap fails:
  1. Ensure Flutter is on the master channel: flutter channel master && flutter upgrade
  2. Clean and retry:
    melos clean
    melos bootstrap
    

Module Build Path Issues

If you encounter path-too-long errors on Windows:
  • Ensure you’re using the --output_user_root="C:\bz" flag
  • Try moving the repository closer to the drive root

Missing Protoc

If protoc is not found:
  1. Download from Protocol Buffers Releases
  2. Add the bin directory to your PATH
  3. Verify with: protoc --version

Next Steps

Architecture Overview

Learn about KYBER’s system architecture and component interactions

Build docs developers (and LLMs) love