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
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)
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"
npm install -s
4. Run your Forest Admin backend
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.