Skip to content

Xcelsama/Church-firstimer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⛪ Church Registry Portal

Salvation Ministries Home of Success — Obiri-Ikwerre Branch

A fast, mobile-friendly web app for tracking first-time visitors, new converts, and evangelism records. Built for church workers and admins — no accounts, no signup, just a secure access code.

Stack DB Deploy Status


✨ Features

For Workers

  • Register First Timers with service, contact info, and follow-up status
  • Register New Converts with soul winner details
  • Log Evangelism outreach records
  • View and search all records they've submitted
  • Update follow-up status (Pending → Contacted → Fully Followed Up)

For Admins

  • Everything workers can do, plus full record editing
  • Sessions tab — see who is currently online and track every login with browser, device, OS, IP address, city, and country
  • Settings panel with overview stats, service breakdown charts, records-by-worker chart, and date-range filtering
  • CSV export for any record type
  • Change worker and admin passwords (session-scoped)

Security

  • Role-based access via password codes (worker vs admin)
  • Passwords served from Vercel environment variables — never hardcoded in the client
  • Workers cannot delete records — only admins can edit, and no one can delete
  • Admin dashboard protected by auth guard; unauthenticated access redirects to login

🗂️ Project Structure

/
├── index.html        # Worker login + portal (First Timers, Converts, Evangelism, Records)
├── style.css         # Shared styles (navy + gold theme)
├── app.js            # Worker-side logic (auth, forms, records, session tracking)
├── admin.html        # Admin dashboard
├── admin.css         # Admin-specific styles (settings panel, sessions tab, edit modal)
├── admin.js          # Admin logic (edit modal, sessions, charts, password management)
├── vercel.json       # Vercel routing rules
└── api/
    └── config.js     # Serverless function — serves passwords from env vars

🗃️ Database (Supabase)

Four tables are required. Run the SQL below in your Supabase SQL Editor.

First_timers

create table "First_timers" (
  id            bigint generated always as identity primary key,
  date          date,
  name          text not null,
  program       text,
  sex           text,
  phone         text,
  address       text,
  followup      text default 'Pending',
  notes         text,
  registered_by text
);

new_converts

create table new_converts (
  id            bigint generated always as identity primary key,
  date          date,
  name          text not null,
  program       text,
  sex           text,
  phone         text,
  soul_winner   text,
  address       text,
  followup      text default 'Pending',
  notes         text,
  registered_by text
);

evangelism

create table evangelism (
  id            bigint generated always as identity primary key,
  date          date,
  name          text not null,
  sex           text,
  phone         text,
  location      text,
  evangelist    text,
  response      text,
  address       text,
  followup      text default 'Pending',
  notes         text,
  registered_by text
);

login_sessions

create table login_sessions (
  id               bigint generated always as identity primary key,
  worker_name      text,
  role             text,
  browser          text,
  device_type      text,
  os               text,
  user_agent       text,
  login_time       timestamptz,
  logout_time      timestamptz,
  is_online        boolean default true,
  location_ip      text,
  location_city    text,
  location_country text
);

🚀 Deployment

1. Clone the repo

git clone https://github.com/YOUR_USERNAME/church-registry.git
cd church-registry

2. Set up Supabase

  1. Create a free project at supabase.com
  2. Run all four SQL table scripts above in the SQL Editor
  3. Copy your Project URL and anon public key from Settings → API
  4. Replace the values at the top of app.js and admin.js:
var SUPABASE_URL = 'https://your-project.supabase.co';
var SUPABASE_KEY = 'your-anon-key';

3. Deploy to Vercel

npm i -g vercel
vercel

Or connect your GitHub repo directly at vercel.com for automatic deployments on every push.

4. Set Environment Variables in Vercel

In your Vercel project dashboard go to Settings → Environment Variables and add:

Variable Description
WORKER_PASSWORD Access code given to church workers
ADMIN_PASSWORD Access code for admin-only access

⚠️ Never commit passwords to the repo. They are served securely via /api/config.


🔐 How Access Control Works

Login Screen
├── Enter Name + Access Code
│   ├── Matches WORKER_PASSWORD → Worker Portal (index.html)
│   └── Matches ADMIN_PASSWORD  → Admin Dashboard (admin.html)
  • Workers can register and update follow-up status only
  • Admins can register, edit any record, view session logs, and manage settings
  • No one can delete records — this is enforced at the UI level

👁️ Session Tracking

Every login is recorded with:

Field Source
Name & Role Login form
Browser navigator.userAgent parsing
OS & Device navigator.userAgent parsing
IP Address ipapi.co (free, no key)
City & Country ipapi.co
Login / Logout time new Date().toISOString()
Online status Set false on sign out

Admins can view all of this live in the 👁 Sessions tab.


🎨 Design

  • Color scheme: Navy blue (#0f172a) + Gold (#d4af37)
  • Font: Poppins via Google Fonts
  • Fully responsive — works on mobile, tablet, and desktop
  • Zero external UI frameworks — pure HTML, CSS, and vanilla JS

📸 Screenshots

Add screenshots of the login screen, worker portal, admin dashboard, and sessions tab here.


🛠️ Built With

  • Frontend: Vanilla HTML, CSS, JavaScript
  • Database: Supabase (PostgreSQL via REST API)
  • Hosting: Vercel (with serverless /api/config route)
  • Geo/IP: ipapi.co (login tracking)
  • Fonts: Google Fonts — Poppins

👨‍💻 Developer

Built by Excel Fullstack Dev, Port Harcourt.

GitHub Stardev


📄 License

This project is private and built specifically for Salvation Ministries Home of Success, Obiri-Ikwerre Branch. Please do not redistribute without permission.

About

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors