hyperfiddle

Christian Dean 2025-07-10T14:46:02.935669Z

I'm building a webapp where authors can write and publish stories, and users can browse those stories, purchase, and read in the browser. I want to use Electric to write the story publishing tool, which would be a kind of rich editor to write, edit, add images, use A.I for certain production, and frequent saving of data. After reading through what Electric is/isn't for, it seems to me that I should use a normal cljs stack for the main app where users purchase and read stories and Electric for the editor. But I want to check this assumption first before going forward, mostly because I'd much rather simplify and use one thing for everything (electric for whole app, or normal clj/cljs for whole app). Some context: • The main app is more websitey. It's more or less two pages, a catalogue page and story page • Main app would have relatively much more traffic than editor because more people would be readers than authors, but that traffic wouldn't be making many calls to the backend as they just log in, fetch catalogue, purchase a story, and fetch the story. • If a reader's connection drops and the app just stops working, that would be a dealbreaker. Sounds like Electric might have that problem? So: Would Electric cause me problems if I tried using it for the whole app? Is it straightforward to use Electric for one part of an app without interfering with the rest, like 'myapp .com/publish' which boots electric and unboots when i nav back to \home?

2025-07-10T17:50:29.161369Z

Is cljs even needed for the reader app? Could just be a server driven MPA? Or possibly something like datastar (or htmx) if you needed something interactive?

Christian Dean 2025-07-10T21:53:43.522599Z

The reader app isn't just for reading the story. It's the main user-facing application, a bit like Netflix, with a catalogue of stories to purchase and read. So a bit more interactivity needed. Have never used datastar or htmx. Do they have advantages over cljs?

2025-07-10T21:56:19.797509Z

Ah, gotcha Depends on how interactive they are. Check out datastar; allows you to have everything driven by the CLJ backend. (Less code overall, no CLJS compilation headaches, likely more performant due to less data transfer to the client) https://data-star.dev

chromalchemy 2025-07-10T23:49:29.563149Z

Afik Electric requires a websocket connection per client, so is not recommended for traditional non-spa pages. Clj ui framework alternatives for those pages can be cljs based (reagent, uix, replicant, fulcro, etc) or hypermedia based (biff, htmx, datastar, etc)

Andrew Wilcox 2025-07-12T04:41:26.323609Z

> If a reader's connection drops and the app just stops working, that would be a dealbreaker. Sounds like Electric might have that problem? Yes, open one of the Electric examples, go offline, wait a minute... and notice that the entire UI disappears!