ID

Apps & demo data

How each app loads, saves and resets its demo data — and where to connect your own backend.

How the apps work

Calendar, Chat, Invoices, Kanban, E-commerce (with its buyer-facing store), Warehouse, Projects and Point of Sale run entirely in the browser. There is no server: each app starts from demo data written in its JavaScript file, and every action — adding a product, packing an order, moving a card, ringing up a sale — works on that data straight away.

  • Apps that save: Invoices, Kanban, E-commerce and the store, Warehouse, Projects and Point of Sale copy their data to the browser’s localStorage as soon as something changes. Your changes survive a reload and are shared by every page of the app.
  • Apps that don’t save: Calendar (calendar.js) and Chat (chat.js) keep everything in memory. Events you add and messages you send are gone after a reload — every visit starts from the demo again.

All demo data is set on the same fixed date — Wednesday, September 23, 2026 — so the dashboards, due dates and “today” labels always agree with each other.

Where each app keeps its data

Each app has one shared data file that every page of the app loads first. It holds the demo data and the load and save functions. The names below are the storage keys of the English pages.

AppData fileSaved underBack to the demo data
Calendarcalendar.jsNot savedReload the page
Chatchat.jsNot savedReload the page
Invoicesinvoices.jssl-invoicesReset demo data
Kanbankanban.jssl-kanbanReset board
Projectsprojects.jssl-proj, sl-kanbanReset demo data
E-commerceecommerce.jssl-shop-… (7 keys)Reset demo data
Store (buyer side)store.jssl-store-cartWith E-commerce
Warehousewarehouse.jssl-wmsReset demo data
Point of Salepos.jssl-posReset demo data

Where to find the reset buttons, and what they restore:

  • Invoices — on the Invoices list.
  • Kanban — Reset board on the Kanban page restores the board only.
  • Projects — on All projects, Timesheets or Workload. It restores the projects and the Kanban board, because both apps share the board.
  • E-commerce — on Products, Orders, Customers, Categories, Discounts, Reviews or Store settings. Each one restores the whole store: products, orders, customers, categories, discounts, reviews and settings (sl-shop-products, sl-shop-orders, sl-shop-customers, sl-shop-cats, sl-shop-discounts, sl-shop-reviews, sl-shop-settings).
  • Store — orders and reviews placed in the store are saved with the E-commerce data, so they come back with its reset. The cart (sl-store-cart) empties when an order is placed.
  • Warehouse — on Inventory, Receiving, Cycle counts or Purchasing.
  • Point of Sale — on the register (the Point of sale dashboard), Sales, Menu items, Members or Shifts & cash.

Two smaller E-commerce preferences are saved separately: the team notes on customers (sl-shop-notes, cleared by the reset on the Customers page) and the table or grid choice on Products (sl-shop-view).

To clear everything at once, open your browser’s developer tools, go to Application › Local storage (Chrome and Edge) and delete the keys that start with sl-.

Demo data per language

The Indonesian pages keep their own copy of every app’s data. Each data file builds its storage key with window.slI18n.key(), which adds @id on the Indonesian pages:

JavaScript
window.slI18n.key('sl-shop-orders');
// English pages:    'sl-shop-orders'
// Indonesian pages: 'sl-shop-orders@id'

So the two demos never mix, and a reset in one language leaves the other untouched. The Indonesian demo also uses its own amounts in rupiah rather than a currency symbol swap: store prices are the dollar prices × 15,000, warehouse costs × 10,000, invoices have their own rates and 11% tax, and the café has its own menu priced in rupiah.

Choices that describe you or your screen rather than demo records — the appearance settings from the customizer and the account details on the Settings page — are shared by both languages.

How the apps connect

  • Store and admin share one shop. The buyer-facing store reads the same products, stock, categories and discount codes as the E-commerce admin. An order placed at checkout lowers the stock and appears in Orders right away; a review written on a product page waits in Reviews for approval.
  • Kanban and Projects share one task list. The Kanban board is the only task list: project progress, the tasks on a project page and the Projects dashboard are all calculated from it.
  • Dashboards read the app data. The E-commerce, Projects and Warehouse dashboards calculate their figures from window.slShop, window.slProj and window.slWms, so a change in the app shows up on its dashboard. Charts the demo has no history for (such as the 30-day sales chart) are fixed snapshots. The Point of sale dashboard is the register, and the General dashboard (index.html) shows fixed demo figures.
  • The UI Kit reuses Invoices. The table on the Data tables page is built from window.slInvoices.
  • Notifications point at app records. The bell in the top bar lists recent events — a new order, a chat message, a review to approve, an overdue invoice and more — and each one opens that record in its app. Opening an item marks it read; the read state is saved in the browser. The list is in assets/js/selaras.js (search for “notifications”); replace it with data from your backend.

Warehouse and E-commerce are separate: warehouse stock is not linked to store stock.

Connecting your own backend

Every app follows the same pattern: the data file loads the data once into memory, the page scripts read and change that in-memory data, and they call a save function after each change. That makes the data file the one place to change.

Data fileExposed asLoads withSaves with
ecommerce.jswindow.slShopSee belowSee below
invoices.jswindow.slInvoicesload()save()
projects.jswindow.slProjload(), loadTasks()save(), saveTasks()
kanban.jswindow.slKanbanload()save()
warehouse.jswindow.slWmswms objectsave()
pos.jswindow.slPosload()save()
store.jswindow.slStorecart data objectpersist()

ecommerce.js has one pair per kind of data: load() and save() for products, loadOrders() / saveOrders(), loadReviews() / saveReviews() and loadDiscounts() / saveDiscounts(), while customers, categories and store settings are read in place and saved with saveCustomers(), saveCats() and saveSettings().

Look for the /* ---------- storage ---------- */ block in each file. Note that the Kanban board (sl-kanban) is read and written by both projects.js and kanban.js, so change both.

Example: e-commerce orders

The page scripts read slShop.shop.orders the moment they run, so the data has to be there before them. The simplest way is to let your server print the orders into the page, before assets/js/ecommerce.js:

HTML
<script>
  window.SL_DATA = { orders: [] }; // your server fills this array with the orders from your database
</script>

Then, in ecommerce.js, take the orders from there and send every change to your API:

JavaScript
var loadOrders = function () {
  if (window.SL_DATA && window.SL_DATA.orders) return window.SL_DATA.orders;
  return clone(ORDERS_DEMO);
};
shop.orders = loadOrders();

var saveOrders = function () {
  fetch('/api/orders', {
    method: 'PUT',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify(shop.orders)
  }).then(function (res) {
    if (!res.ok) throw new Error('HTTP ' + res.status);
  }).catch(function () {
    toast('The orders could not be saved. Please try again.');
  });
  return true; // the callers expect true = saved
};

This sends the whole list on every change, which keeps the page scripts untouched. To send only the order that changed (for example PUT /api/orders/SL-10431), change the places that call saveOrders() — ecommerce-orders.js, ecommerce-order.js, ecommerce-order-new.js and store-checkout.js.

If you prefer to fetch the data in the browser, fetch first and only then load ecommerce.js and the page script. To refresh data after the page has started, replace the array and redraw: most pages expose their redraw function on window, for example window.slOrders.render() on the Orders page.

What to keep in mind

  • Keep the object shapes. Your API should return objects with the same fields as the demo data — the demo builders in each data file show every field. An order, for example, has no, at, customer (a key in slShop.CUSTOMERS), channel, items, shipping, discount, payment, fulfillment, tracking, refunds, note, events and method.
  • Calculated values are not stored. Order totals come from slShop.orderTotals(), and an invoice’s “Overdue” status is worked out from its due date. Send the inputs, not the results.
  • One action can save several things. Placing an order also saves products (stock) and customers. On your server, handle such a change in one transaction.
  • Check everything again on the server. Prices, stock and discount codes are checked in the browser for the demo; a real backend must never trust totals or stock sent by the browser.
  • Replace the demo date. The demo’s “today” is fixed at September 23, 2026: TODAY (and NOW where the time matters) in each data file, and NOW in calendar.js and chat.js. Use the real date once the data is real.
  • The storage wrapper is local only. What goes into localStorage is wrapped in an object with a version number; your API doesn’t need it.
  • Amounts are formatted, not converted. window.slFmt.money() shows an amount with the page’s currency — dollars on the English pages, rupiah on the Indonesian ones. The conversion of the demo amounts happens only inside the demo data.

localStorage is for the demo only

Don’t use it to store real data

Data in localStorage lives in one browser on one device. It isn’t shared with other users or devices, anyone using that browser can read and change it, it disappears when site data is cleared, and it has a small size limit — product photos fill it quickly, after which the apps show a message that the browser is out of storage. Connect a backend before you put the apps to real use.