Back to projects
Supabase Message Board

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

  1. Set Up Supabase:

    supabase init  
    supabase start  
  2. Run Frontend:

    npm install  
    npm run dev  
  3. Run Tests:

    npx playwright test  
  4. Access App:
    Visit http://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)