How to create a directory app without code

A directory is a crucial tool for organizations looking to effectively manage their resources. It provides a centralized database that streamlines processes and enhances communication, resulting in a more efficient and productive workplace.

Retool empowers users to work with their existing data sources and seamlessly connect to their Baserow database. With Retool, building internal tools becomes fast and easy. Teams can utilize Retool to create custom apps, dashboards, admin panels, and other internal tools for critical operations while conveniently saving and editing data in their Baserow database.

Baserow is a modern, no-code, and open-source database builder that enables users to create tables, manage data, and collaborate with others. By integrating these two platforms, users can effortlessly streamline their workflow and enhance data management. With Retool, you have complete control over your data as you directly work with your own Baserow databases.

What you’ll need

What we’ll cover

In this tutorial, you will learn how to create a customized backend with the Baserow API. You can use an existing database to create a central data source within your organisation.

  • Create a database in Baserow
  • Create a Baserow database token to securely connect to Retool
  • Connect a REST API resource in Retool
  • Create an app in Retool
  • Query API
  • Invite database collaborators

Why build with Baserow

Baserow is an open-source database tool that offers a range of benefits to businesses, making it a powerful and flexible choice. With its scalability, security, customization, and versatility, Baserow provides a reliable platform for developing robust database applications.

  • Baserow can handle large amounts of data and users, making it appropriate for businesses of all sizes.
  • As data sets expand, database speed and stability become critical to user experience. Baserow’s scalable architecture ensures consistent performance, even with large data sets.
  • Baserow’s data storage can be kept entirely on internal servers, improving businesses’ privacy and security.
  • Baserow offers a customizable platform, enabling users to build and expand their database applications to meet specific requirements.
  • Baserow easily integrates with other no-code tools, offering a comprehensive and versatile platform for building no-code stacks.
  • Developers can seamlessly integrate Baserow with other tools and services using APIs, webhooks, and plugins, allowing them to build complex and powerful applications with ease.

Let’s get started!

1. Create a database in Baserow

First, we’ll create a workspace called 'Retool App’ on Baserow. On the Dashboard page where you can see an overview of all your workspaces and databases, click the + Create workspace button. This button will also be visible in the sidebar.

Next, we are going to create a database in the Retool workspace to store data. Click + Create new then select Database from the dropdown option. Input a name for the new database and click the From template option:

https://baserow-backend-production20240528124524339000000001.s3.amazonaws.com/pagedown-uploads/943a78fd-d47d-4074-83cd-fb58816bb2d0/f79511f92d9e3abea988a2c9d9d144b6bb5b2ea9.webp

By using a Baserow database, all relevant employee information can be stored in a centralized location, making it easy to access and update as necessary. This can include basic information such as names, job titles, and contact information, as well as more detailed information such as job responsibilities, performance evaluations, and attendance records.

2. Create a Baserow database token

Before building your app, we’ll need some data to build with. Retool connects to all your databases and APIs, including our built-in database.

We need to authenticate with the database token before we can connect the data to Retool. Let’s begin with linking the Baserow account to authenticate the database token.

  1. Go to your profile, then navigate to your Settings page
  2. Click on the Database Tokens tab
  3. Click on the Create token + button
  4. Input the name and select an existing workspace
  5. Click on the Create token button to create a new database token for the selected workspace and for the authorized user.

The user’s database access privileges are defined by the database token permissions. If you accidentally expose your database token to the public, we recommend that you generate a new one as soon as possible.

https://baserow-backend-production20240528124524339000000001.s3.amazonaws.com/pagedown-uploads/30971ce0-6e12-4864-98cf-b1bac0f5e582/ec658457e0dba9cec6a521f0b6010f2b52d8b224.webp

After you have created your database schema and API key in the settings, your Baserow database provides its own REST API endpoints to create, read, update and delete rows.

The database documentation is generated automatically based on the tables and fields in your database.

To get the API documentation, click on the vertical ellipsis ⋮ beside the selected workspace and select ‘View API Docs’ from the workspace menu.

Retrieve the base URL of the API you want to connect to, URL parameters, headers, etc.

Next, let’s add Baserow a resource to use in your Retool apps.

3. Connect a REST API resource in Retool

Log in to Retool and navigate to the Resources tab.

Resources let you connect to your Baserow database or API. A resource **determines how Retool connects to a data source. You can connect your Baserow database and make it available as a resource in your Retool organisation, allowing you to connect to any database or API.

Navigate to the Resource page. Click Create newCreate a new resource and select REST API to create a REST Query resource.

https://baserow-backend-production20240528124524339000000001.s3.amazonaws.com/pagedown-uploads/fb7c3103-fc76-40d4-aa44-a85921d4a45c/9075533a7e155df48bdcaf7c48e27bf0b89b7ca4.webp

Next, connect a resource, API authentication and pass URL parameters, headers, etc.

Configure REST API

On the Connect a resource page, add your connection information.

  1. Set the name as ‘Baserow DB’. This will be the name for this resource when creating queries in the Retool editor.
  2. Set the base URL as https://api.baserow.io for the hosted version or self-hosted URL
  3. Add query parameters from your database API documentation
  4. Add the token authentication Authorization: Token YOUR_DATABASE_TOKEN as a global header. All your API requests that use the resource will have the right auth headers sent over.

After you enter your connection details, click Create resource and then Create an app to open the App editor.

https://baserow-backend-production20240528124524339000000001.s3.amazonaws.com/pagedown-uploads/5ee1ed35-b1dc-4b75-b2a8-c4709da43b49/Screenshot\_2023-03-02\_at\_20.17.19.png

After creating a resource for the data source you want to use with Retool. You can select the resource when writing a query so you can interact with the data.

4. Create an app in Retool

Next, create an app to start building with your Baserow DB data.

https://baserow-backend-production20240528124524339000000001.s3.amazonaws.com/pagedown-uploads/f2708075-974f-4e3c-950a-684f332fdc1c/Screenshot\_2023-03-02\_at\_18.22.26.png

For this tutorial, we’ll create a simple app. Add a table with the same columns/fields corresponding to our database. Next, we want to add databases to Retool and make them available to query.

5. Query API

We need to connect the resource with the data we want to read. Let’s test the list row endpoint retrieved from the API docs - https://api.baserow.io/api/database/rows/table/145505/?user_field_names=true

When the App editor opens, query1 is created automatically with the resource you added. You can see this in the Resource dropdown in the query editor.

  1. Select the resource created earlier - Baserow DB.
  2. Set the method as POST
  3. If needed, you can update query1 with additional URL parameters, headers, etc. from the API doc - page, size, search, order_by, filter__{field}__{filter}, filter_type, include, exclude, view_id.

To query your API, click Save & Run.

https://baserow-backend-production20240528124524339000000001.s3.amazonaws.com/pagedown-uploads/c3084937-a117-4a7f-9f24-36478cb912d1/Screenshot\_2023-03-02\_at\_19.11.17.png

6. Invite database collaborators

Thanks to collaborative databases, you can establish communication across departments - marketing, sales, technical support, clients, vendors, and distributors.

You can create a secure web application that lets you choose which users can access the database. It’s easy to collaborate with data in real-time.

To invite collaborators to your workspace and grant relevant access:

  1. Switch to the Ret_ool_ workspace from your Baserow dashboard or by using the sidebar.
  2. Click the vertical ellipses  icon in the right corner next to the workspace name
  3. Click Members.
  4. Input the collaborator’s email address and choose either the Admin or Member permission types.

https://baserow-backend-production20240528124524339000000001.s3.amazonaws.com/pagedown-uploads/8b7dc502-c842-4dad-b776-9d5a824e6e61/Screenshot\_2023-03-02\_at\_19.14.47.png

Baserow Advanced and Enterprise plans come with advanced user management to restrict access by assigning roles to users in workspaces, databases or tables. Roles permit users to execute operations as an Admin, Builder, Editor, Commenter, or Viewer.

Key takeaways

This step-by-step guide on how to build a custom backend with the Baserow API can be adapted to create a powerful backend database for any app.

By using a database, all relevant employee information can be stored in a centralized location, making it easy to access and update as necessary. This can include basic information such as names, job titles, and contact information, as well as more detailed information such as job responsibilities, performance evaluations, and attendance records.

In case you’ve run into an issue while following the tutorial, feel free to reach out to ask for help in the Baserow community.

What’s your use case? Tell us how you use Baserow