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
The problem → the solution
source: project write-upAdministrative Nightmare
- ✕Data Fragmentation: Relied on duplicating Google Forms for every event, causing scattered data.
- ✕Manual Logistics: Admins had to manually count participants by region to arrange transportation.
- ✕Data Duplication: Members frequently submitted multiple registrations due to uncertainty.
- ✕Painful Auditing: Year-end attendance tracking required manually cross-referencing massive Google Sheets.
Centralized Automation
- 01Self-Service Portal: Members can track, update, or cancel their own registrations via internal accounts.
- 02Automated Logistics: Dashboards auto-filter and aggregate transportation needs by area.
- 03Smart Attendance: Cell Group Leaders get 1-click attendance checklists pre-filtered for their members, replacing Excel entirely.
- 04Anti-Spam Architecture: Public registration is allowed, but strictly blocks duplicate phone numbers.
Event sign-up to boarding
source: code · zhuendazhuan (repo-notes) · events/[id]/register, admin transport, transport/[token]/boarding- 01Log in: JWT cookie→ Open /events: recent window
- 02Open /events: recent window→ Open and not full?
- 03◆ Open and not full?→ New sign-up blocked [no]→ Register: transport, area, address [yes]
- 04New sign-up blocked
- 05Register: transport, area, address→ Same user or phone on this event?
- 06◆ Same user or phone on this event?→ Update the existing sign-up [yes]→ Create EventRegistration [no]
- 07Update the existing sign-up→ Admin assigns riders to vans
- 08Create EventRegistration→ Admin assigns riders to vans
- 09Admin assigns riders to vans→ Driver marks boarding via share link
- 10Driver marks boarding via share link
Van assignment and boarding
source: code · zhuendazhuan (repo-notes) · api/admin/events/[id]/transport, api/transport/[token]/boarding- 01Admin → APIPUT /api/admin/events/:id/transport
- 02API → RBACrequirePermission transport.edit
- 03API → Databaseriders on this event, not NONE, one van each
- 04API → Databasetransaction: share token, upsert vans, reassign
- 05API → AdminshareToken; moved riders reset isBoarded
- 06Driver → APIPATCH /api/transport/:token/boarding
- 07API → Databaseset isBoarded for assigned riders only
Data model (simplified)
source: code · zhuendazhuan (repo-notes) · prisma/schema.prismaTap a table to see what it links to.
- 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
Features
open a row to read more01Event Registration
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.
02Event Management
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.
03Attendance
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.
04Outing Request & Approvals
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.
05User Management & Roles
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.
06CSV Import (Bulk Events & Users)
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.
More details
open a row to read more01Engineering Spotlight
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.
02Tech Stack
Tech Stack
Built with a modern TypeScript/JavaScript stack for speed, maintainability, and low operational overhead.
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
03Access Control Snapshot
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
04Future Roadmap
Future Roadmap
Attendance Insights
Advanced analytics for cohort trends and pastoral follow-up
Automated Notifications
Email/WhatsApp reminders for registrations, approvals, and absences