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.
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_idcolumn. - 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
Install the Supabase client for Next.js
npm install @supabase/supabase-js @supabase/ssrThe 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.