
Deplit: My attempt to create Vercel
Table of Contents
- Introduction
- Features
- But Why ?
- What is Vercel?
- How do Vercel/Deplit/Others works?
- High-level overview
- Builder
- Why Deplit is fast?
- How fast is Deplit?
- Far more to go
- Conclusion
Introduction
Deplit is a static site hosting platform similar to Vercel, Netlify, and Cloudflare Pages. Itās not as feature rich as these platforms, but itās a good starting point to understand how hosting platforms work under the hood.
Live: https://deplit.tech
GitHub: https://github.com/mdhruvil/deplit
YouTube video showcasing Deplit: https://www.youtube.com/watch?v=a4w8_rXajl4
Features
- ā” Instant Rollback - One-click rollback to previous deployments
- š¦ Preview Deployments - Preview your deployments before production.
- š Global CDN - Serve your site from nearest to your users
- š Instant Automatic Deployments - Push to GitHub, get instant deployments
- š Subdomains - Free
.deplit.tech
subdomains for all projects - š Build Logs - Real-time build monitoring and detailed logs
- š»ļø Serverless Function (Soon) - Deploy your SSR or ISR apps to deplit
But Why ?
The main motive behind creating Deplit was to understand how hosting platforms work. What happens when I push code to GitHub? How is it built? Where is it built? How is my site served? Why is it so fast? To know the answers to these questions, I began researching. Thatās when I came across this blog post: Behind the scenes of Vercelās infrastructure by Lydia Hallie. This blog post is bit outdated. Vercelās architecture has evolved a lot with the introduction to Vercelās builds infrastructure and Fluid Compute. See this tweet/xeet by leerob. However, the core concepts are still the same. So I started implementing these concepts in my own way, and thatās how Deplit was born.
Well some people say Vercel is just a glorified AWS wrapper, but trust me itās more than that. With features like zero config deploys, instant rollbacks, preview deployments and more. Vercel handles a lot of complexity out of the box. And DX is far more better than AWS.
What is Vercel?
If you have been living under a rock and donāt know what Vercel is, hereās what ChatGPT describes it:
Vercel is a platform as a service (PaaS) designed to simplify the deployment of web projects. It offers a seamless CI/CD experience, allowing developers to easily deploy static websites, server-rendered applications, and APIs. With Vercel, developers can concentrate on building and improving their applications without having to manage the underlying infrastructure.
How do Vercel/Deplit/Others works?
All these hosting platforms work somewhat similarly. Here Iāll explain what happens when you deploy a site on Deplit.
High-level overview
Hereās a high-level overview:
- You create a project on Deplit and connect your GitHub repository.
- Deplit starts listening to your GitHub repository for any push events.
- You push code to GitHub.
- GitHub notifies Deplit about newly pushed commit.
- Deplit creates a new deployment and adds it to a build queue.
- The builder is spawned. It picks up the deployment and starts the build process.
- The builder clones the repository, installs dependencies, builds the project and uploads the build artifacts to a storage bucket.
- After successful build, the builder notifies Deplit about the successful build.
- Deplit updates the deployment status and serves the site from this new deployment.
From overview, you can tell there are two main components involved in this process: the builder and the CDN/proxy. Letās dive deeper into each of them.
Builder

When you create a project on Deplit and connect your GitHub repository, Deplit starts listening for push events using GitHub App webhooks. Every time you push code to GitHub, GitHub notifies Deplit about the new commit via these webhooks.
Deplit then creates a new deployment for all projects connected to that repository and adds it to the Azure Build Storage Queue, which triggers the Spawner, an Azure Function configured with a Queue Trigger.
Spawner then spawns a new Azure Container Apps Job which has two containers:
- Build Container: Responsible for building the project.
- Sidecar Container: Handles communication with the Deplit API and uploads build artifacts to the storage bucket.
Now, you might be wondering: Why not use a single container for both tasks? The reason is isolation. The container running the build process should be completely isolated from Deplitās system to prevent user code from accessing sensitive APIs or internal infrastructure. Thatās why all interactions with Deplitās API and the uploading of build artifacts are handled exclusively by the sidecar container. Communication between the two containers is authenticated using a shared secret so the build process canāt communicate with the sidecar container. And of course, the build process doesnāt have access to this shared secret.
Both Harkiratās, Piyush Gargās implementations have this critical vulnerability, where the build process directly has access to sensitive secrets.
After successful build, the sidecar container uploads the build artifacts to the storage bucket and notifies Deplit about the successful build.
The artifacts are stored in Azure Blob Storage under the <project-id>/<commit-hash>/
directory, so multiple deployments of the same project can coexist without conflicts.
Why Deplit is fast?

This is the most important and interesting part of Deplit. At the heart of its speed is the proxy, which is responsible for serving the site from the nearest edge location to the user.
This proxy is implemented using a Cloudflare Worker with a custom route pattern: *.deplit.tech/*
. It handles all requests to Deplit subdomains and routes them to the correct deployment.
When a request comes in,
- The proxy checks about the site:deployment metadata in the Cloudflare KV store for that subdomain.
- If it doesnāt exists, it returns a 404 page.
- If it does exist, it looks something like this:
{ "projectId": "f8b9e082-83b3-45df-8b76-c1fe00a9e969", "commitHash": "c14f5edc9205f6f780b8321374ad513fdb97263a", "spa": true, "htmlRoutes": { "/": "index.html" // more routes }}
- The proxy then constructs the URL for the requested resource based on the metadata.
- This URL is used as a cache key for the Cloudflare cache.
Deplit doesnāt use Cloudflare CDN directly, but it leverages the same underlying caching layer used by Cloudflareās CDN.
- If the resource is already cached, it is served instantly.
- If not, the proxy fetches it from Azure Blob Storage using a URL like:
https://<deplit-blob-id>.blob.core.windows.net/<project-id>/<commit-hash>/<resource-path>
- Once fetched, it is cached for subsequent requests, delivering blazing-fast performance.
How fast is Deplit?
How fast are deployments on Deplit and Vercel ? I did a quick benchmark to check which is faster ?
Conditions:
- Same project deployed on both. I have used https://github.com/mdhruvil/deplit-next for testing.
- Browser cache disabled in DevTools
- CDN cache: HIT. Both Deplit and Vercel uses CDN to serve files. This benchmark assumes that the files are cached at CDN.
Here are results for average load time for all the requests:
š Deplit: ~93.38 ms
š Vercel: ~79.47 ms
Deplit is ~13ms slower than Vercel. While Vercel is technically faster, Deplitās sub-100ms average load time is still very impressive, especially considering itās built by a student!
See my linkedin post for images and more information: linkedin post
Far more to go
Even though I have built something that can deploy static sites, Deplit is nowhere near Vercel. But Deplitās current architecture makes it easy to add new features like:
-
Serverless Functions/Edge Functions:
- Deplit uses
vercel
CLI to build projects which outputs artifacts compatible with Vercelās Build Output API v3. - This means that Deplit can support serverless functions, edge functions and SSR/ISR apps with minimal changes.
- All I need to do is implement a custom router that understands the Vercelās Build Output API v3.
- Deplit uses
-
Web Analytics:
- Since the proxy worker is invoked for every request, I can plug some custom logic to track page views and other analytics data.
-
Image Optimization:
- Using the same proxy worker, Deplit can offer on-the-fly image optimization via Cloudflare Image, similar to Vercelās image optimization feature.
-
ā¦and many more:
- The foundation is set. With a flexible proxy and clear build output standards, Deplit is ready to grow.
Conclusion
Building Deplit has been one of the most fun and challenging projects Iāve ever worked on. It has given me an understanding of how hosting platforms work and the complexities involved in building such systems.
If you have any questions or feedback feel free to reach out to me on any of the platforms below. Iād love to chat about this project or anything else youāre working on.
Peace out! āļø