Back in the day...
...we had to manage our own servers.
Then, we got webspace...
...and the opportunity to rent servers.
This lead to “The Cloud”...
...and subsequently to containers and serverless computing.
From these developments, even easier platforms emerged.
Nils Röhrig | Loql
What’s the deal with Cloudflare® and Vercel?
I
Which caveats to be aware of?
II
III
What the heck is a “meta-framework”?
IV
Did you say “SvelteKit”?
V
Show me the code!
What’s the deal with Cloudflare® and Vercel?
I
Cloudflare
Cloudflare
, Inc.
Cloudflare, Inc.
Cloudflare, Inc.
Web Security
Cloudflare, Inc.
Web Security
Cloudflare, Inc.
Web Security
Content Delivery
Cloudflare, Inc.
Web Security
Content Delivery
Cloudflare, Inc.
Web Security
Content Delivery
Developer Platform
Cloudflare, Inc.
Web Security
Content Delivery
Developer Platform
Cloudflare, Inc.
Web Security
Content Delivery
Developer Platform
...and much more!
Cloudflare, Inc.
Web Security
Content Delivery
Developer Platform
...and much more!
Developer Platform
Developer Platform
Developer Platform
Cloudflare Pages™
Cloudflare Workers®
Cloudflare D1™
Developer Platform
Cloudflare Pages™
Cloudflare Workers®
Cloudflare D1™
A serverless full-stack developer platform
[that enables developers to]
Build, deploy, and deliver trusted full-stack applications in a fraction of the time.
Server by Adrien Coquet from Noun Project (CC BY 3.0)
Laptop by Adrien Coquet from Noun Project (CC BY 3.0)
GitHub
Gitlab
Wrangler CLI
CDN
deploy to
Run serverless code with exceptional performance, reliability, and scale
Server by Adrien Coquet from Noun Project (CC BY 3.0)
world by Adrien Coquet from Noun Project (CC BY 3.0)
script by Adrien Coquet from Noun Project (CC BY 3.0)
User by Adrien Coquet from Noun Project (CC BY 3.0)
GitHub
Gitlab
Wrangler CLI
deploy to
Edge Location
Nearby User
Create a serverless relational database in seconds with D1.
world by Adrien Coquet from Noun Project (CC BY 3.0)
Data by Adrien Coquet from Noun Project (CC BY 3.0)
script by Adrien Coquet from Noun Project (CC BY 3.0)
Server by Adrien Coquet from Noun Project (CC BY 3.0)
replicate
replicate
replicate
replicate
replicate
replicate
Edge Location
Regional Data Centre
What’s the deal with Cloudflare® and Vercel?
I
Vercel
Vercel
Vercel
Web Hosting
Vercel
Web Hosting
Vercel
Web Hosting
Vercel
Developer Tools
Web Hosting
Vercel
Developer Tools
Web Hosting
Vercel
Developer Tools
Managed Infrastructure
Server by Adrien Coquet from Noun Project (CC BY 3.0)
Laptop by Adrien Coquet from Noun Project (CC BY 3.0)
GitHub
Gitlab
Vercel CLI
CDN
deploy to
Server by Adrien Coquet from Noun Project (CC BY 3.0)
world by Adrien Coquet from Noun Project (CC BY 3.0)
script by Adrien Coquet from Noun Project (CC BY 3.0)
User by Adrien Coquet from Noun Project (CC BY 3.0)
Regional Data Centre
Edge Location
Nearby User
GitHub
Gitlab
Vercel CLI
deploy to
Edge Functions
Serverless Functions
Vercel Postgres is a serverless SQL database designed to integrate with Vercel Functions.
world by Adrien Coquet from Noun Project (CC BY 3.0)
Data by Adrien Coquet from Noun Project (CC BY 3.0)
Regional Data Centre
Nearby User
Which caveats to be aware of?
II
Limited runtime, fast execution,
globally distributed.
Full environment, slow cold starts,
regional data centres.
III
What the heck is a “meta-framework”?
The Full Stack
Browser
(Interactivity)
View
(Server-side rendering)
Controller
(Routing)
Model
(Business Logic)
Database
(Data Model)
Meta-Framework Scope
Traditional Web Framework Scope
Cloudflare / Vercel + Meta-Framework = ✅
IV
Did you say “SvelteKit”?
SvelteKit is a framework for rapidly developing robust, performant web applications using Svelte.
request
match
match
match
Route Definitions
Route Code
Laptop by Adrien Coquet from Noun Project (CC BY 3.0)
script by Adrien Coquet from Noun Project (CC BY 3.0)
request
match
match
match
File System
Route File
Laptop by Adrien Coquet from Noun Project (CC BY 3.0)
script by Adrien Coquet from Noun Project (CC BY 3.0)
Folder by Adrien Coquet from Noun Project (CC BY 3.0)
Special purpose
Svelte component
<h1>About me</h1>
<p>Hi, I'm Nils!</p>
page by Adrien Coquet from Noun Project (CC BY 3.0)
Loads data and processes forms on the server. Returns data available within data and form.
Loads data on the client and on the server. Returns data available within the data prop.
<script>
export let data;
</script>
<img src={data.article.headerImageUrl} alt="" />
<h1>{data.article.title}</h1>
{@html data.article.content}
export function load({ params }) {
const article = getArticleBySlug(params.slug);
if(!article) {
error(404);
}
return {
article
}
}
Happy how-the-
web-worked-forever-
day!
Server by Adrien Coquet from Noun Project (CC BY 3.0)
web by Adrien Coquet from Noun Project (CC BY 3.0)
User by Adrien Coquet from Noun Project (CC BY 3.0)
<script>
export let form;
$: errors = form?.errors ?? [];
</script>
<form method="post" use:enhance>
{#each errors as error}
<p class="error">{error.message}</p>
{/each}
<label for="email">
E-mail:
<input name="email" id="email" type="email">
</label>
<label for="password">
Password: <input name="password" id="password" type="password">
</label>
<button>Login</button>
</form>
export const actions = {
async default() {
// ...default action
}
// usage:
// <html method="post"></html>
}
// OR
export const actions = {
async namedActionOne() { /* ... */ },
// ...
async namedActionN() { /* ... */ }
// usage:
// <html method="post" action="?/namedActionX"></html>
}
export const actions = {
async default({ request }) {
const formData = await request.formData();
const [errors] = validate(formData);
if(errors) {
fail(400, { errors });
}
const [loginErrors] = login(
formData.get("email"),
formdata.get("password")
);
if(loginErrors) {
fail(401, { errors });
}
redirect("/secured-area");
}
}
SvelteKit ❤️ Cloudflare & Vercel
SvelteKit Application
Platform-specific adapter
uses
adapts to
Cloudflare
Vercel
Netlify
Azure
Cloud Run
...
V
Show me the code!
X:
LinkedIn:
Xing:
Code:
Cloudflare:
Vercel: