Erasmo Marín
Aug 27, 2017 · 1 min read

Hi Alec, i’m glad the article was useful for you.

You can represent any website structure using a JSON. This is a very simple example:

The way you represent it is something you can do it in your own way based on your needs, but basically you can think in a website as a group of sections. Every section can have one or more components and a route. Every component at the same time can have more than one children component, so it’s like a tree structure (but not all components accept children).

You can pass props to those components; for example, I pass parameters to load data from an API REST.

The most complicated part of this are interactions. I implemented a “triggers” mechanism where I can tell the parser component where should a user be redirected when an action occurs (section changes). Also components can listen to those triggers to do something. Triggers are defined in the json itself.

You can even set a theme in the json, so you can change colors, fonts and other details per component.

)

    Erasmo Marín

    Written by

    Software engineer from Chile, front end developer, React lover. I do incredible things at SmartboxTV.