Gatherly

Community discovery platform with server-rendered listings and multi-provider auth.

Screenshot of Gatherly

Overview

Built on Next.js 14 App Router with a deliberate Server/Client Component boundary: community and event listing pages render server-side for fast initial load, while auth-gated interactions (join buttons, create form, manage table) are isolated to Client Components to avoid shipping unnecessary JS for static content. NextAuth.js handles credential and Google OAuth flows, session persistence, and CSRF protection. The mobile-first layout was designed around 360px as the baseline viewport — the majority of the Bangladesh audience accesses the web on mid-range Android devices.

What it does

  • NextAuth.js with credentials provider and Google OAuth — session persisted via JWT strategy
  • Server Component rendering for community and event listing pages — fast TTFB without client JS overhead
  • Full-text search across community names, tags, and descriptions
  • Mobile-first responsive layout — 360px viewport as design baseline
  • Protected community creation form and manage-communities table behind NextAuth session guard

Problems and how I solved them

Problem

NextAuth.js session not available in Server Components without explicit server-side session fetching

Fix

Used getServerSession from next-auth/next in auth-gated Server Components; Client Components use the useSession hook — both patterns are consistent across the codebase

Problem

localStorage used for some state — unavailable during SSR, causing hydration mismatches on initial render

Fix

Wrapped all localStorage reads in a useEffect with an isMounted guard; longer term this would move to cookie-based or database-backed storage