Examples · Photo editor
A photo development studio: 14 lines of AppSPEC
A photo development workspace with exposure and colour adjustments, crop and rotation, before-and-after comparison and PNG export.
Running live in the sandbox with fixed demo data. Anything you add is saved in this browser; nothing leaves your device.
The state graph
2 screens, 0 wires
Screens are nodes and WIRE labels are edges. Screens in blue appear in the navigation; orange edges write a record on the way.
How it works
Walking through the spec
01Screens are states
2 screens, each a <STATE>. develop, compare appear in the navigation because they carry a NAV label. Children lay themselves out by containment: ROW, COL and GRID arrange them, and everything else stacks.
<STATE ID="develop" NAV="Develop" ICON="sliders-horizontal">
…
<STATE ID="compare" NAV="Before / after" ICON="columns-2">02Screens connect by label
This app needs no <WIRE>: navigation comes from NAV labels, and its buttons call component actions directly, such as player.play({id}) or paint.keep(sketches).
03Data flows through the key-value pipe
Every input publishes its value into the pipe under its ID, and every screen can read the pipe with {placeholders}. The pipe drives filtering and display; no wire writes a record.
04One attribute sets the look
THEME="noir-ivory" sets every colour, radius and typeface. Change the word and the whole app restyles; all 31 themes work with every component.
<APP ID="darkroom-photo-editor" NAME="Darkroom" THEME="noir-ivory" LAYOUT="desktop">Convention over configuration
What the engine infers
Every attribute this spec leaves out has a default inferred from names, data and context. These are the ones this app relies on; writing any of them out would override it.
What this would typically take
The pieces a conventional stack needs
A typical implementation of the same app assembles these parts, each with its own code, libraries and configuration. The size depends on the team and the tools, so we do not quote a number for it.
Here the same app is one 14-line document built from general-purpose components: COLLECTION, PHOTO-EDITOR.
| Photo adjustments | Shared controls for exposure, colour, crop and rotation. |
|---|---|
| Comparison | Original and developed previews. |
| Export | PNG generation from the adjusted image. |
The full specdarkroom-photo-editor.appspec · 14 lines
<?xml version="1.0" encoding="UTF-8"?>
<APP ID="darkroom-photo-editor" NAME="Darkroom" THEME="noir-ivory" LAYOUT="desktop">
<DATA MODE="local"><COLLECTION ID="photos">[
{"id":"cover-1","title":"Architecture study","src":"media/covers/cover-1.svg","category":"Architecture"},
{"id":"cover-3","title":"Landscape study","src":"media/covers/cover-3.svg","category":"Landscape"},
{"id":"cover-5","title":"Abstract study","src":"media/covers/cover-5.svg","category":"Abstract"}
]</COLLECTION></DATA>
<STATE ID="develop" NAV="Develop" ICON="sliders-horizontal">
<PHOTO-EDITOR ID="darkroom-project" SRC="photos" MODE="develop" />
</STATE>
<STATE ID="compare" NAV="Before / after" ICON="columns-2">
<PHOTO-EDITOR ID="darkroom-project" SRC="photos" MODE="compare" />
</STATE>
</APP><APP ID="darkroom-photo-editor" NAME="Darkroom" THEME="noir-ivory" LAYOUT="desktop">
<DATA MODE="local">
<COLLECTION ID="photos">[
{"id":"cover-1","title":"Architecture study","src":"media/covers/cover-1.svg","category":"Architecture"},
{"id":"cover-3","title":"Landscape study","src":"media/covers/cover-3.svg","category":"Landscape"},
{"id":"cover-5","title":"Abstract study","src":"media/covers/cover-5.svg","category":"Abstract"}
]</COLLECTION>
</DATA>
<STATE ID="develop" NAV="Develop" ICON="sliders-horizontal">
<PHOTO-EDITOR ID="darkroom-project" SRC="photos" MODE="develop" />
</STATE>
<STATE ID="compare" NAV="Before / after" ICON="columns-2">
<PHOTO-EDITOR ID="darkroom-project" SRC="photos" MODE="compare" />
</STATE>
</APP>