Building an AI App Builder
How to make an AI App Builder on Freestyle
Freestyle is the cloud for AI App Builders. We provide all the tools you need to build, preview, deploy and manage the code your AI writes. This guide shows you how to build with Freestyle, how we think about our tools, and how to get the most out of them.
Architecture
Managing the Code with Git
The life blood of every AI App is the code that powers it. To make the most of it, we provide a Git API for creating and managing repositories.
We recommend using Git to manage the code your AI writes because:
- Version Control: You get a free version history, along with reverting, branching, and merging.
- Collaboration: You can have multiple agents working on different prototypes and merging them together.
- Debugability: Your AI's process is tracked over time, and you can clone any of its prototypes locally anytime.
- Portability: You can sync your repo's to Github, or give your users the ability to clone them locally and work alongside your AI.
- Integration: By working through Git, we can provide live previews based on the current versions of the code, along with automatic deployments — the same way you get with the Continuous Integration and Continuous Deployment (CI/CD) tools you're used to.
Developing with Dev Servers
As your AI writes code, it needs some form of development server to run it on. This development server has jobs like linting the code, running it (or running tests), and serving it to the browser to preview it for your users. We provide a Dev Servers API for creating and managing these servers.
The Dev Server API is not a generic container API, it is specialized for lifecycle management of JavaScript/TypeScript apps. Instead of making you manage the lifecycle, it runs through Git and is synced to the latest version of a given git repository. The Dev Server automatically keeps your dev server healthy, routes traffic to a given url to provide a live preview, manages npm installs, and shuts down when the code is not being used. It's also controllable via both an HTTP API and an MCP service that lets you or your agents control it.
This api is not the most powerful container API in the market — this is by design. We believe AI App Builders should be able to focus on building apps, not managing container lifecycle and health. The Dev Server API is designed to take this off your plate. It is designed to be extensible, but if you are looking for a generic container API, this is not it.
Deploying Previews
Once your AI has written code, it needs to be deployed to a live server. Dev Server's are slow, expensive to run and non-scalable. We provide a Deployments API for deploying your code to our production serverless infrastructure.
This API is extremely customizable, you can build that app yourself, have it detect the framework and build for you, or configure your own build, then you can add any number of domains, environment variables, advanced security features like network permissions and more. It also manages the related DNS, routing and TLS Certificates without you needing to do anything.
Any Freestyle user can deploy their code to any *.style.dev
domain, and can also deploy to their own custom domains.
AI App Builders should have their own *.yourapp.com
domain that you use to deploy initial production versions of your app to. You can set this up with the following guide and point the domain at us following the DNS Instructions. This should not be a subdomain of any domains you use for security reasons.
The simplest way to deploy if you're using Git is to set the deployment source to your git repository itself. This way, we'll automatically pull the latest version of your code, build it and deploy it. You can do this yourself, or you can set up a Git Trigger to automatically deploy your code whenever you push to a given branch. This is the same way you would do it with any other CI/CD tool.
Production Deployments
Once your users see the live preview of the app, they'll want to deploy it to their own domains. This is where the domains API comes in. This API allows you to deploy your app to any custom domain.
Domains on Freestyle are completely decoupled from deployments, allowing you to attach/detach them at will.
In order to do this, you should create an API that takes your users through the same verification process for managing your own domain you went through to set up your own domain. Then tell them to point their domain at us following the DNS Instructions. Once they do that, you can deploy their app to their domain using the Deployments API.
All together
All these together make up an AI App Builder built on Freestyle. Our goal is to take the pain of infrastructure off of building an AI App Builder to let you focus on everything else. If this architecture is compelling to you, check out our example repository here.