The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
whale/book (#28642)
Copple5fb43f917abe
diff --git a/apps/www/_blog/2024-08-16-supabase-book-by-david-lorenz.mdx b/apps/www/_blog/2024-08-16-supabase-book-by-david-lorenz.mdxnew file mode 100644index 00000000000..4bf3ccaa4f3--- /dev/null+++ b/apps/www/_blog/2024-08-16-supabase-book-by-david-lorenz.mdx@@ -0,0 +1,104 @@+---+title: 'The Supabase Book by David Lorenz'+description: 'Learn Supabase by building a Multi-Tenant platform.'+author: activenode+image: lw12/supabase-book/OG_supabase_book.png+thumb: lw12/supabase-book/thumb_supabse_book.png+launchweek: '12'+categories:+ - launch-week+tags:+ - launch-week+date: '2024-08-16'+toc_depth: 2+---++<Quote img="paul-copplestone.jpg" caption="Paul Copplestone, CEO @ Supabase">++Hey folks. We're excited to share David's new guide to learning Supabase. He's spent a year+working on it and we think it's one of the most thorough Supabase resources on the internet. If+you're interested in leveling up your Supabase skills, you can support David and <a href="https://supa.guide/" target="_blank">purchase the book here</a>. Enjoy!++</Quote>++## Background++Let me introduce myself, I'm David Lorenz, not a Supabase team member, but a Supabase user from the very early days. On the net you might know me as [@activenode](https://x.com/activenode/). I'm a software architect who's been building web apps for over two decades now—ever since I picked up my first HTML book at the age of 11.++I gravitate towards technologies that are flexible and portable. Proprietary solutions like Firebase, which bind clients to a single provider, simply don't align with my philosophy.++Supabase caught my attention from the get-go. A superpowered database with just Postgres under the hood—and I'm not locked in. But let's jump to why I wrote a book.++<div className="video-container">+ <iframe+ className="w-full"+ src="https://www.youtube-nocookie.com/embed/ISFCooRMvbE"+ title="The Supabase Book by David Lorenz"+ allow="accelerometer; autoplay; clipboard-write; encrypted-media; fullscreen; gyroscope; picture-in-picture; web-share"+ allowfullscreen+ />+</div>++## Why this book needed to exist++Due to my presence on the web, I'm often in touch with people using Supabase through consultancy calls or on social media. Through these conversations I've run into many similar questions and discovered that although there are so many great resources for learning Supabase, many have repeated exercises and open questions. I felt there wasn't **that one resource** which you go through and then say “I know Supabase inside and out”. This book aims to change that.++Let's talk about the chosen approach next.++## Approach++When I first set out to write this book, I found myself asking, "How can I possibly satisfy everyone's expectations?" After hours of brainstorming and sketching out concepts, I realized I was asking the wrong question. Instead of trying to satisfy everyone's expectations, I needed to focus on finding the best way to truly teach Supabase so that after completing the book, readers could build anything they imagined.++It had be a full project, 0 to 100, explaining why things were done the way they were done. I decided on a Multi-Tenant Ticket Management system: this would allow me to explain rationally-modelled database design and clever file management, as well as what it means to work with multiple tenants in the same Supabase instance and how to optimize for that.++And because I felt it was most useful to walk through the project front to back, I had to choose a framework. For creating a UI, I decided to use Pico.css as it's one of the very rare CSS libraries that allow us to simply use basic HTML elements to create a UI.++For the business logic I chose Next.js as being not only one of the most popular frameworks but also providing ease of use without a lot of foundational setup.++Now let's have a look at what you'll take away.++## Goal / What you will learn++One high-level goal of mine with the book is that even someone who thinks they _know_ Supabase, will have aha moments in every single chapter.++The book is divided into four parts with thirteen chapters in total and adds up to 500+ pages. Let's have a look at the parts:++### 1. Creating the Foundations of the Ticket System App++We kick things off with an introduction, unveiling Supabase's “secret” sauce and history. Then you'll take a short trip through permission systems and learn how Supabase compares to traditional FGA and RBAC systems. From there, you'll setup Supabase locally, learn about its API and Keys, then create the initial layout with Pico to get started.++### 2. **Adding Multi-Tenancy and Learning RLS**++Pass me the key to your house! Or should I say all of them - or none? Here we'll talk authentication and permissions in a multi-tenant world. After you add a login and learn how to authenticate with fully customised emails, you'll craft the database and app to become multi-tenant-aware. Then you'll learn about RLS complexity optimisation and working with external Auth providers.++### 3. Managing Tickets and Interactions++Making things interactive is what this part is about: we'll add ticket data, sort it, filter it, and paginate it. We create performance-optimized RLS queries, add triggers for caching, and embrace realtime comments on tickets that include file uploads. There's much more too, e.g. learning how you can add plan-based storage restrictions for a user.++### 4. **Diving Deeper into Security and Advanced Features**++In this part, things get more technical. These two chapters are packed with additional knowledge, covering advanced security aspects, techniques for hardening or cloaking your instance, Edge functions, environment-based webhooks, and creating an AI-based search. It's impossible to list everything covered in this part, but it will undoubtedly provide you with new perspectives on how to leverage Supabase's full potential.++## How to get the most out of this book++This book is a deep dive so to make the most of it will take some time. During my step-by-step review of the book, it took me a little less than a full week to complete everything. So plan to spend about half a day per chapter with some extra time for any troubleshooting. If you do that, I can promise, you'll walk away with exceptional knowledge that sets you apart from the crowd. And the time you spend studying the book will be dwarfed by the time you'll save on future projects.++If you need breaks in between, it's best to finish an entire chapter before taking a pause. This way, you can digest the knowledge from that chapter in its completeness. Another opportune time for reflection is between the four main parts of the book.++## What if I face problems?++Let's use the power of the community. I've created a Discord channel where I'm active and where you can exchange ideas with other people reading the book. Find the link below.++## What else?++I've invested one year of my life into this book and I'd love feedback of all kinds! You can find me and tag me on social media, I have the username `@activenode` on every platform. Also you'll find all of the contact data at https://activeno.de.++If you like the book, please spread the word. You can also book me as Supabase consultant and Architect for your next gig.++## Links++The original page and newsletter: https://supa.guide++Book Discord: https://supa.guide/discord?ref=supabase (tbl https://discord.gg/qhAAYwKx3f )++Buy the book: https://supa.guide/buy?ref=supabasediff --git a/apps/www/components/LaunchWeek/12/Releases/data/lw12_build_stage.tsx b/apps/www/components/LaunchWeek/12/Releases/data/lw12_build_stage.tsxindex cfd156665c2..2de7ac9f4cb 100644--- a/apps/www/components/LaunchWeek/12/Releases/data/lw12_build_stage.tsx+++ b/apps/www/components/LaunchWeek/12/Releases/data/lw12_build_stage.tsx@@ -130,8 +130,8 @@ export const days: AdventDay[] = [fill="hsl(var(--foreground-light))"/><path- fill-rule="evenodd"- clip-rule="evenodd"+ fillRule="evenodd"+ clipRule="evenodd"d="M25.7358 27.736C26.5975 28.5895 27.7659 29.0696 28.9846 29.0712C30.2032 29.0696 31.3715 28.5895 32.2333 27.736C33.095 26.8825 33.5798 25.7253 33.5813 24.5183C33.5808 24.0901 33.5194 23.668 33.4019 23.2636L34.1502 23.1279C34.3389 23.0931 34.5059 22.9855 34.6147 22.8288C34.7234 22.6721 34.765 22.4791 34.7302 22.2921C34.695 22.1058 34.5867 21.9408 34.4292 21.8331C34.2716 21.7256 34.0775 21.684 33.8892 21.7176L32.7958 21.9158C32.7886 21.9171 32.7815 21.9186 32.7743 21.9201C32.7692 21.9212 32.7641 21.9224 32.759 21.9236C32.6038 21.7023 32.4282 21.4937 32.2333 21.3006C31.3715 20.4472 30.2032 19.967 28.9846 19.9655C27.7659 19.967 26.5975 20.4472 25.7358 21.3006C25.2144 21.817 24.831 22.4446 24.6091 23.1272C24.3641 23.0873 24.1157 23.0674 23.8666 23.0677C23.0492 23.068 22.2517 23.2841 21.5535 23.6872C21.4288 23.5248 21.2924 23.3701 21.145 23.2242C20.2834 22.3713 19.1155 21.8915 17.8973 21.89C16.6792 21.8915 15.5113 22.3713 14.6496 23.2242C14.039 23.8285 13.6175 24.5853 13.4229 25.4043L12.155 25.6357C12.0616 25.6526 11.9726 25.6876 11.8929 25.7386C11.8133 25.7897 11.7445 25.8558 11.6907 25.9332C11.6368 26.0105 11.5988 26.0977 11.579 26.1896C11.5591 26.2815 11.5577 26.3763 11.5749 26.4687C11.6048 26.6341 11.6922 26.7838 11.822 26.892C11.9519 27.0001 12.1159 27.0597 12.2855 27.0604C12.3295 27.058 12.3733 27.0513 12.416 27.0404L13.3222 26.8768C13.4253 27.9234 13.8914 28.9077 14.6486 29.6577C15.5103 30.5112 16.6786 30.9914 17.8973 30.9928C19.116 30.9914 20.2843 30.5112 21.1461 29.6577C22.0078 28.8042 22.4926 27.6471 22.4941 26.44C22.4931 25.9299 22.4059 25.4286 22.2402 24.9555C22.7284 24.6638 23.2903 24.507 23.8666 24.5069C24.0415 24.5074 24.2158 24.522 24.3879 24.5505C24.398 25.7459 24.8817 26.8901 25.7358 27.736ZM15.2449 28.1129C15.3672 28.3028 15.5107 28.4804 15.674 28.6421C16.2638 29.2262 17.0632 29.5551 17.8973 29.5567C18.7314 29.5551 19.5309 29.2262 20.1207 28.6421C20.5158 28.2507 20.7953 27.7661 20.9372 27.2403C20.6078 26.6592 19.3023 25.7228 17.9992 25.9287C16.7778 26.1217 15.6639 27.2351 15.2449 28.1129ZM20.9323 25.6247C20.7889 25.1054 20.5109 24.6269 20.1197 24.2397C19.53 23.6562 18.7309 23.3278 17.8973 23.3262V23.3234C17.0632 23.3249 16.2638 23.6538 15.674 24.2379C15.0842 24.822 14.7521 25.6139 14.7506 26.44C14.7508 26.5389 14.7557 26.6373 14.7652 26.7349C15.4725 25.8302 16.5683 24.9876 17.8165 24.794C18.9521 24.618 20.1012 25.0299 20.9323 25.6247ZM26.4604 26.3756C26.5515 26.4969 26.6519 26.6122 26.7612 26.7205C27.351 27.3046 28.1505 27.6334 28.9846 27.6349C29.8186 27.6334 30.6181 27.3046 31.2079 26.7205C31.5665 26.3653 31.8298 25.9333 31.9814 25.4636C31.4316 24.7613 30.0418 23.9971 28.8253 24.1907C27.503 24.3977 26.7425 25.6103 26.4604 26.3756ZM32.0872 24.0014C31.1515 23.3283 29.8463 22.885 28.6571 23.0705C27.3357 23.2786 26.4282 24.1391 25.8767 25.0016C25.8513 24.8427 25.8381 24.6812 25.8378 24.5183C25.8386 23.692 26.1704 22.8997 26.7603 22.3154C27.3502 21.7311 28.1502 21.4025 28.9846 21.4017C29.8188 21.4025 30.6188 21.7311 31.2088 22.3154C31.6742 22.7764 31.9789 23.3668 32.0872 24.0014Z"fill="hsl(var(--foreground-light))"/>@@ -139,12 +139,43 @@ export const days: AdventDay[] = [),},{- title: '',- description: '',- id: '',- is_shipped: false,- links: [],- icon: null,+ title: 'Supabase Book',+ description: 'Learn Supabase by building a Multi-Tenant platform',+ id: 'supabase-book',+ is_shipped: true,+ links: [+ {+ url: '/blog/supabase-book-by-david-lorenz',+ label: 'Blog post',+ target: '_blank',+ },+ ],+ icon: (+ <svg+ width="50"+ height="51"+ viewBox="0 0 50 51"+ fill="none"+ xmlns="http://www.w3.org/2000/svg"+ >+ <path+ fillRule="evenodd"+ clipRule="evenodd"+ d="M16.0892 12.5746C15.4328 12.5746 14.8032 12.8353 14.339 13.2995C13.8748 13.7637 13.614 14.3933 13.614 15.0498V35.8419C13.614 36.4984 13.8748 37.128 14.339 37.5922C14.8032 38.0563 15.4328 38.3171 16.0892 38.3171H29.9506C30.4974 38.3171 30.9407 38.7604 30.9407 39.3072C30.9407 39.854 30.4974 40.2973 29.9506 40.2973H16.0892C14.9076 40.2973 13.7743 39.8279 12.9388 38.9924C12.1032 38.1568 11.6338 37.0235 11.6338 35.8419V15.0498C11.6338 13.8681 12.1032 12.7349 12.9388 11.8993C13.7743 11.0638 14.9076 10.5944 16.0892 10.5944H36.8813C37.4281 10.5944 37.8714 11.0376 37.8714 11.5845V20.2478C37.8714 20.7946 37.4281 21.2379 36.8813 21.2379C36.3345 21.2379 35.8912 20.7946 35.8912 20.2478V12.5746H16.0892Z"+ fill="hsl(var(--foreground-light))"+ />+ <path+ fillRule="evenodd"+ clipRule="evenodd"+ d="M12.9388 32.6914C13.7743 31.8559 14.9076 31.3864 16.0892 31.3864H22.3377C22.8846 31.3864 23.3278 31.8297 23.3278 32.3765C23.3278 32.9234 22.8846 33.3666 22.3377 33.3666H16.0892C15.4328 33.3666 14.8032 33.6274 14.339 34.0916C13.8748 34.5558 13.614 35.1854 13.614 35.8419C13.614 36.3887 13.1707 36.832 12.6239 36.832C12.0771 36.832 11.6338 36.3887 11.6338 35.8419C11.6338 34.6602 12.1032 33.527 12.9388 32.6914Z"+ fill="hsl(var(--foreground-light))"+ />+ <path+ d="M34.5183 22.7357C34.5082 22.0719 33.6618 21.7871 33.2444 22.3069L26.9448 30.1517C26.2012 31.0777 26.8681 32.4432 28.0639 32.4432H34.5785L34.6551 37.4985C34.6651 38.1622 35.5115 38.447 35.929 37.9272L42.2285 30.0824C42.9721 29.1565 42.3052 27.791 41.1095 27.791H34.5519L34.5183 22.7357Z"+ fill="hsl(var(--foreground-light))"+ />+ </svg>+ ),},{title: '',diff --git a/apps/www/lib/authors.json b/apps/www/lib/authors.jsonindex dd73f2c8066..b242619a66b 100644--- a/apps/www/lib/authors.json+++ b/apps/www/lib/authors.json@@ -493,5 +493,13 @@"position": "Guest Author","author_url": "https://github.com/anas-araid","author_image_url": "https://github.com/anas-araid.png"+ },+ {+ "author_id": "activenode",+ "author": "David Lorenz",+ "username": "activenode",+ "position": "Guest Author",+ "author_url": "https://github.com/activenode",+ "author_image_url": "https://github.com/activenode.png"}]diff --git a/apps/www/public/images/blog/avatars/paul-copplestone.jpg b/apps/www/public/images/blog/avatars/paul-copplestone.jpgnew file mode 100644index 00000000000..a855e3a248dBinary files /dev/null and b/apps/www/public/images/blog/avatars/paul-copplestone.jpg differdiff --git a/apps/www/public/images/blog/lw12/supabase-book/OG_supabase_book.png b/apps/www/public/images/blog/lw12/supabase-book/OG_supabase_book.pngnew file mode 100644index 00000000000..8377e6720e5Binary files /dev/null and b/apps/www/public/images/blog/lw12/supabase-book/OG_supabase_book.png differdiff --git a/apps/www/public/images/blog/lw12/supabase-book/thumb_supabse_book.png b/apps/www/public/images/blog/lw12/supabase-book/thumb_supabse_book.pngnew file mode 100644index 00000000000..76d8cdd7793Binary files /dev/null and b/apps/www/public/images/blog/lw12/supabase-book/thumb_supabse_book.png differ