Chatbot Icon

September 28, 2022

Build an admin console in a day with Forest Admin

Written By

Emily Kral

Category

How to

Read time

3 minute

Build an admin console in a day with forest admin
The ability to view and manipulate a database is something that is vital to almost every organisation. Having to interact directly with the database every time any changes needs to be made is a laborious process that takes up a lot of a developer’s time. Using an admin console allows this to be much easier, and also provides a much more user friendly way to present the data.
Many companies build their own internal admin tools, which means they are extremely customisable, but also means a large amount of time needs to be spent developing an entirely internal interface. The other option is to use a pre-built admin tool. These are a great option if you want to get something up and running extremely quickly, and be able to easily add functionality as your organisation needs it. One such tool is Forest Admin, and in this post we will go through how to set up a fully functioning admin console for a PostgreSQL database in no time at all, and just a few of the things you can do with it once it’s there.

Prerequisites:

  • An existing PostgreSQL database

Setting up the project

The first thing you will need is to create a Forest Admin account. Once you have logged in, go ahead and click ‘New Project’.
Call the project whatever you choose, then click on ‘Connect a datasource’ to link it to your existing database. Choose PostgreSQL, and then fill in your database details.
Run the NPM commands to install the Forest Admin command line interface and generate the backend application:
1. Install the Forest CLI
npm install -g forest-cli@latest -s.
2. Login to the Forest CLI (will open a browser window)
forest login
3. Generate a new backend application
forest projects:create "<PROJECT_NAME>" --databaseConnectionURL "postgres://<USER>:<PASSWORD>@localhost:5432/<DATABASE_NAME>" --databaseSchema "public" --applicationHost "localhost" --applicationPort "3310" cd "PokemonProject" npm install -s
4. Run your Forest Admin backend
npm start
Now the backend is running, you can visit https://app.forestadmin.com/projects and select your project to view your database! Simple!
You can stop here, safe in the knowledge that your data is all easily viewable and searchable, but in the rest of this post we will look at a few of the standard features that Forest Admin comes with and how you can easily start to customise your console to fit your needs.

Basic features

Database manipulation

The database is fully editable using only Forest Admin. You can easily create, read, update and delete data from within the console. Any constraints on your data in the database will be transferred over (e.g. mandatory fields) as well as any relationships between tables. Relationships are shown as fields with links to the relevant fields in other tables, making the data very easy to navigate.
Each table also has settings that can be accessed by clicking ‘Edit Layout’ in the top right corner and then the cog symbol to the right of the relevant table name. From here you can edit the display name of the tables, as well as making fields read-only or changing how the data in them is displayed.

Customise the view

The default Forest Admin view has all tables and fields visible and in alphabetical order, this is not always the best way to view the data you have (as seen below). Luckily, the table view is very easily customisable to make only the relevant data visible, and in a more relevant order.

Selecting ‘Edit Layout’ in the top right corner gives you access to the Editor view. From here you can easily show and hide tables and fields as well as reorder them to give you a much more user friendly view of the data.

Filtering tables

Finally, it is very easy to filter a table to see only the data you are looking for. Forest Admin has lots of built-in filtering criteria to allow you to search for a specific category of records.
If you enter the Editor view while you are viewing a filtered table, you are given the option to ‘Save as a new segment’. Selecting this will take you to the following screen, where you can give your segment a name and a default sorting order.

So what next?

Forest Admin is a very powerful tool that can be set up extremely quickly. There are many more features that can be added to really customise it to do exactly what you need it to do. So check out the documentation for more ideas, and enjoy your new power over your data!

Share

Related posts

How did you find your chatbot experience today?

Thank you for your feedback

There has been an unexpected error, please try again later