An

An open-source, local-first Webflow for your own app

Hacker News

An open-source, local-first Webflow for your own app

Hey HN, I’m Kiet, and I’m one of the co-founders of Onlook – an open-sourced desktop app that lets you visually edit your locally running React app, then write your changes back to code in real time. I posted the repo a few months ago [1] when it was just 2 weeks old. Since then, we’ve made some big changes/improvements. I wanted to share some of the updates we’ve made and add more technical details. Here are the three big ones: • Inserting new elements - Draw elements in the live page like a design tool and write them back to code. • Component detection - Detect when an element is a re-used component and find its usages. • DOM tree representation - A layers panel similar to the Chrome devtool or Figma. Technical details [2]: Visual editing - Onlook is technically a browser that points to your localhost running the app. It can manipulate the DOM like a Chrome Devtool, and all these changes are injected into the page through a CSS stylesheet or DOM manipulation. The changes are non-persistent until written to code. Write to code - To translate the changes to code, we inject an attribute into the DOM elements at build-time that points back to the code like a source map. The attribute gives us the location of the code block, and the component scope [3]. We then find the code, parse it into an AST, inject the styles, and write it back. Framework support - This technique is framework agnostic as we can swap in a different compiler for another framework [4]. It can work for any codebase as we’re just using open standards that don’t require any custom code. The code generated is written directly into your codebase, locally, so you can always take the output without being locked-in to the tool. Actions - All the changes made are stored as actions. This allows them to be serialized, stored, and reproduced. We did it this way so eventually, we can introduce online collaboration or let an agent generate actions. To do this, we’d just need to serve the locally running page and resolve incoming actions. What’s next? It’s still a bit bare-bones but the support and suggestions from the HN and open-source communities have helped us a lot with our direction. Now that we’ve built the core engine, we can start doing some cooler visual builder features, fulfilling the “Webflow” part of our mission such as [5]: • Detecting CSS variables in the page and letting you use them as “design tokens” in the UI. • Duplicating a page and A/B testing designs before committing to code. • Creating new components directly in the canvas. • Creating a front-end project from scratch using Onlook. Some things we’re considering, but aren’t sure about yet: • Offer hosting directly from the app. • Collaboration such as real-time edits, comments, and share page as a prototype. I’d love to hear your thoughts/feedback. This project continues to be a blast to work on and the community response has been awesome. Thank you to everyone who has tried out and contributed to the repo :) _________ [1] https://news.ycombinator.com/item?id=40904862 [2] https://github.com/onlook-dev/onlook/wiki/Architecture [3] The attribute looks something like this: data-onlook-id="eJxNjUEKwzAMBP+ic6gOKT3k2i+kDzC2aEwcKVgyDQT/vU5pS067sMvMDl6WVZjYYIC7y2GMlgg6IA6je8LAJaUOVmdTO+BDKSvOkWwSfEme1+Q8oXASmVGthCgYaBFFps3wT1csEX3jX0y3hldz2T6C/VAd4SWVhWG4dpAiUyt9/R7Pc/+b+1ut9Q33rUM5" And decodes to this: {"component":"Dashboard","endTag":{"end":{"column":10,"line":620},"start":{"column":5,"line":620}},"path":"/Users/kietho/workplace/onlook/studio/demos/next/components/dashboard.tsx","startTag":{"end":{"column":67,"line":69},"start":{"column":5,"line":69}}} [4] We’re only supporting a few versions of React at the moment for early focus: https://github.com/onlook-dev/onlook/tree/main/demos [5] https://github.com/onlook-dev/onlook/wiki/Roadmap

Share card

Actual performance

227points
51comments
Made the leaderboard

Launch Intel predictions

Analyze your own launch →
Product HuntOn track for Day 1 leaderboard · Strong signals: agent, user, new · Missing: mac, agents, macos
96%96% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
Indie HackersFits the IH revenue-focused audience · Missing: supports, reddit linkedin, podcasting
86%86% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
Hacker NewsStrong engagement from HN community · Strong signals: ide, io · Missing: https docs, excited, just released
77%77% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
AppSumoMay struggle as an AppSumo deal · Strong signals: host, builder, users · Missing: plus, platform, intuitive
46%46% predicted probability of success on AppSumo, based on ML models trained on real launch data.
TrustMRRLess likely to generate early MRR · Strong signals: month, users, way · Missing: mobile apps, ios, personal
43%43% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Missing: arr, mrr, revenue
13%13% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Strong signals: real time, introduce · Missing: web3, chat, crypto
0%0% predicted probability of success on BetaList, based on ML models trained on real launch data.

Correct prediction on native model

Similar products

I
I made an open source and local translation app62%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

I made an open source and local translation app

Hacker News236
Trayzero
Trayzero19%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Open-source, local-first GTD app — no account, no cloud

Indie Hackerscommitment-side-project
Ar
Arkloop – Open-source, local-first Agent client25%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Arkloop – Open-source, local-first Agent client

Hacker News2
Ev
Every 4s, Familiar OCRs my screen into Markdown (open source, local)72%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Every 4s, Familiar OCRs my screen into Markdown (open source, local)

Hacker News1
Dictámelo
Dictámelo21%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Open-source local voice typing

Indie Hackers
Ap
ApiArk – Open-source, local-first API platform (Postman alternative)57%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

ApiArk – Open-source, local-first API platform (Postman alternative)

Hacker News1
I
I built an open-source local-first app to track my workouts72%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

I built an open-source local-first app to track my workouts

Hacker News3
Whispering
Whispering81%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Open-source, local-first dictation you can trust

Product Hunt+192Productivity
Onlook
Onlook84%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

The open-source, local-first Figma for React apps

Product Hunt+252Design Tools
VoiceGecko
VoiceGecko74%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Open source, local voice-to-text

Product Hunt+102Developer Tools