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.
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
Access the Platform
Navigate to
cscpac.vercel.appin any modern browser. No installation needed — PAC is a Progressive Web App. - 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
Register Your Center
Navigate to Center Management → Add New Center. Assign a unique Center ID, location, and the UCL owner responsible.
- 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
Start Submitting PAC Entries
Operators can immediately begin submitting PAC records. All data syncs to Firestore in real time across every connected session.
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.
// 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
# Install Vercel CLI npm install -g vercel # Deploy from project root vercel --prod # Set environment variables (optional) vercel env add FIREBASE_API_KEY
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
// 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
| Status | Description | Who Can Change |
|---|---|---|
pending | Entry submitted, awaiting review | Any operator |
verified | Enrollment confirmed and validated | Manager / Admin |
rejected | Entry flagged with a reason | Admin only |
syncing | Offline entry pending cloud sync | System automatic |
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
// 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
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); } }
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.
| Role | PAC Entries | Centers | Operators | Reports | Settings |
|---|---|---|---|---|---|
| Admin | Full | Full | Full | Full | Full |
| Manager | Full | View+Edit | View Only | Full | No |
| Data Entry | Add Only | View Only | No | Own Only | No |
| View Only | Read Only | Read Only | No | View Only | No |
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.
// 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.
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.
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.
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.
| Format | Available For | Status |
|---|---|---|
CSV | All PAC entries, filtered datasets | Available |
XLSX | All PAC entries, center summaries | Available |
PDF | Monthly reports, operator summaries | Available |
| Scheduled Email | Weekly/monthly auto-reports | Beta |
API Reference
PAC Management reads and writes data directly via the Firestore SDK. The following collections form the core data model.
Collections
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