What is serverless #5 | Build a fast website | Prismic
Prismic
Channel
Interviewed Person
Guillermo Rauch
Description
Concrete example of a website development with serverless deployment. More videos on what is serverless: https://www.youtube.com/playlist?list=PLUVZjQltoA3zXZ1ImqgO3ImQH4IFOYHcq --- As a developer, you should build websites using your favorite Jamstack framework. Prismic allows you to build website sections, that you can connect to a website builder for your client or team. They will create pages from there and you get that content back to your code through our fast API. ► [Tutorial] Build a full website with Next.js 13, Prismic, Tailwind and Typescript: https://youtu.be/nfZu56KsK_Q ► [Tutorial] Build a full website with Nuxt 3 and Prismic's new Page Builder: https://youtu.be/8GmfcbuYOWE ► [Starters] Try Slice Machine on Nuxt: https://prismic.club/nuxt-starters ► [Starters] Try Slice Machine on Next.js: https://prismic.club/nextjs-starters ► [Learn more about Slice Machine]: https://prismic.club/slice-machine --- ► Find us also on: Twitter: https://twitter.com/prismicio Instagram: https://www.instagram.com/prismicio LinkedIn: https://www.linkedin.com/company/prismic-io ► [Who are we?] : Prismic is a headless Website Builder, for Next.js and Nuxt.js developers. --- 00:00 Intro 00:39 Integrates with any framework 00:50 You start by creating a /pages directory 01:11 Turn each page in the /pages directory into a serverless function 02:20 You can part of the website static, and another part dynamic 02:59 All of this function are stored in one monorepo 04:13 In contrast with monoliths, monorepos can grow endlessly without limiting the speed of your app. #Prismic #Serverless
Tags
Transcript
- So, I'm here with Guillermo and for this video, I would like to go through a concrete example of Serverless, and how it would look like, and for a concrete example, for a developer. We talked about different topics and I want to have all the topics in an example. So, imagine I have an application or a website, okay? Let's say a marketing website. Well obviously, it should be fast,
care about SEO, all these kinds of things, and I would like to deploy it on Serverless. How would that look like concretely? - Yeah so typically, we integrate with any framework that already exists, whether it's Vue, React, we support and created Next.js. So with Next.js, typically, you start by creating a /pages directory. And inside that /pages directory, you sort of define all your customer facing entry points in your application.
Whether it's marketing pages, or login pages. So you could have about.js for your about page or you could have login.js for your login. So the interesting thing is when you deploy it with Serverless, what we have you do is say, hey I want use Next.js So we don't really lock you into a particularly framework. And what out platform will do is it'll take the pages directory and it'll turn each on of those into an independent serverless function. But you don't really change
the way you've been writing your application. And a long side your Next.js code for example, you could define API endpoints, you can define static pages. So it's this idea of what we call the majestic monorepo. It's a monorepo that can contain all of your customer facing logic, for serverless functions, as well as assets and static files as well as APIs. And the monorepo has this amazing advantage
that you always deploy everything at once. And because Serverless makes deployment so fast you don't really need to go around and split up your code into a hundred million places. You always just run Now, and you get your URL back. Or you Git push, and we give you your URL for your deployment. - But does it change anything if I have to call, for instance, some API for getting the content into the website? - No it's just as static or dynamic as you want.
And the really cool thing is that we deploy this to a CDN layer. So if you have static data, we can automatically cache it. If you have something that's more dynamic you can serve it on demand. And you can server render for each request. Or you can also piggy back on what we call the cache control API. So you can respond with HTTP headers to cache your content at the edge. - Right, so but still this monorepo thing
is that you have all the logic. Even if you have endpoints you will be in the same repo. - Yeah it's great. And a great example of why this is useful is companies love to have design systems or style guides. So you kind of want to have a coherent set of components for the entire company. And companies don't tend to have only one project. You log in here, and this is the entirety of my company.
They tend to want to split up their logic and their teams into sections. Sometimes into different technologies. But at the end of the day when it comes to the customer, you want to see the components and the styles all of the same. So the monorepo allows you to have components that could be shared between many different pages. Sometimes even for example you could have validation rules or Typescript types that are shared between the API
Video Details
- Duration
- 5:47
- Published
- May 29, 2019
- Channel
- Prismic
- Language
- ENGLISH
- Views
- 749
- Likes
- 30
Related Videos

How to use Next.js with other frameworks and tools ft Tim Neutkens | Prismic
Prismic
Interviewed: Tim Neutkens

How to build APIs with Next.js? ft Tim Neutkens | Prismic
Prismic
Interviewed: Tim Neutkens

Why Next.js is an effective framework to build a website? ft Tim Neutkens | Prismic
Prismic
Interviewed: Tim Neutkens

Vibe coding, El Futuro de la Web y Liderar la Industria del Frontend | Guillermo Rauch - Ep.7
Francisco Erramuspe
Interviewed: Guillermo Rauch