Story

Show HN: Managed Redux Toolkit: Autogenerate Your RTK Definitions

KritiKay Friday, November 29, 2024

Redux Toolkit (RTK) provides a lot of primitives to build performant frontend applications. Celestial generates RTK code for your backend (with additional features), exposing an intuitive hook-based API. So you can have all the benefits of RTK without having to familiarise yourself with the underlying framework.

Essentially, we write the backend wiring code for your frontend. You get simple-to-use hooks, which implement advanced backend sync & state management patterns. You also get a fast, snappy application out-of-the box.

You can also think about it like this: Celestial generates a unified state layer that contains your server state and any other state that you decide to store. It exposes hooks to interact with the state, while constantly keeping client state in sync with the backend. Your UI simply plugs into the state layer using a hook-based API to manage data flow for your web app.

UI development can broadly be categorised as (1) interacting with the backend to fetch data and push updates, and (2) writing and styling the UI. The vision is to automate (1) end-to-end, allowing devs to focus on (2). Like how Firebase/Supabase (when they began) abstracted away the implementation of chat.

An analogy can be found in the data world: before the data analyst can build a data dashboard, the data needs to be supplied to the dashboarding tool from various sources. This data fetching is generic enough to be abstracted away. The analyst simply writes SQL on their dashboarding tool to build their dashboard, without worrying about bringing the data in. They assume that the data will be present in a predefined structure and will update at a regular cadence.

In the frontend domain, sophisticated tools for data fetching and updating the backend exist. For ex. RTK, RTK Query, TanStack Query, SWR. But a developer still has to tie everything together themself. IMO, this can be automated, more so because of generative AI.

The idea is to abstract away all details of backend-interaction so the frontend developer can manipulate the data & develop the UI as if the data rests in in-memory data structures on the frontend itself. I am assuming that taking away the burden of backend interaction (and all its various nuances) would make life easy/save time for some devs and would empower other devs by giving them tools to do more. Please feel free to validate or invalidate this assumption :)

All comments & feedback welcomed. Feedback is the fuel that drives my work!

15 0
celestialdb.github.io
Visit article Read on Hacker News