The goal of this guide is to create a new backend application (using Lumber) dedicated to your Admin API. This API has everything you need to get started with Forest Admin and allows you to extend it with virtually no limitations.
The fastest and easiest way to do this is to use Docker with the image forestadmin/lumber-forestadmin.
Edit the DATABASE_URL below to match your database credentials, then run the command:
docker run \-v `pwd`:/usr/src/app --init \-e DATABASE_URL=postgres://user:firstname.lastname@example.org:5432/database_name \-e APP_NAME=MySuperAdmin \-e FOREST_EMAILemail@example.com \-ti forestadmin/lumber-forestadmin
where DATABASE_URL is your database connection string. Use the following syntax:
Other available options are:
The hostname of your admin backend app. Default is
The port of your admin backend app. Default is
Does your database require SSL. Default is
If this is not filled, your Forest Admin password will be asked interactively.
Wrap your password in double quotes if it contains special characters.
After the step 1, a new directory named with your APP_NAME has been created (
MySuperAdmin in this example).
cd MySuperAdmindocker-compose up
If you'd rather not use Docker, follow these simple steps:
npm install -g lumber-cli
Use the newly installed lumber-cli to generate your app.
lumber generate -c postgres://user:firstname.lastname@example.org:5432/my_database MySuperAdmin
postgres is your database engine (other options are mysql, mongodb, mssql,..)
user is your database user
password is your database password
host.docker.internal is your database host
5432 is your database port (defaults are 5432 for postgres, 3306 for mysql and 27017 for mongodb)
my_database is your database name
MySuperAdmin is your app's name
Navigate to your newly created app folder and install npm dependencies.
cd MySuperAdminnpm install
Now that Lumber has generated an app dedicated to your back office, let's create your Forest Admin back office!
From your app's folder (
MySuperAdmin/), install the lumber-forestadmin npm package.
npm install lumber-forestadmin --save
Install the Forest Admin plugin using Lumber
lumber install lumber-forestadmin --email email@example.com --projectName MySuperAdmin
Your Forest Admin back office is ready to be used. Launch your node server and follow the terminal instructions: