No description
  • Rust 93.9%
  • CSS 5%
  • Nix 1.1%
Find a file
Collin Diekvoss 40414ef37c
feat: per-backend dev profiles (sqlite, postgres, xitdb) with wasm-safe feature markers
- Scripts.toml: dev-sqlite/dev-postgres/dev-xitdb, otel in every dev
  profile, dev-otel removed; codegen stays in the flow
- secretspec.toml: sqlite/postgres/xitdb profiles with matching DATABASE_URLs
- web/api: sqlite-backend/postgres-backend/xitdb-backend features kept
  dependency-free on purpose: dx merges CLI --features into the wasm
  client build, where neither the server net stack nor the storage
  engines compile. Storage stays bundled in api/server; DATABASE_URL
  selects the backend at runtime. xitdb_backend module additionally
  requires server so it vanishes from client builds.
- flake.nix: openapi-to-rust 0.16.0 -> 0.23.0 plus vendored
  response-header patch (nix/openapi-to-rust-response-headers.patch),
  without which codegen cannot reproduce the committed output and
  corrupts the tree on every run. Re-check upstream on every bump.
- otel hint, README, dev.xitdb gitignore follow the renames
2026-11-06 12:02:34 -06:00
.zed refactor(api): serve openapi spec at GET /api via codegen router 2026-09-30 21:51:31 -05:00
docs/superpowers plan: xitdb third backend implementation 2026-11-05 15:51:29 -06:00
grafana/provisioning/datasources feat(api): add otel telemetry, docs and console 2026-09-19 12:58:42 -05:00
migrations 2026-11-05 15:44:55 -06:00
nix feat: per-backend dev profiles (sqlite, postgres, xitdb) with wasm-safe feature markers 2026-11-06 12:02:34 -06:00
packages feat: per-backend dev profiles (sqlite, postgres, xitdb) with wasm-safe feature markers 2026-11-06 12:02:34 -06:00
scripts feat: per-backend dev profiles (sqlite, postgres, xitdb) with wasm-safe feature markers 2026-11-06 12:02:34 -06:00
.envrc feat(sample-service): add initial service scaffold 2026-09-14 22:56:03 -05:00
.gitignore feat: per-backend dev profiles (sqlite, postgres, xitdb) with wasm-safe feature markers 2026-11-06 12:02:34 -06:00
AGENTS.md feat(api): add otel telemetry, docs and console 2026-09-19 12:58:42 -05:00
Cargo.lock feat: xitdb storage backend 2026-11-05 16:11:42 -06:00
Cargo.toml feat: xitdb storage backend 2026-11-05 16:11:42 -06:00
clippy.toml refactor(workspace): split service into platform packages 2026-09-15 20:28:14 -05:00
diesel.postgresql.toml refactor(workspace): split service into platform packages 2026-09-15 20:28:14 -05:00
diesel.sqlite.toml refactor(workspace): split service into platform packages 2026-09-15 20:28:14 -05:00
domain.http 2026-11-05 15:44:55 -06:00
domain.oas3.json 2026-11-05 15:44:55 -06:00
flake.lock feat(api): add otel telemetry, docs and console 2026-09-19 12:58:42 -05:00
flake.nix feat: per-backend dev profiles (sqlite, postgres, xitdb) with wasm-safe feature markers 2026-11-06 12:02:34 -06:00
grafana.ini feat(api): add otel telemetry, docs and console 2026-09-19 12:58:42 -05:00
openapi-to-rust.toml feat(api): add codegen tag, typed 404s and unified api explorer 2026-09-30 21:24:53 -05:00
otel-collector.yaml feat(api): add otel telemetry, docs and console 2026-09-19 12:58:42 -05:00
prometheus.yaml feat(api): add otel telemetry, docs and console 2026-09-19 12:58:42 -05:00
README.md refactor(workspace): split service into platform packages 2026-09-15 20:28:14 -05:00
rust-toolchain.toml refactor(workspace): split service into platform packages 2026-09-15 20:28:14 -05:00
Scripts.toml feat: per-backend dev profiles (sqlite, postgres, xitdb) with wasm-safe feature markers 2026-11-06 12:02:34 -06:00
secretspec.toml feat: per-backend dev profiles (sqlite, postgres, xitdb) with wasm-safe feature markers 2026-11-06 12:02:34 -06:00
tempo.yaml feat(api): add otel telemetry, docs and console 2026-09-19 12:58:42 -05:00

Development

Your new workspace contains a member crate for each of the web, desktop and mobile platforms, a ui crate for shared components and a api crate for shared backend logic:

your_project/
├─ README.md
├─ Cargo.toml
└─ packages/
   ├─ web/
   │  └─ ... # Web specific UI/logic
   ├─ desktop/
   │  └─ ... # Desktop specific UI/logic
   ├─ mobile/
   │  └─ ... # Mobile specific UI/logic
   ├─ api/
   │  └─ ... # All shared server logic
   └─  ui/
      └─ ... # Component shared between multiple platforms

Platform crates

Each platform crate contains the entry point for the platform, and any assets, components and dependencies that are specific to that platform. For example, the desktop crate in the workspace looks something like this:

desktop/ # The desktop crate contains all platform specific UI, logic and dependencies for the desktop app
├─ assets/ # Assets used by the desktop app - Any platform specific assets should go in this folder
├─ src/
│  ├─ main.rs # The entrypoint for the desktop app. It also defines the routes for the desktop platform
│  ├─ views/ # The views each route will render in the desktop version of the app
│  │  ├─ mod.rs # Defines the module for the views route and re-exports the components for each route
│  │  ├─ blog.rs # The component that will render at the /blog/:id route
│  │  ├─ home.rs # The component that will render at the / route
├─ Cargo.toml # The desktop crate's Cargo.toml - This should include all desktop specific dependencies

When you start developing with the workspace setup each of the platform crates will look almost identical. The UI starts out exactly the same on all platforms. However, as you continue developing your application, this setup makes it easy to let the views for each platform change independently.

Shared UI crate

The workspace contains a ui crate with components that are shared between multiple platforms. You should put any UI elements you want to use in multiple platforms in this crate. You can also put some shared client side logic in this crate, but be careful to not pull in platform specific dependencies. The ui crate starts out something like this:

ui/
├─ src/
│  ├─ lib.rs # The entrypoint for the ui crate
│  ├─ hero.rs # The Hero component that will be used in every platform
│  ├─ echo.rs # The shared echo component that communicates with the server
│  ├─ navbar.rs # The Navbar component that will be used in the layout of every platform's router

Shared backend logic

The workspace contains a api crate with shared backend logic. This crate defines all of the shared server functions for all platforms. Server functions are async functions that expose a public API on the server. They can be called like a normal async function from the client. When you run dx serve, all of the server functions will be collected in the server build and hosted on a public API for the client to call. The api crate starts out something like this:

api/
├─ src/
│  ├─ lib.rs # Exports a server function that echos the input string

Serving Your App

Navigate to the platform crate of your choice:

cd packages/web

and serve:

dx serve