Installation
Hex does not publish Strata yet. Build it from source.
Prerequisites
Section titled “Prerequisites”- mise. It installs the required Erlang, Gleam, and
justversions. - Git.
Pinned versions:
- Erlang 27.2.1
- Gleam 1.18.1
- just 1.50.0
Clone and build
Section titled “Clone and build”git clone https://github.com/tylerbutler/strata.gitcd stratamise installjust depsjust build-alljust build-all builds each package for Erlang, JavaScript, or both. Run
just test-all to test all packages.
Next: Quick Start runs the server and a collaborative example.
Packages
Section titled “Packages”The workspace contains these packages:
strata_protocol: WebSocket message types and JSON conversion (Erlang + JavaScript).strata_document: typed documents and schemas (Erlang + JavaScript).strata_server: the server and document storage (Erlang).strata_client: connection and document sync logic (Erlang + JavaScript).strata_component: typed headless component contracts and bindings (Erlang- JavaScript).
strata_transport: browser WebSocket support forstrata_client(JavaScript).strata_transport_gun: Gun WebSocket support forstrata_client(Erlang).strata_admin: read-only admin page (JavaScript).
Add Strata to an application
Section titled “Add Strata to an application”Until the packages are on Hex, use git dependencies. Add only the packages that your application needs.
[dependencies]gleam_json = ">= 3.0.0 and < 4.0.0"strata_client = { git = "https://github.com/tylerbutler/strata.git", ref = "<commit>", path = "packages/strata_client" }strata_component = { git = "https://github.com/tylerbutler/strata.git", ref = "<commit>", path = "packages/strata_component" }strata_document = { git = "https://github.com/tylerbutler/strata.git", ref = "<commit>", path = "packages/strata_document" }strata_protocol = { git = "https://github.com/tylerbutler/strata.git", ref = "<commit>", path = "packages/strata_protocol" }strata_transport = { git = "https://github.com/tylerbutler/strata.git", ref = "<commit>", path = "packages/strata_transport" }Add strata_component when you define or host headless components. It depends
on strata_client and strata_document. Add those packages as direct
dependencies when your application imports them. Add gleam_json for config
codecs. Add strata_protocol when your component imports
strata_protocol/dynamic_json, as the current examples do.
Use strata_transport for a JavaScript application. Use
strata_transport_gun for an Erlang application. Pin all Strata packages to
the same commit. The public APIs can change before 1.0.
The repository uses a Gleam workspace. If Gleam cannot select a package from the repository, clone Strata beside your application and use path dependencies:
strata_client = { path = "../strata/packages/strata_client" }strata_component = { path = "../strata/packages/strata_component" }strata_document = { path = "../strata/packages/strata_document" }strata_protocol = { path = "../strata/packages/strata_protocol" }strata_transport = { path = "../strata/packages/strata_transport" }See Build Your First Application for a complete browser integration. See Components and Bindings for component dependencies and host responsibilities.