Demo Apps
Two apps over one OData v4 service, the wholesale desk of a coffee roaster. They have the same screens: Overview, Coffees, Orders with a page per order, and Cafés. Each repo is one approach, end to end, and runs on its own.
| App | The page talks to | Links |
|---|---|---|
| Browser client | the OData service, with the browser client | Live app · Source · Walkthrough |
| Moost server | its own Moost server, in REST; the server talks OData | Live app · Source · Walkthrough |
In both repos, src/generated/ holds what the tools write from the service's $metadata (never edit it), and src/model/ your annotate blocks. The browser app's client factory is src/odata.ts; the Moost app has its server in src/server/ and its page in src/ui/.
Which one to read
Read the browser app when the page can reach the service and its users already have a session with it: there is no server of your own. Read the Moost app when you want a server in front: one technical user toward the service, your own rules, hooks and columns, and no OData code in the page. Which host to choose compares the two.
What the apps show
The paths are the same in both apps; the links open the browser app. Coffee 17 and order 1091 are there after every reset.
| Feature | Where | Guide |
|---|---|---|
| Grouped reads | Overview: the pipeline, revenue and stock charts | Aggregation |
| Filters, search and the URL | Orders: the filter bar; the URL keeps the filters | Atscript UI: filtering |
| Code lists | Orders: the Status filter, a checklist of codes with their texts | Fixed values |
| A picker narrowed by the form | Coffee 17: Region lists only the regions of its Origin | Narrowing |
| A pick fills other fields | Order 1091: pick a Café, and the Ship-to city follows | Filling other fields |
| Version tokens | Coffee 17 in two tabs: save both | Version tokens |
| The service's messages on fields | Coffee 17: a price below cost | Messages by field |
| A 1:n relation | Order 1091: its items | Relations |
| Operations on rows | Coffees: Retire, Stock value, Reprice all; Orders: Confirm, Ship, Cancel order | Actions in Atscript UI |
| Several rows at once | Orders: select some confirmed orders, then Ship | Several rows |
| Cells of your own | Coffees: the bag and the roast dots; Orders: the status pill | Atscript UI: custom cells |
| Scrolling, columns, CSV | Any list: scroll the whole set, Columns, Export CSV | Atscript UI: pagination |
| Typed calls | Overview: its reads and the Bestsellers call, checked against the generated types and handles | Type Safety |
The service
The Roastery service is OData v4 at https://demo.odata.atscript.dev/odata/v4/roastery, with a public $metadata. Every visitor shares its data, which resets every 30 minutes. It is the open-source mock server @sap-ux/fe-mockserver-core (Apache-2.0) behind a guard that admits the requests the apps send. Its repo, atscript-odata-demo-service, runs it on your machine, and either app can point at it.
Run them locally
Each app runs with pnpm install and pnpm dev (Node 22.12 or newer, pnpm 10), against the public service. Each walkthrough's Run it has the details: browser, Moost.
To run the service too:
git clone https://github.com/moostjs/atscript-odata-demo-service
cd atscript-odata-demo-service
pnpm install
pnpm start # http://localhost:4010/Then start either app with ODATA_URL=http://localhost:4010/odata/v4/roastery pnpm dev.