trailbase/crates/assets/js/admin
2025-08-07 10:02:32 +02:00
..
proto Cleanup: move all Rust code into a crates/ directory. 2025-08-07 10:02:32 +02:00
src Cleanup: move all Rust code into a crates/ directory. 2025-08-07 10:02:32 +02:00
tests Cleanup: move all Rust code into a crates/ directory. 2025-08-07 10:02:32 +02:00
.gitignore Cleanup: move all Rust code into a crates/ directory. 2025-08-07 10:02:32 +02:00
.prettierignore Cleanup: move all Rust code into a crates/ directory. 2025-08-07 10:02:32 +02:00
.prettierrc Cleanup: move all Rust code into a crates/ directory. 2025-08-07 10:02:32 +02:00
eslint.config.mjs Cleanup: move all Rust code into a crates/ directory. 2025-08-07 10:02:32 +02:00
index.html Cleanup: move all Rust code into a crates/ directory. 2025-08-07 10:02:32 +02:00
package.json Cleanup: move all Rust code into a crates/ directory. 2025-08-07 10:02:32 +02:00
postcss.config.mjs Cleanup: move all Rust code into a crates/ directory. 2025-08-07 10:02:32 +02:00
README.md Cleanup: move all Rust code into a crates/ directory. 2025-08-07 10:02:32 +02:00
tailwind.config.ts Cleanup: move all Rust code into a crates/ directory. 2025-08-07 10:02:32 +02:00
tsconfig.json Cleanup: move all Rust code into a crates/ directory. 2025-08-07 10:02:32 +02:00
ui.config.json Cleanup: move all Rust code into a crates/ directory. 2025-08-07 10:02:32 +02:00
vite.config.mts Cleanup: move all Rust code into a crates/ directory. 2025-08-07 10:02:32 +02:00

TrailBase Admin Dashboard UI

This directory contains TrailBase's admin dashboard UI. It is an SPA, i.e. it's static content embedded into the TrailBase binary that executes in the browser using TrailBase's privileged admin APIs.

For development one case use the vite dev-server with hot module reload. First start the TrailBase binary in dev mode (permissive CORS and cookie policies):

$ cargo run -- --data-dir client/testfixture  run --dev

and then vite:

$ pnpm run dev

Protobuf codegen

We're using ts-proto for protobuf code generation. Run

$ pnpm run proto

, which requires the following system dependencies:

  • protoc, e.g. via the protobuf-compiler Debian/Ubuntu package
  • descriptor.proto, e.g. via the libprotobuf-dev Debian/Ubuntu package.

Rust-TypeScript codegen

The TypeScript bindings for the admin APIs are checked into the repository under /crates/assets/js/bindings. They're generated via ts-rs and written every time the Rust tests execute, i.e. cargo test. They're checked in to avoid having Rust depend on TypesScript and TypeScript depend on Rust tests.