Environments

Environments in Forest Admin allow you to switch context:

  • different set of data

  • different layout configuration

Setup with 2 environments: Development and Production

Creating a new environment

To create a new environment, go to your Project settings (1):

Then from the Environments tab, click on "Add a new environment" (2).

You can only add a new staging environment once you've deployed your project to production.

Fill out the 2 fields and click "Create environment" (3).

In your newly created environment, you'll find your FOREST_ENV_SECRET:

Lastly, you need to copy your environment secret to your .env file as follows:

FOREST_ENV_SECRET=349bbac428cf2c28b5...

When you've connected at least once on your new environment, the yellow warning message will disappear.

Your .env file also contains a FOREST_AUTH_SECRET: it is a private token - chosen by yourself - used to sign the data token and protect your Admin backend.

Your .env file should not be versioned, as it depends on the environment.

Deploying to Production

Forest Admin is meant to help you manage your operations: this can only happen if you work with your Production data! To do so, you need to create your Production environment.

Click "Deploy to production" on the top banner or in the Environments tab of your Project settings.

Deploy your admin backend

On the first step, you need to input your admin backend's URL. This is the URL of the server onto which you have deployed (or will soon deploy) your admin backend's code base:

If you need help deploying your admin backend's codebase, here are 2 step-by-step guides showing how it can be done on Heroku or on a standard ubuntu server.

Note that for security reasons, your admin backend must use the HTTPS protocol.

The URL must not end with a trailing /.

Connect to your database

On the next step, you need to fill out your Production database credentials:

Your database credentials never leave your browser and are solely used to generate environment variables on the next step, so they are never exposed.

Set your environment variables

The final step requires that you add environment variables to your server. Follow on-screen instructions:

Once your node server is successfully detected and running with the indicated environment variables, a "Finish" button will appear. Click on it to finalize the creation of your Production environment.

Developing in Forest Admin

Developing in Forest Admin depends on your level of expectations:

The light & quick process

  • Make your UI changes directly in Production

  • Smart features which require code updates in your Admin backend can be developed in a Dev environment, then pushed to Production.

The safe & controlled process

Paul - a developer in your organization - is in charge of implementing a new Smart Action for the Operations team:

  • Since he wants to work from the existing layout of the Operations team, he retrieves it to his own environment "Dev - Paul":

    • From the Environments tab of the Project settings, he copies the layout configuration of the Production environment to his own environment: Dev - Paul

    • From the Teams tab, he copies the layout configuration of the Operations team to his own team (ie: Technical team)

  • He works locally on his "Dev - Paul" environment until the Smart Action is functional

  • At this point, he can deploy (his code) to production or to a testing environment (ie: staging) depending on his team's process