How to
Written By
Emily Kral
Date
2 years ago
Read time
3 minutes
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.
An existing PostgreSQL database
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.
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.
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.
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.
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!
Using Forest Admin: smart field display
2 years ago
How to
Implementing Forest Admin Smart Actions
3 years ago
How to
Using Forest Admin: smart field display
2 years ago
How to
Implementing Forest Admin Smart Actions
3 years ago
How to
Subscribe to our newsletter
Your may unsubscribe from these communications at any time. For information please review our privacy policy.