BGBidGauge Documentation
Updated This pass reflects a security, multi-tenancy, and backup/recovery release: company-scoped Firestore/Storage rules, admin actions moved behind Cloud Functions, email MFA with remembered devices, a rotating database backup/restore system, a real multi-tenant company id, and a staging Firebase project. Every page below has been re-checked against the current source; see the "Resolved" and "New findings" callouts throughout, especially in Technical Risk Notes.
React 19 Vite 8 Firebase Auth + MFA Cloud Firestore Firebase Storage Cloud Functions (Node.js 22) Cloud Scheduler pdf-lib ZipTax API GSA Per Diem API Gmail API (branded email) Staging + Production projects

What BidGauge does

BidGauge runs the full lifecycle of a project for an electrical/low-voltage contracting business: an opportunity is estimated as a proposal, sold, tracked through installation, billed via AIA-style payment applications against a Schedule of Values, and closed out with a post-mortem margin comparison. Alongside project work, a Service Portal handles standalone service tickets, an Item Library holds a reusable pricing catalog, and a per-project Storage area holds contracts, POs, exported PDFs, and BOM exports. The application is now multi-tenant-capable, with company-scoped security rules, optional MFA, and a rotating database backup system.

How to read this package Start with Architecture for the system shape and the new multi-tenancy model, then Data Model for how the data is now structured across dedicated collections. Technical Risk Notes tracks what's been resolved since the first pass and what's newly worth watching.

Document set

01

Architecture

System context and container diagrams, plus the multi-tenancy/company-identity model.

02

Data Model

The current multi-collection Firestore shape, and what's still transitional from the old single-document model.

03

Sequence Flows

Seven flows: sign-in, proposal export, tax lookup, pay app billing, BOM export, email MFA, and backup/restore.

04

Auth & Permissions

Roles, capability flags, the current company-scoped security rules, and both MFA mechanisms.

05

Cloud Functions Reference

All 17 callables/scheduled functions: user management, MFA, backup & recovery, and external data.

06

Project Lifecycle

The stage state machine a project moves through, and what gates automatically sync or unlock.

07

Feature Inventory

A page-by-page walkthrough, including deep links, login/MFA, and the new Backup & Recovery tab.

08

Deployment & Infrastructure

Production and staging Firebase projects, env vars, secrets, ops scripts, and deploy commands.

09

Technical Risk Notes

What's resolved, what's newly worth watching, and what's still true from the first pass.

10

Glossary

Domain terms plus the new infrastructure/security vocabulary — company claims, edit presence, deep links, and more.

Scope & method

This documentation was produced by reading the live source (src/App.jsx, src/lib/paymentApplications.js, functions/index.js, Firestore/Storage rules, Firebase project configuration, and the ops scripts under scripts/ and functions/scripts/) rather than from a spec, and describes the system as implemented — rough edges included.