Bevyhub
docs > scene-registry > quick-start

Quick Start

In this tutorial we will publish a scene to Bevyhub.

You will need a GitHub account and a spirit of adventure. Iโ€™ll be using the GitHub CLI but feel free to follow along with the browser UI if you prefer.

Show Final Code
Cargo.toml
[package]
name = "hello-bevyhub"
version = "0.1.0"
edition = "2021"
[dependencies]
bevyhub_template = "0.0.1-rc.2"
[[package.metadata.scene]]
name = "hello-world"
path = "scenes/hello-world.json"
app = "bevyhub_template/my-base-scene"
scenes/hello-world.json
{
"resources": {},
"entities": {
"4294967302": {
"components": {
"bevy_core::name::Name": "Circle",
"bevy_transform::components::global_transform::GlobalTransform": [
1.0,
0.0,
0.0,
0.0,
1.0,
0.0,
0.0,
0.0,
1.0,
0.0,
0.0,
0.0
],
"bevy_transform::components::transform::Transform": {
"translation": [
0.0,
0.0,
0.0
],
"rotation": [
-0.70710677,
0.0,
0.0,
0.70710677
],
"scale": [
1.0,
1.0,
1.0
]
},
"bevyhub_scene::utils::bundle_placeholder::BundlePlaceholder": {
"Pbr": {
"mesh": {
"Circle": {
"radius": 4.0
}
},
"material": {
"Color": {
"LinearRgba": {
"red": 1.0,
"green": 1.0,
"blue": 1.0,
"alpha": 1.0
}
}
}
}
}
}
},
"4294967303": {
"components": {
"bevy_core::name::Name": "Cube",
"bevy_transform::components::global_transform::GlobalTransform": [
1.0,
0.0,
0.0,
0.0,
1.0,
0.0,
0.0,
0.0,
1.0,
0.0,
0.0,
0.0
],
"bevy_transform::components::transform::Transform": {
"translation": [
0.0,
0.5,
0.0
],
"rotation": [
0.0,
0.0,
0.0,
1.0
],
"scale": [
1.0,
1.0,
1.0
]
},
"bevyhub_scene::utils::bundle_placeholder::BundlePlaceholder": {
"Pbr": {
"mesh": {
"Cuboid": {
"half_size": [
0.5,
0.5,
0.5
]
}
},
"material": {
"Color": {
"Srgba": {
"red": 0.4862745,
"green": 0.5647059,
"blue": 1.0,
"alpha": 1.0
}
}
}
}
}
}
}
}
}

๐Ÿ‘‹ Hello World!

Lets start by creating a new project and publishing it.

Installation
gh repo create hello-bevyhub --public --clone
cd hello-bevyhub
cargo init
git add .
git commit -m "cargo init"
git branch -M main
git push -u origin main

Any crate on GitHub can be visited on Bevyhub, try finding yours!

Terminal window
https://bevyhub.dev/github/USERNAME/hello-bevyhub

๐ŸŽฅ Our first scene

Bevyhub scenes are declared in Cargo.toml in a similar way to Cargo Examples. Weโ€™ll look into creating scenes in another tutorial but for now lets just use this one:

  1. Download the scene via curl or manually:
    Terminal window
    mkdir scenes
    curl https://bevyhub.dev/assets/hello-world-scene.json -o scenes/hello-world.json
  2. Declare the scene in Cargo.toml
    Cargo.toml
    [[package.metadata.scene]]
    name = "hello-world"
    path = "scenes/hello-world.json"
  3. Push the changes
    Terminal window
    git add .
    git commit -m "added scene"
    git push origin main
  4. View on Bevyhub
    Terminal window
    https://bevyhub.dev/github/USERNAME/hello-bevyhub/hello-world

๐Ÿ’ƒ Running an App

Note that when we visited the scene we see that This scene does not have an associated app. There is a simple base app in the bevyhub_template crate called my-base-scene, lets use that one:

  1. Install bevyhub_template
    Terminal window
    cargo add bevyhub_template
  2. Declare the app in Cargo.toml
    Cargo.toml
    [[package.metadata.scene]]
    name = "hello-world"
    path = "scenes/hello-world.json"
    app = "bevyhub_template/my-base-scene"
  3. Publish
    Terminal window
    git add .
    git commit -m "added scene"
    git push origin main
  4. View the editor on Bevyhub
    Terminal window
    https://bevyhub.dev/github/USERNAME/hello-bevyhub/hello-world/editor

Now when we revisit the page we can load the scene!

๐Ÿงน Cleaning Up

Cleaning up is as simple as deleting your repository, note that some of the repo information will persist in the Bevyhub cache until it is next cleared.

Terminal window
# via cli
gh repo delete hello-bevyhub --confirm
# via browser
https://github.com/USERNAME/hello-bevyhub/settings/delete