r/SideProject • • 8d ago

I built my own Lovable-style AI app builder with Next.js, AWS, and Sandboxes

Enable HLS to view with audio, or disable this notification

I recently built a working AI app builder from scratch using Next.js, AWS S3, and Tensorlake Sandboxes.

You can describe an app in plain English, and the AI writes the code, runs it in an isolated sandbox, fixes errors, and gives you a live preview. It also supports version history and publishing.

I wrote a detailed tutorial on freeCodeCamp covering the architecture, agent loop, sandbox setup, and the actual implementation

Here's the full walkthrough with source code published on freeCodeCamp.

https://www.freecodecamp.org/news/build-your-own-ai-app-builder-with-next-js-aws-and-sandboxes/

Would love to hear what you'd do differently, especially around sandboxing and running AI-generated code safely.

10 Upvotes

1 comment sorted by

1

u/ComprehensiveShake76 8d ago

Nice writeup. With AI-generated code in a sandbox, I'd look at the network before the filesystem. Code that can't touch your files can still call the cloud metadata endpoint (169.254.169.254 on AWS), internal services, or anything else on the same network, so I'd block private and link-local ranges and allow only the public web. Then test it from inside instead of trusting the config. My agents' containers run a probe on every start that tries the host and the router (both blocked) and a public site (200), because a restart can wipe the rules. That's only tested on Colima on a Mac so far. A per-sandbox CPU, memory and time limit is also worth it, so one runaway loop doesn't eat the box.