Login
Features Documentation Contact Login
Documentation

PAC System
Documentation

Everything you need to set up, configure, and operate the PAC Management System — from first login to advanced analytics and multi-center deployments.

Version 2.0.0 Updated 2025 Firebase 10.x Stable Release

Quick Start

Get up and running in minutes with our step-by-step setup guide.

PAC Entries

Learn how to submit, edit, and track PAC records across all centers.

Roles & Auth

Configure granular permissions and secure every operator account.

API Reference

Complete Firestore collection schemas and query reference.

Quick Start

Follow these steps to get PAC Management running in your environment. The system is hosted on Vercel and backed by Google Firestore — no local server required.

  1. 1

    Access the Platform

    Navigate to cscpac.vercel.app in any modern browser. No installation needed — PAC is a Progressive Web App.

  2. 2

    Login with Admin Credentials

    Use your assigned admin email and password on the login page. First-time setup credentials are provided by the system administrator.

  3. 3

    Register Your Center

    Navigate to Center Management → Add New Center. Assign a unique Center ID, location, and the UCL owner responsible.

  4. 4

    Add Operators

    Go to Agent Tracking → Create Operator. Set their role (View-Only, Data Entry, Manager, or Admin) and link them to a center.

  5. 5

    Start Submitting PAC Entries

    Operators can immediately begin submitting PAC records. All data syncs to Firestore in real time across every connected session.

Pro Tip

Bookmark the dashboard on mobile for instant PWA access — operators get a native app-like experience with no install required.

Installation & Config

PAC Management runs entirely in the browser with no backend setup required. If you are self-hosting or customizing the codebase, follow the steps below.

Firebase Configuration

Replace the Firebase config object in index.html and all dashboard files with your own project credentials from the Firebase Console.

JavaScript
// firebase-config.js
const firebaseConfig = {
  apiKey:            "YOUR_API_KEY",
  authDomain:        "your-project.firebaseapp.com",
  projectId:         "your-project-id",
  storageBucket:     "your-project.appspot.com",
  messagingSenderId: "123456789",
  appId:             "1:123456789:web:abcdef"
};

const app = initializeApp(firebaseConfig);
const db  = getFirestore(app);

Deploying to Vercel

Bash
# Install Vercel CLI
npm install -g vercel

# Deploy from project root
vercel --prod

# Set environment variables (optional)
vercel env add FIREBASE_API_KEY
Important

Never commit your Firebase API keys to a public repository. Use Vercel environment variables or a .env file added to .gitignore.

PAC Entries

PAC entries are the core data unit of the system. Each record represents a single Aadhaar enrollment transaction linked to a center, operator, and timestamp.

Firestore Collection Schema

Firestore Document
// Collection: pacEntries / {docId}
{
  centerId:    "SC-04",          // Center reference ID
  operatorId:  "op_meheraj",     // Operator UID
  enrollName:  "Rahul Das",       // Enrollee name
  aadhaarLast: "XXXX",            // Last 4 digits
  status:      "verified",        // pending | verified | rejected
  timestamp:   serverTimestamp(), // Auto Firestore timestamp
  syncedAt:    serverTimestamp(), // Last sync time
  notes:       ""                 // Optional operator notes
}

Entry Statuses

StatusDescriptionWho Can Change
pendingEntry submitted, awaiting reviewAny operator
verifiedEnrollment confirmed and validatedManager / Admin
rejectedEntry flagged with a reasonAdmin only
syncingOffline entry pending cloud syncSystem automatic
Offline Support

Firestore offline persistence is enabled by default. Entries submitted without internet are queued locally and synced automatically when connectivity is restored.

Center Management

Each Aadhaar enrollment center is registered as a document in the centers Firestore collection. Centers are linked to UCL owners and can have multiple assigned operators.

Center Document Schema

Firestore Document
// Collection: centers / {centerId}
{
  centerId:   "SC-04",
  name:       "Singi Enrollment Center",
  location:   "Singi, Bolpur, Birbhum",
  pincode:    "731240",
  uclOwner:   "sabir_chowdhury",
  active:     true,
  operators:  ["op_meheraj", "op_samrat"],
  createdAt:  serverTimestamp()
}

Authentication

PAC Management uses Firebase Authentication with email/password sign-in. All sessions are managed server-side via Firebase ID tokens — no custom auth server required.

Login Flow

JavaScript
import { getAuth, signInWithEmailAndPassword }
  from "firebase/auth";

const auth = getAuth();

async function login(email, password) {
  try {
    const result = await signInWithEmailAndPassword(
      auth, email, password
    );
    // Redirect to dashboard on success
    window.location.href = "/dashboard.html";
  } catch (err) {
    console.error("Login failed:", err.message);
  }
}
Security Note

Always enforce Firebase Security Rules — never rely solely on client-side auth checks. Rules are the last line of defense against unauthorized data access.

Roles & Permissions

PAC Management uses a four-tier role system enforced at both the application and Firestore Rules level.

RolePAC EntriesCentersOperatorsReportsSettings
AdminFullFullFullFullFull
ManagerFullView+EditView OnlyFullNo
Data EntryAdd OnlyView OnlyNoOwn OnlyNo
View OnlyRead OnlyRead OnlyNoView OnlyNo

Setting a User Role

Roles are stored in the users collection and read on every authenticated request. Admin assigns roles from the operator management panel.

Firestore Document
// Collection: users / {uid}
{
  uid:       "firebase_uid_here",
  name:      "Meheraj Chowdhuri",
  email:     "meheraj@example.com",
  role:      "data_entry",  // admin | manager | data_entry | view_only
  centerId:  "SC-04",
  active:    true
}

Firestore Security Rules

These rules ensure only authenticated users with the correct role can read or write each collection. Deploy them from the Firebase Console under Firestore → Rules.

Firestore Rules
rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {

    // Helper: get caller's role
    function role() {
      return get(/databases/$(database)/documents/users/$(
        request.auth.uid)).data.role;
    }

    // PAC Entries
    match /pacEntries/{id} {
      allow read:  if request.auth != null;
      allow write: if role() in ['admin','manager','data_entry'];
    }

    // Centers — admins and managers only
    match /centers/{id} {
      allow read:  if request.auth != null;
      allow write: if role() in ['admin', 'manager'];
    }

    // Users — admin only
    match /users/{uid} {
      allow read:  if request.auth.uid == uid || role() == 'admin';
      allow write: if role() == 'admin';
    }
  }
}

Real-Time Sync

PAC Management uses Firestore's onSnapshot listeners to push live updates to all connected dashboards. No polling, no manual refresh — changes appear in under 500ms.

JavaScript
import { collection, onSnapshot, query, orderBy }
  from "firebase/firestore";

// Listen to all PAC entries in real time
const q = query(
  collection(db, "pacEntries"),
  orderBy("timestamp", "desc")
);

const unsubscribe = onSnapshot(q, (snapshot) => {
  snapshot.docChanges().forEach((change) => {
    if (change.type === "added")    renderNewEntry(change.doc);
    if (change.type === "modified") updateEntry(change.doc);
    if (change.type === "removed")  removeEntry(change.doc.id);
  });
});

// Call unsubscribe() to stop listening when leaving page

Backup System

PAC Management runs automatic incremental backups every 30 seconds for active sessions, with a full daily snapshot stored in Google Cloud Storage.

Auto Backup

Every 30 seconds during active sessions. Zero manual effort required.

Daily Snapshot

Full database snapshot stored daily with 30-day retention in Cloud Storage.

Manual Trigger

Trigger an on-demand backup any time from the Admin Settings panel.

Backup Location

All backups are stored in your Firebase project's default Cloud Storage bucket under /backups/pac/{date}/. Access them from the Firebase Console → Storage.

Exports & Reports

The Reports module lets you export any filtered dataset in multiple formats. Filter by date range, center, operator, or status before exporting.

FormatAvailable ForStatus
CSVAll PAC entries, filtered datasetsAvailable
XLSXAll PAC entries, center summariesAvailable
PDFMonthly reports, operator summariesAvailable
Scheduled EmailWeekly/monthly auto-reportsBeta

API Reference

PAC Management reads and writes data directly via the Firestore SDK. The following collections form the core data model.

Collections

READcollection("pacEntries")
WRITEcollection("pacEntries")
READcollection("centers")
UPDATEcollection("centers")
READcollection("users")
WRITEcollection("uclOwners")
READcollection("pacnav")
SDK Version

PAC Management uses Firebase JS SDK v10.12.4. Always import from the modular SDK (firebase/firestore) for optimal bundle size.

Changelog

v2.0.0 — 2025

  • + Complete UI redesign with dark space-command aesthetic
  • + Real-time activity feed with live Firestore listeners
  • + HUD-style hero section with animated system panels
  • + Progressive Web App (PWA) support
  • ~ Upgraded to Firebase SDK v10.12.4
  • ~ Static nav replaces Firestore-driven nav system

v1.0.0 — 2024

  • + Initial release with PAC entry management
  • + Firebase Auth integration
  • + Basic center and operator management

FAQ

Can multiple operators work on the same center simultaneously?
Yes. Firestore handles concurrent writes gracefully. Each operator's session is independent, and all updates are merged in real time across all connected dashboards without conflicts.
How do I reset an operator's password?
From the Firebase Console → Authentication, find the user and click "Reset Password". Alternatively, the admin panel has a "Send Password Reset Email" option under Operator Settings.
What is the maximum number of centers supported?
There is no hard limit imposed by PAC Management itself. Firestore scales horizontally, so hundreds of centers and thousands of concurrent operators are supported within standard Firebase quotas.
Is data encrypted at rest?
Yes. Google Cloud Firestore encrypts all data at rest using AES-256 by default. Data in transit is protected by TLS 1.3. No additional configuration is required.