Skip to content

Starting Development

Raphii edited this page Jul 26, 2023 · 24 revisions

In case you want to get started with developing on OyasumiVR, you're in the right place! On this page you will find instructions on how to set up the project, as well as various details regarding tthe project that might come in useful.

Setting up your environment

Installing Prerequisites

NodeJS

Start by installing NodeJS. This is necessary for building the web frontend for the main UI, and running most of OyasumiVR's build scripts.

Install Rust & Tauri

Next, follow Tauri's prerequisites. Tauri is the Rust-based desktop framework that OyasumiVR is built with, so you need its development tools to get started.

After you've followed their prerequisites, verify you have at least the following tools installed:

  • VS C++ Build tools
  • WebView2
  • Rust Stable
  • The Tauri CLI

Install Clang

Next, you need to install clang. This is required for generating the bindings to OpenVR.

Following the linked guide, make sure to:

  1. Install Clang (e.g. through winget install LLVM.LLVM)
  2. Set the LIBCLANG_PATH environment variable to the bin directory of your LLVM install.

Install the .NET 7 SDK

Install the .NET 7 SDK. This is required for building the SteamVR overlay sidecar.

Initializing the project

Now that you've got all the prerequisites installed, we can start by setting up the project:

  1. Check out Oyasumi somewhyere on your machine: git clone https://github.com/Raphiiko/OyasumiVR.git
  2. Change into the new project directory: cd OyasumiVR
  3. Run the initialization script with npm run init. This will install all required npm packages for both the main UI and the overlay UI, and move the necessary files into places where they need to go.
  4. Now run npm run build:pre.

Now you're all set up! From here on, you can run npm run start or npm run dev to start OyasumiVR. Check out the NPM Scripts section for the difference between these two.

Modules & Structure

NPM Scripts

In this section I've documented some of the more notable NPM scripts and what they do. You run these with npm run <script name>.

Script Description
start Runs Oyasumi in 'release' mode.

This has the following effects:
  • Ports for gRPC and gRPC-Web on the core and overlay sidecar will be randomly allocated.
  • The port for the HTTP server on the core will be randomly allocated.
  • OyasumiVR will launch the most recently built overlay sidecar.
If you are working on the overlay sidecar, or the overlay ui, look into using `npm run dev` instead!
dev Runs Oyasumi in 'dev' mode.

This has the following effects:
  • Ports for gRPC and gRPC-Web on the core and overlay sidecar will be set to their development ports
  • he port for the HTTP server on the core will be set to its development port
  • OyasumiVR will not attempt to launch the overlay sidecar, or the overlay sidecar ui. You are expected to run these yourself separately.
This script is useful when you are working on the overlay sidecar, or the overlay UI.
generate:grpc-web-client Generates new TypeScript models and web clients for gRPC communication between OyasumiVR's different modules. Run this when you have changed any of the protobuf definitions in the /proto/ folder.
clean Removes most of the build artifacts scattered throughout the project folder, allowing you to start building with a clean slate.
build or build:core Builds OyasumiVR in its entirity, including an installer bundle. Do note that this can take quite a while.
build:sidecars Builds both the elevated sidecar, as well as the overlay sidecar.
build:sidecars:elevated Builds the elevated sidecar
build:sidecars:overlay Builds the overlay sidecar
build:front Builds the main UI
set-version <semver> Sets a new version number in all relevant files.

Development Ports

Clone this wiki locally