An Introduction to ipa-core
How an ipa-core Based Client Works#
An ipa-core web client relies on a user config to define how it should build the web client's interface and to which business logic (or scripts) it should use when interacting with Twinit.
A user config is a JSON configuration file that must have at least three sections:
- A section describing how to group the client's pages in the navigation bar on the left: groupedPages
- A section specifying which of the pages is the client's default homepage: homepage
- A section specifying the detailed configuration for each page, including the business logic, or scripts, that should be loaded and used for the page: handlers
Here is an example of the minimum user config that would result in an empty client.
{ // these are the page specific configurations for pages in the apps "handlers": { }, // this specifies the default landing page from the set of handlers "homepage": { }, // this specifies the organization of the handlers in the navigation pane "groupedPages": { }
}You will create an empty user config in later step.
There are other sections you can add to the user config as well, that allow you to load certain business logic when your client loads, or sets certain configuration options you may want to use across different handlers, or even change whether the Navigation and Header bars are displayed.
Your user configs should have a _userType that identifies them as matching your web client application, since it is possible to have multiple user configs associated to the user group for different clients.
The Benefits of Using ipa-core#
By using ipa-core to build a Twinit web client, you can take advantage of a framework that does a lot of the basic integration with Twinit for you yet also allows you to extend it with your own components and pages.
The ipa-core framework will:
- Handle user authentication for you; redirecting users to sign in on Twinit and then redirecting them back to your application
- Handle project and user group selection for you; displaying only the projects for your application and user groups with a user config matching your application's _userType
- Handle user config loading and parsing for you; building the user interface and loading business logic as specified by the user config
- Provide an empty web application you can extend with your own pages and components
- Provide you with generic, reusable, and configurable components
As a result, however, ipa-core is also opinionated. You must use 'Projects' on Twinit and not just 'Workspaces'. You must have user configs that follow the structure that the ipa-core framework requires and you must associate those user configs to user groups.