Enterprise Portal - Quick Start

Over the last few months, we have been working on something very exciting and we are finally getting there. It uses the features of ReactJs, Reactforce and Salesforce.

Introduction

Enterprise portal uses MonoRepo architecture to build multiple react apps.

Prerequisites

This guide assumes you Nodejs and SFDX CLI installed.

Setup a Developer Environment

# Install via NPM
sfdx plugins install @cloudpremise/reactforce@latest

# Accept the plugin
This plugin is not digitally signed and its authenticity cannot be verified. Continue installation (y/N) 
y
...
...
...
Installing plugin @cloudpremise/reactforce... installed v0.0.81

Common CLI Flags

Flag
Short
Type
Default
Description

--app-name

-a

string (required)

Name of the app to create. Use letters, numbers, and hyphens; max ~30 chars.

--template-name

-t

string

default

Template folder/name inside the templates repo to use when scaffolding.

--repository

-r

string

cloudpremise/reactforce-templates

GitHub repo (owner/name) containing Reactforce templates.

--branch

-b

string

main

Branch in the templates repo to clone.

--ssh

-S

boolean

false

Clone the template repo via SSH instead of HTTPS.

Build Your Application Scaffolding

We are currently not ready with application scaffolding but once we have stable version of it, we'll scaffold it for new projects.

Iris Project Setup

Use below command to create new Iris project.

Use below command to create new iris child app. Run this command from root of the iris project.

Develop Your Plugin

A plugin requires two main files package.json which contains basic information about the plugin and index.tsx contains plugin definition.

An example how package.json should look like.

An example how index.tsx should look like.

From above index.tsx code you can see it provides basic information about plugin, routes, different types of menus and a render method which directly gets invoked into the application tree. It can be used to add application level styles, libraries, fonts etc.

Here is what index.tsx in plugin's src folder. It currently exports just the information from config folder which connects whole plugin with the application through menus and routes.

Please use below directory structure for new plugin development.

You can use below commands to generate, install, remove, enable and disable different plugins. You have to run most of these commands from root of your react app.

Once you have your plugin generated, you can start the development and publish to github repository. Anyone having access to your repository can install your plugin in any Enterprise Portal project.

If plugin is already installed in your project, you can use following commands to enable/disable any of the plugins.

Build Your App

Our architecture uses npm workspaces to share npm modules across different react apps. All of the react apps reside in reactforce folder.

Deploy Your App

Once you have your build ready, copy it into static resources directory and deploy it to your org.

Last updated