Back to Projects

Brethren

My role on this project: Co-Founder / Full Stack Engineer

Project Overview

A multi-tenant church management platform where a single deployment serves any number of churches, each with its own database, domain, branding and installable app. Churches manage members, events, attendance, groups, tasks and celebrations, while publishing sermons, blog posts, announcements, galleries and daily confessions to their congregation.

TypescriptNext.jsNestJSPrismaPostgreSQLTailwind CSSRedisSocket.ioDockerCloudflare R2AWS
Project Link
Brethren

Achievements

  • Co-founded the product and developed the full platform, a NestJS API, a Next.js PWA serving both members and church admins, and a separate Next.js marketing site
  • Designed a database-per-tenant architecture where each church gets its own PostgreSQL database, resolved per request from the browser origin and carried through with AsyncLocalStorage
  • Implemented a Prisma proxy that resolves the current church's client at call time, adding multi-tenancy across 27 existing service files without changing any of them
  • Ensured strict tenant isolation with no default database, tenant claims embedded in JWTs, database-driven CORS origins, and per-church rooms for all Socket.io broadcasts
  • Built an atomic tenant provisioning flow that creates the database, runs migrations, seeds roles and the first admin, and rolls everything back on failure
  • Implemented per-tenant Prisma connection pooling with lease counting and an idle sweeper, so background jobs never hold connections open across every church
  • Implemented passwordless authentication with emailed one-time codes, bcrypt-hashed refresh tokens, and automatic token refresh with request locking on the frontend
  • Implemented role-based access control with 19 granular permissions and custom roles, guaranteeing every church always retains at least one full admin
  • Built an events system with weekly and monthly recurrence rules calculated in UTC, session assignments for members and groups, and email notifications
  • Implemented service check-in with daily expiring codes and QR links, allowing members to check themselves and their children in, with live attendance rosters for admins
  • Developed a content suite for sermons, blogs, announcements, galleries and daily confessions, with drafts, scheduled publishing, and deterministic generated cover artwork derived from each church's brand colour
  • Implemented groups, task assignment and prayer points, alongside scheduled jobs for overdue task tracking, daily reminders and upcoming birthday and anniversary digests
  • Implemented file storage on Cloudflare R2 with separate public and private buckets, browser-side image compression before upload, and a nightly orphan file cleanup job
  • Built per-church branding and PWA support from a single deployment, generating manifests and installable icons at request time
  • Implemented real-time updates with Socket.io and a Redis adapter, and transactional emails with React Email and AWS SES
  • Containerised the platform with Docker Compose and automated control and per-church migrations on boot
John Olatubosun