Automatically Generate a CRUD App from Any Database in Just a Few Clicks
Tags: crud, tooling
Published: 2023-11-23 10:40:37

This tutorial will show you how to quickly generate a complete graphical application to create, read, update, and delete (CRUD) data from almost any database, including MySQL, PostgreSQL, and MongoDB, in just a few clicks.

Appsmith is an internal app platform that reduces the labor of generating user-friendly interfaces to your data, so that you can quickly iterate on new CRUD application ideas and build apps your organization can rely on.

## What is a CRUD application?

CRUD is an acronym for the basic operations that you perform on a database to interact with the data in it:

- **Create** a new row of data in a table
- **Read** one or more rows from a table
- **Update** one or more rows in a table
- **Delete** one or more rows from a table

Every application that stores data in a database is built on these basic operations. Examples of this are:

- Social media apps: create posts, read posts, update posts (add likes or comments), and delete posts
- Project management apps: create tasks, read tasks (to see the status of a task), update tasks (with comments), and delete tasks (once completed)
- Calendar apps (such as Google Calendar): create appointments, read appointments (to see what you are doing today), update appointments (if you have to shuffle meetings around), and delete appointments (if somebody has to cancel a meeting)

## Choosing the right CRUD generator to build your ideas and internal tools

No matter what kind of application you are building, it must be able to perform CRUD operations. Connecting an interface to your database and manually building all of the pages, forms, fields, and interactivity required to make your application work typically involves a lot of work. Before you start developing, you need to decide whether to [start from scratch or build using existing tools](https://www.appsmith.com/blog/build-vs-buy-when-choosing-internal-tools).

A number of tools exist to generate CRUD interfaces, but most of them are specific to a particular database platform, are not cross platform, or require further development work to work for end users. The best tool for the job allows you to quickly spin up new apps **and** completely customize their functionality.

Newer app platforms satisfy both of these requirements as they allow you to massively automate certain repetitive steps in the software development process while still having all the versatility of building from scratch.

## Appsmith automatically builds database CRUD interfaces for any database with just a few clicks

[Appsmith](https://community.appsmith.com/content/video/appsmith-100s) is one such app platform that leverages automation to allow developers to quickly spin up applications, including database front ends. Then you can use custom SQL queries and front-end JavaScript logic to interact with [back-end datasources](https://docs.appsmith.com/connect-data/reference) including MySQL, PostgreSQL, and many other popular databases.

To speed up this process even more, we’ve created a new feature that automates the creation of CRUD apps in Appsmith even further. We’ve named this feature “*Generate New Page*” because it creates an entirely new page in your application with all the widgets you’d need to perform CRUD operations on your database.

Now, Appsmith can inspect your database and **automatically** generate all of the forms and inputs required to interact with it on the front end. From there, you can tweak the application using a drag-and-drop [WYSIWYG](https://en.wikipedia.org/wiki/WYSIWYG) interface to further customize.

## How to implement a CRUD application with Appsmith in under five minutes

Assuming that you already have your database, you can create a complete application to create, read, update, and delete data with three simple steps.

### Step 1: Get Appsmith

Getting started with Appsmith only takes a minute. You can sign up for the [free cloud-hosted version](https://app.appsmith.com/user/signup) to get up and running immediately or [self-host Appsmith](https://docs.appsmith.com/getting-started/setup) on your own infrastructure.

### Step 2: Create a new Appsmith application

After you sign into Appsmith, create a new application and give it a name.

![create an application in Appsmith](https://www.appsmith.com/_next/image?url=https%3A%2F%2Fimages.ctfassets.net%2Flpvian6u6i39%2F3o16ZF0urA71aLK2GW5sPA%2Fad63717833974810b22172308e31fada%2Fimage__6_.gif&w=3840&q=75)

### Step 3: Click “Generate new page” to create your database UI

From here, you can add whatever [datasource](https://docs.appsmith.com/connect-data/reference) you want to your Appsmith application. For this tutorial, you can use the mock *users* database that ships with Appsmith. Do this by clicking **Show all datasources** under the **Datasources** section, clicking **Create new**, and then selecting the *users* database.

![add a new datasource in Appsmith](https://www.appsmith.com/_next/image?url=https%3A%2F%2Fimages.ctfassets.net%2Flpvian6u6i39%2F7rU4FmQgEEEqON1JzTohPW%2F38da0e4e386f98cc07231e6323446ade%2Fimage__7_.gif&w=3840&q=75)

Then click **Show all datasources** again, hit **Generate new page** for the users datasource, and fill in the information needed to generate your front end.

![Generate new page](https://www.appsmith.com/_next/image?url=https%3A%2F%2Fimages.ctfassets.net%2Flpvian6u6i39%2F5ppuE2ZW1N6CsQ2rfXlQLb%2Ff9922108ec4ee74336218ad546716125%2Fimage__8_.gif&w=3840&q=75)


*Et voilà*! Now you have your own complete, fully functional CRUD front end for this database.

![how to interact with the CRUD UI](https://www.appsmith.com/_next/image?url=https%3A%2F%2Fimages.ctfassets.net%2Flpvian6u6i39%2F1MSpl3sfTri62hNzXA9VCe%2F3e987de19655b7443d280e939bf608b2%2Fimage__9_.gif&w=3840&q=75)

From here, you can tweak your new database CRUD UI to your heart’s content, including hiding fields, changing field types, making text areas dropdowns, and almost anything else you could imagine. That way, you’re completely in charge of how your new app looks and behaves.

## Save time and effort when prototyping reliable production apps

Appsmith’s ability to generate a new page, automatically populated with form inputs and wired up to perform CRUD operations on the database you feed in, is a real time saver for developers.

This is perfect for interacting with databases at any level, whether you’re quickly spinning up a database front end to debug, building an internal tool that allows technical and non-technical team members to easily update a database without mistakes, or creating a full-fledged application that interacts with multiple databases.

If you want to quickly spin up your own CRUD applications from a database, [sign up](https://app.appsmith.com/user/signup) for the free cloud-hosted version of Appsmith today and give this feature a try for yourself!