Skip to main content
Zee Academy · Lesson 11 · Databases: Supabase and PostgreSQL

Supabase: PostgreSQL in the Cloud, Tables and Data Types

Supabase gives you a powerful PostgreSQL server with a simple dashboard, an automatic REST API and a built-in authentication system.

Next lesson

What you will learn

  • Supabase is an open-source alternative to Firebase, built on real, industry-standard PostgreSQL.
  • Tables and columns: every value has a strictly defined type (UUID, TEXT, BOOLEAN, TIMESTAMPTZ, JSONB).
  • Relations (foreign keys): for example, an order is linked to the right customer through a customer_id column.
  • Connection string: the secure address your Next.js server uses to connect, for example through Prisma or Drizzle ORM.

Creating a project and your first table

In the Supabase Table Editor, create a leads table with these fields: id (uuid), created_at, name (text), email (text), phone (text), status (text).

Step by step

  1. Install the Supabase client for Next.js

    npm install @supabase/supabase-js @supabase/ssr

    The official libraries for working safely with Supabase in Server and Client Components.

Tip from practice

Always set "DEFAULT now()" on the created_at column. The database will then record the exact date and time each enquiry arrived on its own.