Better Naming / Database Design
There were many bad naming/design decisions with the way data is stored in the Serial database. Here is a small wish list of things that would be nice to change eventually. We need to keep this in mind when making decisions about naming things in the API spec.The name unique_identifier is too vague
The name unique_identifier is used all over the app to refer to instances of components. It is used in the database, and in the frontend but the API interface (user facing) is uses the name component_instance. component_instance is a much better name because it is more descriptive and easier to understand.
The main thing that needs to change is the following tables:
unique_identifies→component_instancesunique_identifier_links→component_instance_links
The naming of the data primitives
The data primitives are a bit confusing and could be improved. I recommend that the following changes be made. Thedata_ prefix ensures that the tables are grouped nicely together in the Supabase UI and it also makes it very clear which tables store the data.
parametric_quantitative→data_numericalparametric_qualitative→data_textcheckboxes→data_booleansdatetime_data→data_datetimeimages→data_filesfiles→data_files- create new enum table for storing pass/fail values instead of storing them in the
parametric_qualitative(data_text) table.
LINK→LINK(no change)PARAMETRIC_QUANTITATIVE→NUMERICALPARAMETRIC_QUALITATIVE→TEXTIMAGE→IMAGE(no change)FILE→FILE(no change)CHECKBOX→BOOLEANPASSFAIL→ENUM
Redux
Initially, our application relied heavily on Redux for managing global state. Redux provided a centralized store for data that needed to be accessed by multiple components across the app. However, as our application grew, we found that Redux introduced unnecessary complexity for many of our state management needs. We’ve since transitioned to using React Context for most of our global state management. Context provides a more lightweight and flexible solution that’s built into React, making it easier to manage state within specific feature areas without the overhead of Redux. Despite this transition, a few core features of our application still utilize Redux:- Authentication: The auth slice in Redux manages user authentication state, including the Supabase UID, access token, user role, and company ID.
- Database State: A lightweight copy of the tenant’s database is still managed in Redux. This includes data such as components, processes, users, and other entities that are frequently accessed across the application.
- Real-time Updates: The Redux store is still used in conjunction with Supabase real-time subscriptions to keep the client-side data in sync with the backend.
Frontend Primitives
A significant portion of Serial’s frontend was initially implemented without standardized UI primitives, leading to inconsistencies and maintenance challenges. However, newer features are now being built using a set of well-defined frontend primitives located infrontend/src/shared/components/primitives. This shift towards using reusable UI components has greatly improved the consistency and efficiency of frontend development.
Frontend primitives are crucial for several reasons:
- Consistency: They ensure a uniform look and feel across the application.
- Efficiency: Developers can rapidly build new features using pre-built components.
- Maintainability: Changes to primitives propagate throughout the app, making updates easier.
- Accessibility: Primitives can be designed with accessibility in mind, improving overall app usability.
- Button primitive:
- Modal primitive:
- Dropdown primitive:
/frontend-primitives route in the app. This dedicated page serves as a living style guide, allowing developers to explore and understand the available UI components.
As we continue to develop new features and refactor existing ones, leveraging these frontend primitives will be key to maintaining a cohesive and efficient frontend codebase.

