Getting started with WebApps
A WebApp is simply a predefined file structure. Please refer to Sitevision's GitHub repository, for example code.
- index.js *mandatory
- The starting point for a WebApp. This is where route configuration is set up. The concept is influenced by Express.js.
- main.js *mandatory
- The main component. Starting point when a WebApp is rendered.
- reducer.js
- Updates the WebApp's state. Read more about state management here.
- Updates the WebApp's state. Read more about state management here.
- hooks.js
- Allows for code execution before page rendering starts
- manifest.json *mandatory
- The manifest contains metadata for a WebApp, such as version and id.
- template/ *mandatory (at least one template)
- Put templates in this directory. WebApps use underscore templates.
- component/
- Put components in this directory.
- i18n/
- Put i18n bundles in this directory using a JSON format. The name of the file decides the language.
- module/
- server/
- JavaScript modules that will be executed server side. SiteVision's Public API may be used here, but not objects bound to the browser context.
- client/
- JavaScript modules that are used client side.
- common/
- JavaScript modules that are used both client and server side.
- JavaScript modules that are used both client and server side.
- server/
- config/
- Put configuration files here. Valid configuration files are:
- index.html
- config.js
- config.css
- Put configuration files here. Valid configuration files are:
- css/
- Put CSS-files in this directory. Files in this directory will be combined into a single CSS-file.
- Put CSS-files in this directory. Files in this directory will be combined into a single CSS-file.
- resource/
- Put static resources, such as images, in this directory.
A client SDK is provided to facilitate working with HTTP-requests and URLs.
Did you find the content on this page useful?