<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Jacob Yeger on Medium]]></title>
        <description><![CDATA[Stories by Jacob Yeger on Medium]]></description>
        <link>https://medium.com/@jacob.yeger?source=rss-7c94585298c5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*QXBkxgkzRX0z-0CEhWDrew.jpeg</url>
            <title>Stories by Jacob Yeger on Medium</title>
            <link>https://medium.com/@jacob.yeger?source=rss-7c94585298c5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 09:56:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jacob.yeger/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Creating a UI Infrastructure for Backend Developers — Part 2]]></title>
            <link>https://medium.com/bigidev-bigid-engineering/creating-a-ui-infrastructure-for-backend-developers-part-2-a22562cde09d?source=rss-7c94585298c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/a22562cde09d</guid>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[node]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[full-stack]]></category>
            <dc:creator><![CDATA[Jacob Yeger]]></dc:creator>
            <pubDate>Sun, 31 Jul 2022 08:16:32 GMT</pubDate>
            <atom:updated>2022-07-31T08:16:32.581Z</atom:updated>
            <content:encoded><![CDATA[<h3>Creating a UI Infrastructure for Backend Developers — Part 2</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s53UDDbv_V_xi2M7BguvFA.png" /></figure><h3>Introduction</h3><p>Welcome to part 2 of the series in which I am expanding upon an interesting use-case we had at BigID for moving react form logic to the backend. This enables the generation of new forms on the fly without much investment in front-end development. In case you missed it, here is <a href="https://engineering.bigid.com/creating-a-ui-infrastructure-for-backend-developers-part-1-e6fdf7e0905a">part 1</a> where I covered the backend logic. Now, let’s take a deep dive into the underlying UI infrastructure.</p><p>We will accomplish the UI portion of this project in three main stages:</p><ol><li>Fetching the form template data from the backend.</li><li>Creating a function to generate the fields in the UI by mapping from field type to component</li><li>Creating a context to manage the state of the form in all its stages: from creating the fields to validation and submission.</li></ol><h3>Overview</h3><p>The UI side of the infrastructure is made up of higher order components. These are components which accept components, perform some form of processing, and return other components. This is a React design pattern that enables more generic/extendable components. You can learn more about the pattern <a href="https://reactjs.org/docs/higher-order-components.html">here</a>.</p><p>In our case, the higher order component will receive some field component along with the template created in the backend. It returns new form field populated with that data. This means that adding a new type of field is as simple as creating a new component! The components sit on the client side and only need to receive data from the backend to fill in the props. This style allows us to add new fields without needing to touch existing components, reducing chances of regression. Here is a sample of field interface to be populated with data from the backend</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/82dbba6b736021ef86f725aa26f4bd0f/href">https://medium.com/media/82dbba6b736021ef86f725aa26f4bd0f/href</a></iframe><p>We can of course extend it as needs grow to include new logic:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d52b87fea329b8e60d7c76efb28b9b99/href">https://medium.com/media/d52b87fea329b8e60d7c76efb28b9b99/href</a></iframe><p>The aim is to store declarative information about relationships with other fields in the fields themselves. This enables us to make complex UI hiding / showing / blocking, etc. with fields depending on the state of other fields. All of this logic is received from the backend as well. For example, if we want to offer two methods of authentication for a specific data source, credentials or username/password. We have a field called <em>useCredentialOrNamePass</em> which is a pair of radio buttons where each option corresponds to a different method of authentication.</p><p>Here is how that would look using our declarative JSON notation in the backend:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/17808a8d7df3c4aa98046ba0239ca586/href">https://medium.com/media/17808a8d7df3c4aa98046ba0239ca586/href</a></iframe><p>Here, the credentialID<em>, </em>username<em>, and </em>password fields’ visibility are dependent on the value selected in the useCredentialOrNamePass field. Then, when displaying the fields we can check these visibility conditions in the client (more on that in the code deep dive section).</p><p>We then use a map from the type of field to the component to be displayed so that we can quickly replace components as necessary. Say, we want to change the look of our checkbox. We would simply insert the new checkbox component into the mapping and it would be changed across all forms. Or, if we decide to change the checkbox to some other component entirely to represent a boolean field we can do it from within the map. Here is a sample of the mapping used for the types of fields to their respective components.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/575c573be2af3b7de669babf89040823/href">https://medium.com/media/575c573be2af3b7de669babf89040823/href</a></iframe><p>Notice, for instance, that string and stringLong types both map to BigidFormFieldText- we reuse the same component for both but pass different sizing options as well as stylings and validation. This exemplifies the extensibility this pattern incorporates as we can customize the props each component receives. We created a new type of “backend component”, adding different props to the template under a new name, with only one simple change in the frontend.</p><h3>Lets dive a little deeper into the code</h3><p>In this section I am going to show some code to illustrate the processes involved in taking the templates we are generating in the backend and animating them into React components on the client side.</p><p>Our first step is to create a context to hold the field metadata along with the state of the form.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/89eb9c8fd34bc7bdcd19d09ad419cfd9/href">https://medium.com/media/89eb9c8fd34bc7bdcd19d09ad419cfd9/href</a></iframe><p>In this example I am holding the bare minimum, a flag to know if the data is loading, an array of fields to be rendered and an updateFields function to handle changes in the form.</p><p>Next let’s create a function to call our endpoint (created in <a href="https://engineering.bigid.com/creating-a-ui-infrastructure-for-backend-developers-part-1-e6fdf7e0905a">part 1</a>) and get the field metadata so we can generate the fields.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/362f43f84c509015cfb592ab1c3dd228/href">https://medium.com/media/362f43f84c509015cfb592ab1c3dd228/href</a></iframe><p>Now, we will need to create the generateFields function which will render them on the client side.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/72c3612ff5828a712a52da42c53dafbf/href">https://medium.com/media/72c3612ff5828a712a52da42c53dafbf/href</a></iframe><p>Notice we have all the basic needs for any form infrastructure here, from visibility/enabled conditions to validation to customization etc. This will all help to ensure that the form components work in the way we expect.</p><p>We can then add utility functions to use the information stored in the fields. Let’s take a look at how such utility function can be implemented which conditionally enables the visibility of the fields:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/58668ee334028dee608d090bda43ae18/href">https://medium.com/media/58668ee334028dee608d090bda43ae18/href</a></iframe><p>By storing the information about these relationships within the fields themselves, we avoid the use of methods like javascript’s <em>eval </em>which come with a myriad of security concerns with <em>xss. </em>This gave us more control and flexibility with our forms.</p><p>Form validation is done on a per field basis, if a field is designated as needing validation the conditions based on regexes are received from the backend. This allows us to either check a single field or several, depending on what the form requires, before submission. At this point we have everything we need to plug our fields into our form component.</p><p>Finally, we will put it all together in our <em>DataSourceConfiguration</em> component:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/80c26fb40fba6ac8b6c567c9d268a7bc/href">https://medium.com/media/80c26fb40fba6ac8b6c567c9d268a7bc/href</a></iframe><p>We fetch the field info and form metadata from the backend and store it in our context. We then pass all of this information to our BigidForm component which contains handles all the logic of processing and submitting the form. And that’s it! We have now covered, end-to-end, the moving of form creation logic to the backed leveraging full stack capabilities in React.</p><p>This methodology can, of course, be implemented with of your favorite form frameworks/libraries by making adjustments to what information is stored on a per field basis and by adding to the form context. This example is meant to be a bare-bones illustration of the underlying method. At this point, the form component is populated with fields and all the metadata it needs. Now all that’s left is to style the components the way you like and voila, you have your extremely generic form.</p><h3><strong>Closing words</strong></h3><p>By using this methodology at BigID, we are able to create a form for a newly added data source in under an hour — and without a line of frontend code! I hope that by expanding upon our use-case, you have learned something new about working with higher order components in React and can find a way to incorporate all of or part of this methodology into your own projects. Until next time!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a22562cde09d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bigidev-bigid-engineering/creating-a-ui-infrastructure-for-backend-developers-part-2-a22562cde09d">Creating a UI Infrastructure for Backend Developers — Part 2</a> was originally published in <a href="https://medium.com/bigidev-bigid-engineering">BigIDEV — BigID Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a UI Infrastructure for Backend Developers — Part 1]]></title>
            <link>https://medium.com/bigidev-bigid-engineering/creating-a-ui-infrastructure-for-backend-developers-part-1-e6fdf7e0905a?source=rss-7c94585298c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/e6fdf7e0905a</guid>
            <category><![CDATA[fullstack-development]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Jacob Yeger]]></dc:creator>
            <pubDate>Wed, 27 Apr 2022 06:44:16 GMT</pubDate>
            <atom:updated>2022-04-27T06:44:16.337Z</atom:updated>
            <content:encoded><![CDATA[<h3>Creating a UI Infrastructure for Backend Developers — Part 1</h3><p><strong>By Leveraging Node/React full-stack capabilities</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/0*AXpLuC3gZFay3LT0.png" /></figure><h4>Introduction</h4><p>Creating forms is no easy task, even for a seasoned frontend developer. Now ask a backend developer to do it and frustration will surely ensue. This particular issue led us to create an infrastructure that leverages React/Node full-stack capabilities to allow forms to be automatically generated based on input from the backend of our application. This leads to an intuitive, clean development experience for the backend developers so they can focus less on design and more on business logic.</p><p>The main considerations we addressed by creating a backend UI infrastructure are threefold:</p><ol><li>There needs to be an easy way to add new, customizable data source definition forms.</li><li>The developers making the backend UI infrastructure might not have frontend development experience.</li><li>Considering that the UI is client-side, generating X forms would likely affect optimization, so the heavy lifting should be done server-side.</li></ol><p>In what will be a series of articles, I’ll address these issues as I cover the implementation of this system both in the backend (Node) and the frontend (React).</p><h4>Problem overview</h4><p>At BigID, we work with a large number of different data sources, scanning them to find sensitive data, providing organizations an ability to look across structured, unstructured, Big Data, cloud, and apps with a single tool.</p><p>The process of writing a new form in the UI for each data source was cumbersome and inefficient, and caused optimization issues as our UI is client side. Each connector shares the same basic functionality but has different means of connection and supports different features. For instance, a database may have a connection string and username/password, whereas another may have a client ID and client secret, both of which are inputs but have different labels, validation etc. This means the form structure remains basically the same but needs to have fields appended or removed, depending on the individual case.</p><p>With the introduction of our new design, as our list of supported data sources grows (and it’s growing), we simply need to add a new object to the backend and a new form will be generated automatically. We refer to these objects as data source “templates” as they really only hold the minimum information necessary for generating the form.</p><h3><strong>Implementation details</strong></h3><h4>The infrastructure</h4><p>Some base-level infrastructure work needed to be done, but the time spent implementing it paid off immeasurably. It has two main parts:</p><ol><li>In the UI we need to handle the various components that can be defined in our forms using high order components</li><li>In the backend we need to rigorously define the inputs/logic each component supports.</li></ol><p>Let’s get into it.</p><p>To start, we created an endpoint for our data source “templates” where we send the type of data source to interface with:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/342/1*rvvPPWp3h0AWhLnrk3U9xQ.png" /></figure><p>This endpoint is where our template service is. Here, there’s a list of ‘templates’ that holds all of the information necessary to generate the fields. They’re composed of descriptive data which only informs on <strong>what </strong>to represent but not <strong>how</strong>. Since all rendering is client side, there are no backend changes necessary for styling or decoration. This makes UI replacements easy, if necessary.</p><p>The template system corresponds to the “Open-closed principle”. Over time more features and options are added to the fields but the base of the templates remains unchanged. We make heavy use of Typescript types and interfaces to ensure operation and self presentation, making an even more comfortable dev experience.</p><h4>API implementation details</h4><p>Lets take a look at the templates and how they’re structured:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*zP4h5UXwG-fKD-AwyugROg.png" /><figcaption>Template interface- comprised of fields</figcaption></figure><p>Because many of the connectors have shared fields, we decided to break them into ‘families’ of connectors. We have structured, unstructured, and RDB families which will be passed via <em>connectorType</em>. All of these start with the same fields but can be extended and overwritten if necessary by <em>customFields.</em></p><p>The fields are then aggregated into a single fields array to account for the additional custom fields and differing orders which can be supplied with the <em>fieldsOrder</em> array. Below is an example of a response from the API for our PostgreSQL form. We’ll take a closer look at the fields themselves below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*dhxbfk-PmFIdGUyQAX2gBw.png" /><figcaption>Example request</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*GMtUVYB-jZ1k98demkOLig.png" /><figcaption>Example response from the endpoint</figcaption></figure><h4>Field Example</h4><p>Here’s an example of the data source (ds) field interface:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*ph9AGAd5Nk9fSUTIvGdTeA.png" /></figure><p>The only two mandatory fields are “name” and “type” - the minimum for creating a form field. The rest of the fields correspond to more customizable logic, which is where the developer can invest most of their focus. With this design they will have a clear interface to work with understanding which fields are necessary and how they work. For instance, the validation field can accept a regex string and an error message and will validate accordingly, displaying the custom error text.</p><p>For example, here‘s the first field that must be defined for any new data source, the name the user chooses for the data source:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*mNb-c3rjosbaitxnyyFdoQ.png" /></figure><p>Now that we have gone over the anatomy of the field and understand <strong>how </strong>it works, let’s take a look at <strong>what</strong> it looks like in reality!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/0*tKcC9rbDcQQiW7k8" /><figcaption>Name field with placeholder text</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/0*bUW724z5P89A8uaE" /><figcaption>Name field with invalid input</figcaption></figure><p>Here we can see this template put into action:</p><ul><li>It has the red * to denote it is mandatory</li><li>It has the placeholder text as provided</li><li>The regex and error text are working</li></ul><p>This is an example of the <em>BigidInputField</em> which was selected by a mapping from the provided ‘string’ type. Swapping this component out for another, say <em>BigidPrimaryInputField</em>, would be as simple as changing the mapping. The only change would be an aesthetic one.</p><p>And there you have it! The templates are made up of a collection of fields just like this one. Now our developers can create the forms they need for their new connectors without writing a single line of frontend code.</p><h3>What’s Next</h3><p>In this article you’ve seen the backend side of leveraging Node to create a smooth development experience while solving a complex optimization issue. The next article in this series will show you how the client side receives and parses the data from the template to create these form fields. I hope you learned something from our solution and can use a similar system in your own future projects!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e6fdf7e0905a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bigidev-bigid-engineering/creating-a-ui-infrastructure-for-backend-developers-part-1-e6fdf7e0905a">Creating a UI Infrastructure for Backend Developers — Part 1</a> was originally published in <a href="https://medium.com/bigidev-bigid-engineering">BigIDEV — BigID Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>