Skip to content

stahlscott/blockclub

Repository files navigation

Lakewood Block Club

The neighborhood community app powering lakewoodblock.club.

This is an open source project. Want to run your own? See SELF-HOSTING.md.

Features

  • Resident Directory - Find and connect with neighbors, with search and multiple sort options (address, name, move-in year, join date)
  • Lending Library - Share tools, kitchen items, and more with neighbors across 10 categories
  • Bulletin Board - Share updates, questions, and announcements with your neighborhood
  • Neighborhood Guide - Community-curated information (trash day, local resources, block party dates)
  • Multi-Neighborhood Support - Join multiple neighborhoods with a single account, set a primary neighborhood
  • Member Profiles - Address, unit, move-in year, children, pets, bio, multiple phone numbers and emails with labels
  • Invite System - Share invite links to bring neighbors into your community
  • Admin Controls - Approve new members, manage roles, moderate content
  • Account Settings - Change password, notification preferences, copy invite links
  • PWA Support - Add to home screen for a native app-like experience on mobile

Tech Stack

  • Monorepo: Turborepo
  • Web: Next.js 16 (React 19)
  • Mobile: Expo (React Native) - scaffold only, PWA approach preferred
  • Backend: Supabase (PostgreSQL, Auth, Storage)
  • Language: TypeScript

Project Structure

blockclub/
├── apps/
│   ├── web/              # Next.js web application
│   │   └── src/
│   │       ├── app/      # App router pages and layouts
│   │       ├── components/  # Shared React components
│   │       └── lib/      # Utilities, Supabase client
│   └── mobile/           # Expo mobile application (scaffold)
├── packages/
│   └── shared/           # Shared types, validation, date utils, permissions, loan logic
├── supabase/
│   └── migrations/       # Database schema migrations
├── turbo.json            # Turborepo configuration
└── package.json          # Root package.json with workspaces

Getting Started

Prerequisites

  • Node.js 18+
  • npm 10+
  • Supabase account (free tier works)

Setup

  1. Clone the repository

    git clone https://github.com/stahlscott/blockclub.git
    cd blockclub
  2. Install dependencies

    npm install
  3. Set up Supabase

    1. Create a new project at supabase.com
    2. Install Supabase CLI and link your project:
      npm install -g supabase
      supabase login
      supabase link --project-ref your-project-ref
    3. Apply migrations:
      supabase db push
    4. Go to Project Settings > API and copy your credentials
  4. Set up environment variables

    Copy the example env file:

    cp apps/web/.env.example apps/web/.env.local

    Edit apps/web/.env.local with your Supabase credentials:

    NEXT_PUBLIC_SUPABASE_URL=https://your-project-ref.supabase.co
    NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=your-publishable-key
    STAFF_ADMIN_EMAILS=your-email@example.com
    
  5. Run development server

    npm run dev:web
  6. Open the app

User Roles

Capability Staff Admin Neighborhood Admin Member
Create neighborhoods Yes No No
Approve/reject join requests Yes Own neighborhood No
Remove members Yes Own neighborhood No
Remove any item Yes Own neighborhood Own only
Promote member to admin Yes Own neighborhood No
Demote admin to member Yes No No

Database Schema

The app uses a multi-tenant architecture where all data is scoped to neighborhoods:

┌─────────────────┐       ┌─────────────────┐
│  neighborhoods  │       │     users       │
├─────────────────┤       ├─────────────────┤
│ id              │       │ id              │
│ name            │       │ email           │
│ slug            │       │ name            │
│ description     │       │ bio             │
│ location        │       │ address / unit  │
│ settings        │       │ phones[]        │
└────────┬────────┘       │ emails[]        │
         │                │ move_in_year    │
         │                │ children / pets │
         │                └────────┬────────┘
         │    ┌─────────────────┐  │
         └───►│   memberships   │◄─┘
              ├─────────────────┤
              │ user_id         │
              │ neighborhood_id │
              │ role            │
              │ status          │
              └─────────────────┘

┌─────────────────┐       ┌─────────────────┐
│     items       │       │     loans       │
├─────────────────┤       ├─────────────────┤
│ id              │◄──────│ item_id         │
│ neighborhood_id │       │ borrower_id     │
│ owner_id        │       │ status          │
│ name            │       │ due_date        │
│ category        │       │ returned_at     │
│ availability    │       └─────────────────┘
└─────────────────┘

All tables have Row Level Security (RLS) policies ensuring users can only access data in their neighborhoods.

Environment Variables

Variable Description
NEXT_PUBLIC_SUPABASE_URL Supabase project URL
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY Supabase publishable key
STAFF_ADMIN_EMAILS Comma-separated list of staff admin emails
NEXT_PUBLIC_SENTRY_DSN Sentry DSN for error reporting
SENTRY_ORG Sentry organization slug (build-time)
SENTRY_PROJECT Sentry project slug (build-time)
SENTRY_AUTH_TOKEN Sentry auth token for source maps (build-time)

Infrastructure

Service Purpose Notes
Supabase Database, Auth, Storage PostgreSQL with RLS, email/password auth, image storage
Vercel Hosting, DNS Automatic deploys from main branch
Sentry Error Monitoring Error tracking with source maps, session replay
Resend Transactional email Auth emails (confirmation, password reset) via Supabase SMTP
ImprovMX Email forwarding Forwards contact emails to personal address

Scripts

npm run dev:web    # Start web dev server
npm run build:web  # Build web app
npm run lint       # Lint all packages

Fork This Project

Block Club is designed to be forkable for other neighborhoods and communities. The codebase is neighborhood-agnostic—just configure your own Supabase backend and deploy.

See SELF-HOSTING.md for complete setup instructions.

License

MIT License - see LICENSE for details.

About

Lakewood Block Club

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors