AppML Prototyping

AppML can run entirely client-side against a plain JSON or text file standing in for a database, letting a page's look and data flow be mocked up before any server-side backend exists.

Faking the Backend On Purpose

Because a model's data source can simply be a static file, a page can be built, linked, and clicked through while no PHP or ASP handler exists yet. This is useful for prototyping: a designer or developer can demonstrate how a list will look, how a form will bind to fields, and how the overall page will behave, without first standing up a database and a server-side script.

  • A static JSON file holds a sample records array in place of a live query
  • The page loads that file directly the same way it would load a model-backed data source
  • appml-repeat and appml-if bindings behave exactly as they would against a live source
  • Insert, update, and delete are either omitted or left disabled, since a static file has nowhere to persist changes

A stand-in data file

{
  "records": [
    { "name": "Keyboard", "price": 29.99 },
    { "name": "Mouse", "price": 14.99 },
    { "name": "Monitor Stand", "price": 39.50 }
  ]
}

A page bound to the stand-in file

<html>
<head>
  <script src="appml.js"></script>
</head>
<body appml-data="products.json">
  <table>
    <tr appml-repeat="records">
      <td>{{name}}</td>
      <td>{{price}}</td>
    </tr>
  </table>
</body>
</html>

Once the mockup is approved, the plain file reference is swapped for a model that points at a real PHP or ASP handler. Because the markup only ever spoke in terms of {{placeholders}} and repeat/if bindings, nothing in the page has to change - only where the data comes from.

Note: A prototype file cannot accept writes on its own. Insert, update, and delete controls in a mockup either need to be hidden or wired to a stub that pretends to succeed - don't assume a plain file will silently start persisting form submissions.
Prototype setupProduction setup
Data sourceStatic JSON/text file
PersistenceNone - changes are not saved
Backend code neededNone