← Selected work

Church / Community Management System

An internal system for event registration, attendance tracking, outing requests, and role-based administration — optimized for busy ministry teams and student fellowships.

Role
Full-stack build
Stack
Next.js, Prisma, PostgreSQL
Scope
Events, attendance, outings, and role-based admin
Result
Replaced scattered Forms/Sheets; used by 100+ users
01 — Problem → solution

The problem → the solution

source: project write-up
before · the problem

Administrative Nightmare

  1. ✕
    Data Fragmentation: Relied on duplicating Google Forms for every event, causing scattered data.
  2. ✕
    Manual Logistics: Admins had to manually count participants by region to arrange transportation.
  3. ✕
    Data Duplication: Members frequently submitted multiple registrations due to uncertainty.
  4. ✕
    Painful Auditing: Year-end attendance tracking required manually cross-referencing massive Google Sheets.
after · the solution

Centralized Automation

  1. 01
    Self-Service Portal: Members can track, update, or cancel their own registrations via internal accounts.
  2. 02
    Automated Logistics: Dashboards auto-filter and aggregate transportation needs by area.
  3. 03
    Smart Attendance: Cell Group Leaders get 1-click attendance checklists pre-filtered for their members, replacing Excel entirely.
  4. 04
    Anti-Spam Architecture: Public registration is allowed, but strictly blocks duplicate phone numbers.
02 — Flow

Event sign-up to boarding

source: code · zhuendazhuan (repo-notes) · events/[id]/register, admin transport, transport/[token]/boarding
live trace · Event sign-up to boardingscroll to play · tap a step on mobile
no yes yes no Log in: JWT cookie Open /events: recentwindow ◆ Open and notfull? New sign-up blocked Register: transport,area, address ◆ Same user orphone on thisevent? Update the existingsign-up CreateEventRegistration Admin assigns ridersto vans Driver marks boardingvia share link
  1. 01
    Log in: JWT cookie→ Open /events: recent window
  2. 02
    Open /events: recent window→ Open and not full?
  3. 03
    ◆ Open and not full?→ New sign-up blocked [no]→ Register: transport, area, address [yes]
  4. 04
    New sign-up blocked
  5. 05
    Register: transport, area, address→ Same user or phone on this event?
  6. 06
    ◆ Same user or phone on this event?→ Update the existing sign-up [yes]→ Create EventRegistration [no]
  7. 07
    Update the existing sign-up→ Admin assigns riders to vans
  8. 08
    Create EventRegistration→ Admin assigns riders to vans
  9. 09
    Admin assigns riders to vans→ Driver marks boarding via share link
  10. 10
    Driver marks boarding via share link
03 — Sequence

Van assignment and boarding

source: code · zhuendazhuan (repo-notes) · api/admin/events/[id]/transport, api/transport/[token]/boarding
live trace · Van assignment and boardingscroll to play · tap a step on mobile
Admin API RBAC Database Driver 01PUT /api/admin/events/:id/transport 02requirePermission transport.edit 03riders on this event, not NONE, one van each 04transaction: share token, upsert vans, reassign 05shareToken; moved riders reset isBoarded 06PATCH /api/transport/:token/boarding 07set isBoarded for assigned riders only
  1. 01
    Admin → APIPUT /api/admin/events/:id/transport
  2. 02
    API → RBACrequirePermission transport.edit
  3. 03
    API → Databaseriders on this event, not NONE, one van each
  4. 04
    API → Databasetransaction: share token, upsert vans, reassign
  5. 05
    API → AdminshareToken; moved riders reset isBoarded
  6. 06
    Driver → APIPATCH /api/transport/:token/boarding
  7. 07
    API → Databaseset isBoarded for assigned riders only
04 — Data model

Data model (simplified)

source: code · zhuendazhuan (repo-notes) · prisma/schema.prisma
explorer · Data model (simplified)click a table

Tap a table to see what it links to.

ROLEstring roleint level
ROLE_PERMISSION
PERMISSION
USERstring usernamestring areaIdstring cellGroupIdbool isActive
CELL_GROUP
TRANSPORT_AREA
EVENTbool isOpenint maxParticipantbool isRegularstring transportShareToken
EVENT_REGISTRATIONstring phoneenum transportbool isGoingEarlybool isBoardedunique userId_eventId
EVENT_TRANSPORT_VEHICLEstring driverNamestring plateNumber
ATTENDANCEbool attended
OUTINGenum adminApproveenum transportApprove
OUTING_PARTICIPANT
  • ROLE grants ROLE_PERMISSION 1 → many
  • PERMISSION granted by ROLE_PERMISSION 1 → many
  • USER has ROLE many ↔ many
  • CELL_GROUP groups USER 1 → many
  • TRANSPORT_AREA home area USER 1 → many
  • EVENT receives EVENT_REGISTRATION 1 → many
  • USER signs up (null for guests) EVENT_REGISTRATION 1 → many
  • TRANSPORT_AREA pick-up area EVENT_REGISTRATION 1 → many
  • EVENT uses EVENT_TRANSPORT_VEHICLE 1 → many
  • EVENT_TRANSPORT_VEHICLE carries EVENT_REGISTRATION 1 → many
  • EVENT records ATTENDANCE 1 → many
  • USER attends ATTENDANCE 1 → many
  • OUTING includes OUTING_PARTICIPANT 1 → many
  • USER joins OUTING_PARTICIPANT 1 → many
05 — Features

Features

open a row to read more
01

Event Registration

Visitors can register for open events directly from the navbar without logging in. Registration collects name, phone, and address. Each phone number can register only once per event to prevent duplicates. Logged-in users are redirected to the registration page and will see their default address prefilled; they can update or cancel their registration later.

02

Event Management

Authorized roles can create and manage events, with filters by event type and date for quick lookup. When creating an event, you can mark it as a regular event (attendance required) and choose a regular event type, and optionally open it for public registration. Deleting events is restricted and discouraged, because regular events are linked to attendance records.

03

Attendance

Regular events show an Attendance button visible only to specific roles. Cell Group Leaders see only their group’s active members, while senior leaders and the secretary can see all groups and filter by group. Taking attendance is intentionally simple: tick names and save. An attendance rate report (admin-only) can be generated for a selected date range and event type to list members who meet a target attendance rate.

04

Outing Request & Approvals

Cell Group Leaders and Trainee Leaders can request an outing by providing topic, date, time, venue, and description, and by adding participants from their own or other groups. Mentors (SV) and the Transportation Team Leader review requests in detail and can approve or reject them; statuses update in real time.

05

User Management & Roles

Users with sufficient role level can view member profiles; the Administrative Team can assign roles and groups, set members as inactive (with bulk operations), and changes propagate automatically — e.g., roles are auto-removed when a member becomes inactive. Lists are filterable by group and status. Clicking a phone number opens WhatsApp for quick contact.

06

CSV Import (Bulk Events & Users)

For internal use, sign-up is disabled. Admins import members and events via CSV. On import, new users automatically receive an email with their login credentials. CSV rules enforce clean data: specific date/time formats, lowercase yes/no flags for regular/open events, and strict event type names for regular events. For users, required fields include name, email, phone, gender, and area; phone must start with 0 and use no dashes; some areas require an address; baptism is a yes/no value.

06 — Details

More details

open a row to read more
01

Engineering Spotlight

01. Granular RBAC & Security

To handle complex church hierarchies, I implemented a multi-tier Role-Based Access Control (RBAC) system. Using Next.js Middleware and JWT, routes are strictly protected. On the client side, custom React hooks compute integer-based role levels (e.g., Level > 5 for Admins) to dynamically render UI components. Account creation is entirely closed off from the public (handled exclusively via CSV import) to eliminate spam accounts.

02. Prisma Aggregation & Data Integrity

Replaced manual spreadsheet calculations with dynamic PostgreSQL queries via Prisma. The backend API handles pagination, multi-parameter filtering (by date and event type), and complex joins to generate instant attendance rate statistics. Additionally, the system enforces strict unique constraints (like phone number validation) to prevent data duplication from visitors.

02

Tech Stack

Built with a modern TypeScript/JavaScript stack for speed, maintainability, and low operational overhead.

Next.js React TailwindCSS Prisma PostgreSQL Vercel

Frontend: React, Next.js, Tailwind CSS

Backend: Node.js, Next.js API Routes, Prisma

Database: PostgreSQL

Auth: JWT cookie auth with role levels and per-route guards

Deployment: Vercel

03

Access Control Snapshot

Visitors

Register for open events without an account

Members

Manage their registrations, update profiles, view relevant lists

Leaders & Admins

Create events, take attendance, request/approve outings, administer roles & groups

04

Future Roadmap

Attendance Insights

Advanced analytics for cohort trends and pastoral follow-up

Automated Notifications

Email/WhatsApp reminders for registrations, approvals, and absences