Architectural advice on IDE live preview

We’re building an integrated development environment with a custom LLM/model we built from scratch, everything is working from importing user repositories via Github personal access token so we can do fork and file tree integrations.

The problem we’re running into is setting up a preview component with hot reload so users can speak with our artificial intelligence agent and run code/prompts in real time and see their applications/repositories live with edits being made on the fly (pun intended).

The problem is because of fly.io and our integration with machines to boot up and install specific libraries/dependencies based on each unique project we are running into “restart/boot issues while testing” our machine and app was suspended.

I was hoping I could speak to expert support that has already built what we are looking to create essentially and just make sure everything is wired/configured properly. Our product is already almost done from the interface, functionality just the preview component and fly.io integration is what’s failing.

Is anyone there to help out? We can also email to talk on Telegram, Discord what have you!

Hi… The top two tiers of Fly Support offer real-time “architecture sessions”, which seems the closest to what you’re asking for.

I don’t think they can get all the way down to “wired/configured properly” exactly—that would be more of a consulting engagement—but obviously they built their own IDE once…


Also, I’d suggest browsing the “Guides” section of the official docs, which distills a lot of recurring themes from previous sessions (from what they’ve said in the past). For example, there’s one called “Per-User Dev Environments with Fly Machines”.

Thank you for your reply. I did already send a ticket, thought I’d test my luck on the forums if this just rang a bell with anyone that’s done it already or knows the exact issue I’m dealing with :slight_smile:

Still working on this…

The new quasi-persistent RootFS might help a bit…

https://community.fly.io/t/your-rootfs-reboot-resistant-try-persist-rootfs/26146

However, like it said in that earlier guide, you would still need to be prepared to recover everything from a more durable source (Tigris, Managed Postgres, etc.).

When you say “suspended”, do you mean the VM RAM’s contents are frozen in a sleeping state, or do you mean that your app has been put into a Fly sin-bin for anomolous behaviour?

I wonder if you could supply a concrete example. If you start a machine, you can inject libraries into it without rebooting it, unless of course the user/LLM elects to reboot it. So there may be value in explaining a bit more here.

a “suspended” app just means there are no machines running; presumably OP’s machines are crashing or stopping for some other reason during boot.

We just soft launched a Sandbox product called Sprites that should make this tremendously easier. Give it a try: https://sprites.dev

The best way to play with these is to run sprite create <name>, sprite console -s <name>, then run claude and ask it questions about the environment.

2 Likes

I went ahead and just asked Claude to document the Sprite environment: https://env-docs-bkmto.sprites.app/

I did a screen recording of Claude running. You’l want to watch this at like 4x speed, or scrub through or something. Claude is faster than me but slow to watch.

We’re in the process of building roseram.com

unnamed

The idea is an integrated development environment with artificial intelligence chat agent contextual programming.

Where we’re at so far:

  • Integrating your GitHub personal access token with all repository scope with read and write permissions.

- Selecting a repository (forking from the main branch) - DONE

- Forked repository is created and used to make edits with instant refresh capabilities utilizing a preview component within the interface or dashboard.

[1] - Setting up auto-detection (reading package.json or installing libraries/packages/dependences requirements for applications)

- Entire application repository is integrated with our artificial intelligence agent for context and understanding user requests on edits.

- Prompt engineering and artificial intelligence based programming solution.

- Users can push commits to their main branch to update their repository, selected repository can deployed across multiple hosting providers, database integrations.

  • Build applications seamlessly.

We tried using Stackblitz SDK and Vercel and integrating but it was unsuccessful with being able to read user imported repositories.

The idea is to use fly.io, API and development server to solve for our [1] and still be able to make edits and see applications live as if it were already being viewed on your device/browser.

We receive a 200 OK response with the fly.io API integration but we’re missing something to get this up, running and working properly.​

Any ideas?

P.S. Our machines were also destroyed due to multiple failed repetitive start ups on attempts to launch previews within our IDE (integrated development environment)

P.S.S. Does Sprite offer the preview component we’re looking for or is it just a coding sandbox (only code?)

Sprites can do previews! Or serve any kind of http response publicly:

➜  ~ sprite url -s env-docs update --auth public
Updated URL settings for sprite env-docs
Auth: public
URL: https://env-docs-bkmto.sprites.app

You can have them clone a repository just fine. The Go and JS SDKs have functions running processes on sprites:

And since they’re stateful, once you get one setup for a user / project, it’ll come back with the same disk text time you need it.

Looks like a good project. However I am struggling a bit to see what the problem is, exactly. Yes, Vercel would work, Fly would work, as would Vultr, DO, and AWS. If you can spin up a machine using an API (and I assume you can do that with all of them) then you can achieve this with any provider.

it was unsuccessful with being able to read user imported repositories.

There’s a few ways to do this; you could do it as if you were deploying your own project from GitHub or BitBucket. Either an SSH key supplied by one of those Git providers, or a token that is scoped to one project, etc.

From there, you could do it using a queue outside of the user’s recently spun-up VM, and Rsync a tarball onto the VM, or you could spin up the user’s VM and put your own agent on the same box, listening for commands.

For the VM, I wonder if I would get it to block with a dummy command in Docker (e.g. a shell) and then the user (or the AI) can spin up an appropriate listener based on their project type. That way, if they take the listener down, the machine will survive, until they (or you) destroy it.

We receive a 200 OK response with the [Fly] API integration but we’re missing something to get this up, running and working properly.

Is your preview feature an iframe? Where does your error snapshot come from? What did it say in the Fly API JSON response? I wonder if you spawned a machine, but it did not live for long, and thus it looks like it failed.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.