Back to projects

Supabase Message Board
HongYip Cheng / May 20, 2025
Demo: Link
π Overview
A modern message board built with:
β React + TypeScript (strict typing)
β Supabase (Auth + PostgreSQL)
β Row-Level Security (RLS) for data safety
Developed as a full-stack learning project between May 5-20, 2025
β¨ Features
- Realtime Messages
Fetch and display posts with Supabase subscriptions - Secure Auth
Google/GitHub login + custom React hook for session management - Fine-Grained Permissions
PostgreSQL RLS policies control CRUD operations - End-to-End Testing
Playwright tests for critical user flows
π οΈ Tech Stack
- React 18: A JavaScript library for building interactive UIs with hooks.
- TypeScript: Strongly typed JavaScript for scalable frontend code.
- Supabase: Open-source Firebase alternative with PostgreSQL and Auth.
- PostgreSQL RLS: Row-level security for granular database permissions.
- React Router v6: Client-side routing for single-page applications.
- Playwright: End-to-end testing for reliable user flows.
- Netlify: Cloud platform for deploying static and serverless sites.
- Docker: Containerization for local Supabase development.
β‘ Quick Start
-
Set Up Supabase:
supabase init supabase start
-
Run Frontend:
npm install npm run dev
-
Run Tests:
npx playwright test
-
Access App:
Visithttp://localhost:3000
π Project Structure
supabase-message-board/
βββ src/
β βββ hooks/ # Custom hooks (e.g., `useSession`)
β βββ components/ # UI (PostList, AuthButtons)
β βββ contexts/ # React context providers
β βββ types/ # TypeScript interfaces
β βββ utils/ # Supabase client config
βββ tests/ # Playwright E2E tests
βββ supabase/ # Local DB migrations + RLS policies
βββ Dockerfile # Supabase CLI config
βββ README.md
π Development Notes
Why Supabase?
- Replaced Firebase with open-source alternative
- PostgreSQLβs RLS enabled secure direct DB access
- Built-in Auth saved 100+ lines of custom code
Key Learnings:
β Writing RLS policies for multi-tenant data
β Creating custom React hooks for Supabase Auth
β Testing authenticated flows with Playwright
Conclusion
This project demonstrates how to build a scalable, secure full-stack app with:
- Minimal boilerplate (leveraging Supabaseβs APIs)
- Type safety across frontend and database
- Production-ready practices (E2E tests, RLS)