Building apps with NocoDB
No Code, No Problem
NocoDB lets you build useful applications without writing a single line of code.
No-code platforms are all the rage nowadays, and it's not that hard to see why. They make it possible for anyone to create applications for their specific needs in no time and save serious money in the process. Even if you have coding chops, you may find a no-code solution useful for whipping up a quick prototype or a simple application instead of building it from the ground up.
While there are several open source no-code platforms to choose from, NocoDB [1] strikes a perfect balance between functionality and user-friendliness. It's also supremely easy to deploy, which makes it a perfect platform for building simple and more advanced applications.
Deploying NocoDB
The easiest way to deploy NocoDB on a local machine is by using the NocoDB Docker container image. The first step is to install Docker. To do this on Ubuntu and Linux Mint, run:
sudo apt install docker
To be able to run Docker as a regular user, add the current user to the Docker group using the command:
sudo usermod -aG docker $USER
Reboot the machine, and you're done.
Next, create a dedicated directory for storing NocoDB data (e.g., ~/nocodb
). This ensures that even when you delete a NocoDB container, your data remains intact.
Finally, run the following command in the terminal (replacing /path/to/nocodb
with the actual path to the data directory) to start the NocoDB container:
docker run -d -p 8080:8080 --name nocodb -v /path/to/nocodb:/usr/app/data/ nocodb/nocodb:latest
Upgrading NocoDB
Because NocoDB is deployed as a container, upgrading the platform is a matter of deleting both the container and the image:
docker stop nocodb docker rm nocodb docker rmi nocodb/nocodb:latest
You then rerun the command you initially used to start the NocoDB container above to automatically fetch the latest NocoDB image.
Creating a NocoDB Application
Point your browser to 127.0.0.1:8080 (replace 127.0.0.1 with the actual IP address of the machine running NocoDB), and you should see the welcome page. When prompted, create a user account.
NocoDB makes it possible to create a wide range of applications, from a simple task manager to a more complex note-taking tool consisting of several connected tables. Building a note-taking tool as your first project may sound like a daunting proposition, but it demonstrates how easy it actually is to turn ideas into working applications using NocoDB. This project also provides a perfect opportunity to master most of NocoDB's features. In addition to storing notes, this note-taking application project will allow you to attach files to each note, assign tags, and group notes into categories.
The first step is to create a new application and populate it with tables. After you've created an account, NocoDB displays the My Projects dialog (Figure 1). Click New Project and select Create. Give the project a descriptive name and press Create. This drops you into the Team & Auth section, with your owner account automatically added to the project. If you want to invite other users to the project, press New User, add their email addresses, choose the desired role, and press Invite.
Now it's time to create tables. Our application needs three tables: Notes for storing notes, Categories for storing notebook categories, and Tags for storing tags.
To create a table, click the Add new table icon (+) next to the Tables entry in the left sidebar. Name the table Notes and make sure that only the id field is enabled under the Add Default Columns section (Figure 2). Press Submit to create the table. This drops you into the Notes table, where your first task is to add the required fields (or columns in NocoDB's terminology). Click the + icon in the table's header row, name the column Title, choose SingleLineText from the Column type drop-down list, and press Save. In a similar manner, add another field named Note, but instead of SingleLineText, choose LongText as the column type. Create yet another column named Attachments with the Attachment column type.
The table needs two more columns, but before you can add them, you need to set up two more tables. Create as described a table named Categories. Add a field called Category with the SingleLineText column type. Now, click on the triangle next to the Category field and choose Set as Primary value. This sets the Category column as a unique identifier of each record (or row in NocoDB's terminology). In practical terms, this makes it possible to link from a column in the Notes table to the Category column in the Categories table. If this sounds a bit confusing, don't worry, it will become clear in a moment. Switch to the Notes table, add a new column called Categories, and set its type to LinkToAnotherRecord. Make sure the Many to Many option is enabled, choose Categories from the Child Table drop-down list, and press Save (Figure 3). This creates the Notebook column linked to the Category column in the Categories table.
Use the same procedure to set up a table called Tags. Add the Tag column to the table and set the column as the primary value. Switch back to the Notes table, add a new column called Tags, and set its type to LinkToAnotherRecord. Make sure the Many to Many option is enabled, choose Tags from the Child Table drop-down list, and press Save.
The basic skeleton of the note-taking application is now ready. To test it, switch to the Categories table, and use the Add new row button in the table view to add two or three rows with the desired categories (e.g., Research, Ideas, Scraps, etc.). Add a few rows to the Tags table too. Switch to the Notes table and add a new row. Enter text in the Title and Note fields. To add an attachment, click on the + icon in the Attachments field and select one or more files. Because the Categories field is linked to the Category column in the Categories table, you cannot enter text directly into the Categories field. Instead, click the + icon and you should see a list of the existing values in the Categories table. Click on the desired value to add it to the row in the Notes table. With time, the number of rows in the Categories table can become rather long, but you can quickly locate the desired value by typing its name into the Filter query field and pressing Enter.
If the desired value in the Categories table doesn't exist, you can add it directly from the Link Record dialog. Press + New Record, specify the desired category name, and press Save row.
At this point, the application looks and behaves pretty much like a spreadsheet. The Search field in the top toolbar can be used to quickly find records matching the search term. Using the Sort drop-down list, you can sort rows by the desired field, while the Filter feature allows you to define and apply filtering rules (Figure 4). While you can invite other users to collaborate on the application, you can also share the current view with anyone. This can be useful if you'd like to allow someone to access a specific part of the application without requiring the recipient to register or provide any information. Pressing the Share View button generates a private link that you can share with anyone; you also can protect the view with a password if so desired (Figure 5). Keep in mind, though, that because NocoDB is running on your local machine, the private link only works on your local network. You also need to replace the localhost part of the link shown in Figure 5 with the actual IP address of the machine running NocoDB.
Finally, using the options available under More, you can export data in a comma-separated file, as well as import existing data into the current table.
The default Grid view is fine for viewing, searching, and sorting rows, but it's less suitable for entering data. This is where the Form view comes into the picture. Select Form under the Create a View section in the right sidebar, give the view a descriptive name, press Submit, and NocoDB generates a ready-to-use form that requires only minor tweaking (Figure 6). Add a title and a short description, and you're pretty much done. Normally, you'd want to include all fields in the form, but if that's not the case, you can hide the individual fields by dragging them off of the form. You can also rearrange the fields in the form by dragging them up or down. It's also possible to configure the form's behavior after the data has been submitted. As with other views, you can share the Form view with anyone, thus giving external contributors the ability to submit data.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Gnome Fans Everywhere Rejoice for the Latest Release
Gnome 47.2 is now available for general use but don't expect much in the way of newness, as this is all about improvements and bug fixes.
-
Latest Cinnamon Desktop Releases with a Bold New Look
Just in time for the holidays, the developer of the Cinnamon desktop has shipped a new release to help spice up your eggnog with new features and a new look.
-
Armbian 24.11 Released with Expanded Hardware Support
If you've been waiting for Armbian to support OrangePi 5 Max and Radxa ROCK 5B+, the wait is over.
-
SUSE Renames Several Products for Better Name Recognition
SUSE has been a very powerful player in the European market, but it knows it must branch out to gain serious traction. Will a name change do the trick?
-
ESET Discovers New Linux Malware
WolfsBane is an all-in-one malware that has hit the Linux operating system and includes a dropper, a launcher, and a backdoor.
-
New Linux Kernel Patch Allows Forcing a CPU Mitigation
Even when CPU mitigations can consume precious CPU cycles, it might not be a bad idea to allow users to enable them, even if your machine isn't vulnerable.
-
Red Hat Enterprise Linux 9.5 Released
Notify your friends, loved ones, and colleagues that the latest version of RHEL is available with plenty of enhancements.
-
Linux Sees Massive Performance Increase from a Single Line of Code
With one line of code, Intel was able to increase the performance of the Linux kernel by 4,000 percent.
-
Fedora KDE Approved as an Official Spin
If you prefer the Plasma desktop environment and the Fedora distribution, you're in luck because there's now an official spin that is listed on the same level as the Fedora Workstation edition.
-
New Steam Client Ups the Ante for Linux
The latest release from Steam has some pretty cool tricks up its sleeve.