⚡ Live Dual-Database Sync Pipeline
Eventarc v2 Reactive PipelineReal-Time Dual-Database Sync Pipeline: Firestore to MongoDB Atlas
Engineered and deployed an asynchronous, Eventarc-driven 2nd Gen Firebase Cloud Functions pipeline that mirrors every document write in Firestore directly to MongoDB Atlas ('test' database) with sub-second replication latency.
- Serverless Eventarc Triggers: Configured
onDocumentWrittenlisteners across 7 core collections:posts,blocks,divisions,subdivisions,districts,places(mapped tofamousplaces), andpersons(mapped topeople). - GCP Secret Manager Runtime Injection: Utilized
defineSecret('MONGODB_URI')to inject database credentials securely into worker instances at runtime with zero source code exposure. - Resilient Connection Pool: Built a singleton
getMongoClientwith defensive URI sanitization, persistent socket reuse across warm invocations, and automatic FirestoreTimestampto BSONDatetransformation. - Geo-Colocated Execution: Functions are pinned to Google Cloud region
asia-south2(Delhi) to minimize round-trip latency with the Firestore cluster.
// Eventarc v2 Firestore -> MongoDB Atlas Sync Trigger
exports.syncPosts = onDocumentWritten(
{
document: "posts/{docId}",
secrets: [MONGODB_URI_SECRET],
region: "asia-south2"
},
async (event) => {
const { before, after } = event.data;
const db = await getDb("test");
if (!after.exists) {
await db.collection("posts").deleteOne({ firestoreId: event.params.docId });
return;
}
await db.collection("posts").updateOne(
{ firestoreId: event.params.docId },
{ $set: { ...after.data(), firestoreId: event.params.docId, _syncedAt: new Date() } },
{ upsert: true }
);
}
);Core Web Vitals Optimization & Render Performance Boost
Comprehensive performance audit targeting Largest Contentful Paint (LCP) and Cumulative Layout Shift (CLS), optimizing the critical rendering path across all high-traffic landing pages.
- Zero Layout Shift (CLS < 0.01): Enforced explicit width/height ratios on all dynamic media containers, preventing visual layout jumping during hydration.
- Sub-Second LCP: Streamlined above-the-fold component trees and enabled preloading for critical SVG administrative maps.
- Optimized Static Asset Delivery: Configured high-cache HTTP headers on static chunks served via Firebase CDN.
Enterprise Dynamic XML Sitemap Engine with Parallel Data Fetching
Re-engineered app/sitemap.js to dynamically discover thousands of administrative routes, places, personalities, and posts with strict XML entity sanitization and caching headers.
- Parallel Firestore Ingestion: Fetches 8 collections concurrently via
Promise.allduring static build generation. - XML Entity Sanitization: Built defensive
formatSafeUrlescaping unescaped ampersands (&) and illegal XML characters. - Multilingual Alternate hreflang: Automatically emits dual language routes (
/en/and/hi/) for every content entity. - Google Image Sitemap Integration: Extracts validated image URLs and alt captions to maximize visual search indexing.
Full-Featured Admin CMS Studio: Place & Personality Management
Rolled out full administrative editing suites (PlaceEditor and PersonEditor) featuring multi-image galleries, visitor logistics metadata, and secure deletion workflows.
Unified SEO Architecture with Automated OpenGraph & JSON-LD
Architected app/lib/seo.js into a centralized SEO utility, eliminating duplicate metadata boilerplate across all 22+ app directories.
100% Static Site Generation (SSG) & Firebase Hosting Migration
Re-engineered the entire application to achieve 100% Static Site Generation (SSG) with generateStaticParams, paired with a custom tag-based caching layer for Firestore.
Migration to Firebase Native SDK: Firestore, Auth & Secure Post Studio
Migrated data access completely away from external legacy APIs into Google Cloud Firestore Native, introducing Firebase Authentication with Google OAuth and a secure post authoring dashboard.
DigiPin Digital Addressing & Pan-India Postal Directory
Integrated India Post's next-generation DigiPin digital addressing standard alongside a lightning-fast postal directory covering all districts of Bihar and Pan-India.
Bihar Governance Analytics & Legislative Assembly Visualizations
Introduced rich civic data dashboards for Members of Legislative Assembly (MLA) and Members of Parliament (MP) of Bihar with Chart.js analytics.
KnowBihar Next.js Architecture & Complete Administrative Tree
Architected KnowBihar on Next.js App Router with deep bilingual localization (en/hi), interactive vector SVG cartography, and relational modeling of all Bihar administrative tiers.
Monorepo Architecture Restructure & AdSense Integration
Evolved the repository structure into a monorepo setup, implemented Google AdSense verification, and performed major SEO enhancements across the Single Page Application.
Rich Content Formatting & Article Tagging Subsystem
Built a rich text content authoring experience with formatting controls, post tagging, article deletion workflows, and an upgraded admin dashboard.
URL-Based Language Routing & Interactive Map Zoom Engine
Introduced language parameters directly in URLs for bilingual routing, added XML sitemaps, and developed interactive zoom capabilities for administrative district and block maps.
MongoDB Database Integration & Full-Text Search Inception
Integrated MongoDB as the primary backend database alongside dedicated REST APIs for administrative divisions, famous tourist places, prominent personalities, and dynamic search.
Birth of KnowBihar: Project Inception with Create React App
The historic first commit of the KnowBihar project. Initialized as a Create React App (CRA) Single Page Application dedicated to celebrating Bihar's heritage and geography.
KnowBihar Continuous Engineering
From our roots in September 2025 as a Create React App (CRA) to a 100% Next.js SSG platform and dual-sync Cloud Functions — KnowBihar is engineered for speed, durability, and open knowledge.
← Explore KnowBihar