const seeded = Fiona(1322672)

Examples

Fiona is very general purpose, but here are some potential use cases for generating mock data. If you are using Fiona for something else, open an issue and tell us about it.

Mock API

By agreeing the api up-front, and generating a mock api makes it possible to work on front end components whilst the api feature is being developed.

The full api can be mocked, or an existing api can be intercepted, and modified in transit, either from a small proxy server, or in the browser by monkey patching http request methods.

Fiona makes it easy to generate mock api data, and having more realistic data helps to enable rapid prototyping sometimes in place of high fidelity designs.

Mock API demo and code samples

Populate Template

Generated data can be used to populate pretty much any kind of template. You could be creating a letter template, or generating SQL to populate a development database.

It's possible to generate template output directly by inserting functions to render data inline, but by using a two step process of generating the model, and then applying it to the template, there are some benefits.

  • multiple templates can be populated from one model
  • the model can include information used to derive the template output that does not appear in the output
  • the template can consume data from other sources
Populate Template demo and code samples

Image Placeholders

Using placeholder images can help to design layouts, by doing for graphics, what lorem ipsum does for text.

By making placeholder images repeatable, visual diff tools will not be broken, and they can be used for any testing that requires reproducing of same scenario.

Image Placeholders demo and code samples