Get started

Scaffold a Sixb project, run it, and trace live orbital data from a connector into a typed object and custom app. By the end you will have a local runtime tracking Sentinel-6B and understand how Sixb moves external data into the model your app reads.

Sixb requires Bun 1.3 or later. Install Bun first.

Scaffold a project

BASH
bun create sixb my-app
cd my-app
bun install

The generated starter locates Sentinel-6B from public orbital elements. It uses local SQLite, DuckLake, and file storage, so no database or service needs to be running before you start.

PathWhat it is
sixb.config.tsRuntime entry with local providers
connectors/celestrak.tsKeyless connection to the public CelesTrak TLE endpoint
datasets/satellite-orbit.tsTyped table for an orbital snapshot
syncs/satellite-orbit.tsPulls the latest snapshot into the dataset
ontology/satellite.tsTyped Satellite object model
projections/satellite.tsMaps the dataset row into a Satellite object
app/page.tsxCustom app that queries the object and calculates its live position

Start the dev server

BASH
bun run dev

The local dev script runs sixb dev. It loads sixb.config.ts, co-hosts the runtime and workers, and serves three interfaces:

ServiceURLPurpose
Atlashttp://localhost:3000Browse the ontology, objects, runs, and events
Starter apphttp://localhost:3001Locate Sentinel-6B and follow its live position
APIhttp://localhost:3002HTTP/WebSocket API and interactive OpenAPI docs

Keep this terminal running while you use the app.

Locate Sentinel-6B

Open http://localhost:3001 and select Locate. That one request runs the whole starter data path:

  1. The celestrak connector fetches the current two-line element set for Sentinel-6B.
  2. sync-satellite-orbit writes one typed row into the satellite-orbit dataset.
  3. The satellite projection materializes that row as a Satellite object.
  4. The app's typed object query refreshes when the object event arrives.
  5. The browser calculates latitude, longitude, altitude, and velocity from the saved elements.

The fetch needs outbound internet access but no account or API key. The app does not fetch on startup; it stays in Ready to locate until you select the button.

Inspect the object model

Object types live in ontology/ and are auto-discovered. The starter declares the data the app and projection share in one place.

TSontology/satellite.ts
import { defineObjectType, prop } from "@sixb/core/ontology"

export const Satellite = defineObjectType({
  id: "Satellite",
  name: "Satellite",
  description: "A spacecraft located from public orbital elements.",
  properties: [
    prop("id", "string", { required: true, primary: true }),
    prop("name", "string", { required: true }),
    prop("tleLine1", "string", { required: true }),
    prop("tleLine2", "string", { required: true }),
    prop("elementEpoch", "timestamp", { required: true }),
  ],
})

Every object type needs exactly one primary: true property as its key. The same definition types the projection, runtime queries, client query, API schema, and Atlas views. See object types and properties for every option.

Inspect the sync and projection

The sync converts the connector response into the dataset's row shape:

TSsyncs/satellite-orbit.ts
import { defineSync } from "@sixb/core"
import { celestrak } from "../connectors/celestrak"
import { satelliteOrbit } from "../datasets/satellite-orbit"

export const syncSatelliteOrbit = defineSync("sync-satellite-orbit")
  .from(celestrak)
  .read(async (client, context) => {
    const orbit = await client.latestOrbit(context.signal)
    return [
      {
        id: "sentinel-6b",
        name: orbit.name,
        tleLine1: orbit.line1,
        tleLine2: orbit.line2,
        elementEpoch: orbit.elementEpoch,
      },
    ]
  })
  .intoDataset(satelliteOrbit)

The projection then maps each column to the object property with the same name:

TSprojections/satellite.ts
import { defineProjection, type ObjectProjectionDefinition } from "@sixb/core"
import { satelliteOrbit } from "../datasets/satellite-orbit"
import { Satellite } from "../ontology/satellite"

export const satelliteProjection: ObjectProjectionDefinition = defineProjection(
  "satellite",
  Satellite
)
  .fromDataset(satelliteOrbit)
  .properties({
    id: "id",
    name: "name",
    tleLine1: "tleLine1",
    tleLine2: "tleLine2",
    elementEpoch: "elementEpoch",
  })

Open http://localhost:3000 after the first locate request to inspect the registered Satellite type, the materialized object, and the runs that produced it.

Next steps

Search docs

Search the documentation