In today's world, software applications are composed of two key components: the front-end (what the user sees) and the back-end (the logic and data behind the scenes). Xano is a no-code platform that allows you to build and manage the back-end, while UiFlow is a visual front-end web app development tool. By using these two platforms together, you can create scalable and powerful web applications without writing code.
In this guide, we'll walk you through the process of connecting Xano and UiFlow to build a Customer Relationship Management (CRM) application. We'll start by setting up the necessary database schema and APIs in Xano, and then use those APIs to fetch data and display it in a UI built with UiFlow.
Setting up the Database Schema in Xano
- Sign in to your Xano account and navigate to the Database section.
- For our CRM application, we'll need two main tables: `deals` and `contacts`. The `deals` table will store information about each sales deal, including the deal title, value, currency, stage, and the associated contact. The `contacts` table will hold the details of potential clients.
- Xano provides a visual interface for creating and managing your database schema. You can add new tables, define fields (such as text, numbers, dates, etc.), and set up relationships between tables.
- Once you've created the `deals` and `contacts` tables, you can view the table relationships by clicking the "Table Relationships" button in the top-right corner. This will show you that each deal is associated with a contact.
Creating APIs in Xano
- After setting up the database schema, you'll need to create APIs that UiFlow can use to interact with your data. Xano automatically generates CRUD (Create, Read, Update, Delete) APIs for each table you create, but you can also customize these APIs to suit your needs.
- In the APIs section of Xano, you'll find the pre-generated APIs for your `deals` and `contacts` tables. For now, we'll focus on the "Query Contacts" API, which will allow us to fetch all the contacts from the database.
- Click on the "Query Contacts" API to open the Function Stack Builder. This is where you can configure the API's behavior, such as adding input parameters or modifying the output.
- Since we want to retrieve all contacts, no input parameters are required. The output will be an array of contact objects, which we can then display in UiFlow.
- You can test the API by clicking the "Run" button. This will execute the API and show you the response data, which should be a list of all contacts in your database.
Connecting UiFlow to Xano
Now that we have our database schema and APIs set up in Xano, it's time to connect UiFlow and start building the front-end UI.
- Sign in to your UiFlow account and create a new project.
- In the UiFlow Studio, you'll see three main workspaces: Design, Connect, and Logic.
- Start by designing the UI for your contact cards in the Design workspace. You can drag and drop components from the left-hand panel, such as containers, text elements, and collections (for displaying repeated items).
- Once you've designed the basic contact card layout, switch to the Connect workspace.
- In the Connect workspace, click "Add a new data connection" and select "Xano Database" from the list.
- Enter the base URL for your Xano API group and choose the "List" action, which corresponds to the "Query Contacts" API we created earlier.
- Give your connection a name (e.g., "Get All Contacts") and click "Send" to test the connection. You should see the list of contacts returned from the API.
- After successfully testing the connection, publish it to the Logic workspace.
- In the Logic workspace, you'll use UiFlow's visual programming language to connect the API data to your UI components.
- Start by creating an "On Page Load" event and dragging in the "Call API" node, which will be your Xano connection.
- Next, drag in your collection component (the one you designed for displaying contact cards) and connect it to the successful API call node.
- Double-click the collection component to enter its context, and then drag in the individual text elements (e.g., contact name, email, company) from your design.
- Map each text element to the corresponding data field from the API response by dragging the data node onto the text element node.
- Finally, preview your application to see the contact cards populated with data from the Xano API.
By following these steps, you've successfully connected Xano and UiFlow, allowing you to build a front-end UI that dynamically displays data from your back-end database. This is just the beginning, as you can continue to add more functionality, such as creating, updating, and deleting records, implementing authentication, and integrating with other services.
Using Xano and UiFlow together provides a powerful and scalable solution for building web applications without writing code. Xano handles the back-end logic and data management, while UiFlow allows you to visually design and create complex front-end UIs. This decoupled approach streamlines the development process, reduces potential bottlenecks, and enables teams to work more efficiently on different components of the application.