Bento Spaces docs

Bento Spaces documentation

Architecture

One host, no build step

source/Bento.Api/   ASP.NET Core .NET 10 minimal API
web/                HTML + CSS + ES modules, served as-is
published/          dotnet publish output = the IIS site

There is no bundler, no npm, no transpiler. source/Bento.Api/Bento.Api.csproj copies web/** into wwwroot/ before build and publish (SyncWebAssets), so editing a .js file and refreshing the browser is the whole dev loop.

Runtime layout

published/            the site (never contains App_Data)
App_Data/             content root, outside wwwroot
  private/            accounts, sessions, share links, view sessions
  data/               spaces, layouts, widget instances, installed widgets

App_Data is resolved from the content root (override with Storage:Root) and is never served, never published and never zipped into an archive. In production point Storage:Root outside published/, because a publish replaces that folder. See Storage.

Surfaces, one document

The shelf document never changes shape between surfaces; only the renderer does.

SurfaceChromeShelf
Desktopbrand + space dock (top centre) + account dock (top right) + spaces dock (bottom centre); a vertical space uses left/right railshorizontal, centered
Paired display (32:9)left/right rails, no top bar, no cursorhorizontal, full height
Square (iPad)brand + space/account docks, spaces dockhorizontal, 2 blocks visible
Phonebrand + space/account docks, spaces dock; expanded space dock is full widthblocks stacked vertically, view mode by default

unit is derived from the viewport, not stored in the document: it takes the smaller of a density cap (clamp(80, width / 18, 160)) and the fill size ((h − 96 − 3·gap) / 4 horizontally, the same from width vertically), floored at 56. A 1440×900 laptop stays at 80 px; a 2560×720 panel reaches ~142 px. A narrow viewport stacks by default; an explicit per-device orientation wins.

Edit vs view

One toggle beside the account avatar. View shows widgets and empty space; edit adds outlines, badges, gap boxes, container pluses and handles. Remembered per device. Kiosk views have no edit mode at all. See UI.

Until widgets exist (P2) the app starts in edit, because otherwise a board is blank; the default flips to view when there is something to look at.

Anonymous first, account optional

Repository layout

bento/
  Bento.slnx
  source/Bento.Api/        .NET host
  web/                     front end, top level
  tests/                   node --test, no dependencies
  published/               release (gitignored)
  archive/                 zipped previous releases (gitignored)
  docs/                    these documents
  scripts/                 publish.sh, backup.sh
  README.md

Commands

cd source/Bento.Api && dotnet run     # http://localhost:5080
node --test tests/*.test.js           # model tests
node scripts/api-smoke.mjs            # API smoke test (server running)

# offline check on a dev machine (the worker is off on localhost by default):
#   open http://localhost:5080/?sw=1 twice, then go offline and reload
node scripts/e2e/pwa.e2e.mjs          # manifest, icons, offline boot
node scripts/make-icons.mjs           # regenerate the install icons
./scripts/publish.sh                  # build → archive → published/
./scripts/backup.sh                   # zip published/ into archive/

What the host owns vs the client

ConcernOwner
Geometry rules (snap, overlap, insert, gaps, square containment)web/src/model/geometry.js — pure, tested; the server mirrors them
Renderingweb/src/features/*
Accounts, sessionshost (App_Data/private)
Space + widget persistencehost, JSON files
Widget data with secretshost proxy
Widget executionclient; sandboxed iframe for untrusted code
Entitlementshost (never trusted from the client)

Geometry is duplicated nowhere. When the server validates a layout in Phase 1, it ports the same rules from geometry.js and the tests in tests/ are the specification for both.