NoteFlow Admin

Sign in with your admin account to continue.

NoteFlow Admin Dashboard

Users
Analytics
Health
Error Logs
System Docs
Total Users
-
Active Subscribers
-
Trial Users
-
Firm Plans
-

All Users

Email Name Status Plan Signed Up Actions
Today's Logins
-
Statements Generated (Today)
-
Exports Today (PDF + Excel)
-

Last 14 Days — Usage Trends

Date Logins Statements PDF Exports Excel Exports Projects Created

Daily Subscriber Snapshots

Date Total Users Active Trial Firms Past Due Cancelled
System Status
Checking...
Firestore
-
Stripe API
-

Health Check History (Last 24h)

Timestamp Status Firestore Stripe Latency

Automated Monitoring Schedule

CheckFrequencyWhat It Does
🏥 Health CheckEvery 6 hoursTests Firestore + Stripe connectivity, logs latency, flags degraded status
🚨 Error Spike DetectionEvery 6 hoursCounts errors in last 24h — alerts if > 20 errors detected
📈 Daily Metrics SnapshotDaily (midnight ET)Captures subscriber counts, plan breakdown, churn numbers
🧹 Error Log CleanupWeekly (Monday 3am ET)Purges error logs older than 7 days to keep database clean

Infrastructure Summary

Hosting Firebase Hosting — CDN-backed, auto-SSL Region us-central1 (Cloud Functions) Database Cloud Firestore — auto-scaling, 99.999% SLA Functions Runtime Node.js 22 Health Endpoint Loading...
Errors (Last 24h)
-
Errors (Last 7 Days)
-
Most Common
-

Recent Errors

Timestamp Type Message User Source

When enabled, destructive operations are blocked across the platform. Toggle ON before major deployments or maintenance.

🛑
Data Deletion Blocked Users cannot delete projects, clear trial balances, or purge data while Safe Mode is active.
🔒
Account Changes Frozen Subscription status changes, plan upgrades, and team member modifications are paused.
📧
Email Queue Paused Workflow email notifications are queued but not dispatched until Safe Mode is turned off.
🚀
Deploy Guard Reminder: verify all changes in preview before deploying. Safe Mode does not auto-block deploys but serves as a team signal.

⚙️ Tech Stack

Architecture Single-page application (SPA) — all logic in one HTML file, zero build step Hosting Firebase Hosting (CDN-backed, SSL) Authentication Firebase Auth — Email/Password + Google Sign-In Database Cloud Firestore (NoSQL, real-time sync) Server Functions Firebase Cloud Functions (Node.js 22 runtime) Payments Stripe Checkout + Webhooks (server-verified) Email Resend API (Firestore-triggered Cloud Function) Encryption AES-GCM via Web Crypto API, PBKDF2 key derivation (600K iterations) Spreadsheet Engine SheetJS (XLSX) — client-side import/export PDF Generation jsPDF + jsPDF-AutoTable — client-side PDF export Domain getnoteflowapp.com (Firebase Hosting custom domain)

📦 Dependencies & Frozen Versions 🔒 PINNED

All dependency versions are pinned to prevent breaking changes. Do NOT run npm update without testing in staging first.

Client-Side Libraries (CDN)

PackageVersionPurposeLoad
Firebase JS SDK10.12.0Auth, Firestore, App initBlocking
Stripe.jsv3 (latest)Checkout redirectDeferred
SheetJS (xlsx)0.18.5Excel import/exportDeferred
jsPDF2.5.1PDF generationDeferred
jsPDF-AutoTable3.8.2PDF table formattingDeferred

Cloud Functions (Node.js 22)

PackagePinnedInstalledPurpose
firebase-admin^11.11.011.11.1Server-side Firebase SDK
firebase-functions^4.5.04.9.0Cloud Functions framework
stripe^14.0.014.25.0Stripe API (webhooks)
resend^3.0.03.5.0Transactional email API

🔄 Data Flow

Trial Balance → Financial Statements

Excel/CSV Upload
SheetJS Parse
Account Mapping (13 sections)
In-Memory Data Object
Statements / PDF / Excel

Cloud Sync & Persistence

User Input
Debounced Save (600ms)
AES-GCM Encrypt
Firestore (encrypted blob)
Decrypt on Load

Payment Flow

Stripe Checkout
Stripe Webhook
Cloud Function
Firestore (user.subscriptionStatus)

Workflow & Email Notifications

Workflow Action
Firestore (emailQueue)
onCreate Trigger
Resend API
Email Delivered

Section Sign Convention (SECTION_SIGN)

// Determines how amounts are stored internally. // Debit-normal sections = +1 (assets, expenses) // Credit-normal sections = -1 (liabilities, equity, revenue) SECTION_SIGN = { 'revenue': -1, // credit-normal 'cogs': 1, // debit-normal 'opex': 1, // debit-normal 'other': -1, // credit-normal (net) 'current-assets': 1, 'noncurrent-assets': 1, 'current-liab': -1, 'noncurrent-liab': -1, 'equity': -1, 'cf-operating': 1, 'cf-investing': 1, 'cf-financing': 1, };

When adjusting entries are posted, the raw net amount is multiplied by the section's sign so debits increase debit-normal accounts and credits increase credit-normal accounts. This prevents the sign-flip bug fixed in commit bead8a0.

📝 Note Generation Logic

The Notes to the Financial Statements are auto-generated by generateNotes() based on user inputs in the Notes Questionnaire tab. The system uses conditional logic to include only relevant disclosures.

1
User Inputs (Notes Questionnaire)

~40+ form fields covering entity type, basis of accounting, revenue recognition, inventory methods, debt terms, leases, related parties, subsequent events, and more. Radio buttons toggle sub-sections; text areas capture custom language.

2
Conditional Assembly

generateNotes() reads each input via nqVal() and nqRadio(). If a section has data, it's included; empty sections are skipped. Note numbers auto-increment (noteNum++) so there are never gaps.

3
GAAP Template Language

Each note type has pre-written GAAP-compliant boilerplate (e.g., "Use of Estimates" is always included). User text is merged with templates — custom language overrides defaults where provided.

4
Computed Data Integration

Notes pull live data from the trial balance: e.g., debt schedules show actual balances, depreciation notes reference fixed asset totals, and going concern analysis uses computed ratios.

5
Output

HTML rendered into the Notes tab, included in PDF export (full package), and mirrored to Excel as a buildNotesData() sheet.

Supported Note Types

Nature of Operations Accounting Policies Cash & Equivalents Revenue Recognition Accounts Receivable Inventory Property & Equipment Intangible Assets Debt & Borrowings Leases Related Party Transactions Income Taxes Commitments & Contingencies Subsequent Events Going Concern Concentrations Fair Value Measurements Advertising Costs

🌐 API Endpoints & Cloud Functions

All server-side logic lives in functions/index.js. Region: us-central1 (default).

POST /stripeWebhook Stripe payment event handler (checkout, invoice, subscription)
TRIGGER emailQueue/{id} onCreate Auto-sends workflow notification emails via Resend

Stripe Webhook Events Handled

EventAction
checkout.session.completedActivate subscription, store Stripe customer ID, set plan type
invoice.paidRenew subscription, update lastPaymentAt
invoice.payment_failedSet status to past_due
customer.subscription.deletedSet status to cancelled

Firestore Collections

CollectionPurposeKey Fields
usersUser profiles & subscription dataemail, plan, subscriptionStatus, stripeCustomerId, firm{}
users/{uid}/projectsEncrypted project dataname, data (encrypted blob), updatedAt
emailQueuePending workflow emailsto, subject, eventType, projectName, sent, sentAt

📋 Workflow State Machine

Draft
In Review
Manager Approved
Partner Approved
↩ Returned
Draft (re-enter cycle)

Roles: Staff prepares → Manager reviews & approves → Partner gives final sign-off.

At each transition: Status updates in Firestore, timeline entry logged, email queued for assignees.

Comments: Threaded per-project, visible to all assignees, trigger email notifications.

🔀 Version Control & Commit History

Repository Local Git — financial-statements Branch main Deploy Command cp "Financial Statement Prep index.html" public/index.html && npx firebase-tools deploy --only hosting Functions Deploy npx firebase-tools deploy --only functions Total Commits 18

Commit History

d782171Add Stripe webhook Cloud Function for server-side payment verificationApr 9, 2026
bead8a0Fix critical security vulnerabilities for production readinessApr 9, 2026
055ef74Add enterprise contact line to subscription gateApr 9, 2026
b200ca2Add Firm payment link for team subscription tierApr 9, 2026
fe1c696Add Firm/Team subscription tier with team member managementApr 9, 2026
3d70b21Add Stripe payment link and Firebase hosting configurationApr 9, 2026
0d17e29Connect Firebase project credentials for live authentication and cloud storageApr 9, 2026
3e278a7Add Firestore cloud data layer for cross-device syncApr 9, 2026
efac673Add Tier 1/2 features, revert unwanted features, and add commercializationApr 9, 2026
891732fAdd company research engine to auto-populate notes from web dataApr 8, 2026
2f31faaAdd GAAP codification references to disclosure checklist itemsApr 8, 2026
6a721faReorganize tabs and implement 15 UI/UX improvementsApr 8, 2026
463768cAdd auto-fix missing disclosures feature with default GAAP languageApr 8, 2026
22dac39Add comparative trial balance import (both periods in one file)Apr 8, 2026
af38d41Add Equity statement tab and redesign Cash Flow with indirect methodApr 8, 2026
9a7fa82Add statement templates, firm profiles, learning intelligence, and comparative note tablesApr 8, 2026
55fc919Add expanded GAAP notes, disclosure checklist, PDF export, dashboard, rename to NoteFlowApr 8, 2026
d38f79cInitial commit: NoteFlow Financial Statement SuiteApr 8, 2026

🔐 Security & Configuration

FeatureImplementationStatus
Data EncryptionAES-256-GCM, PBKDF2 key (600K rounds, cached per session)Active
HTTP Security HeadersX-Content-Type-Options, X-Frame-Options (DENY), X-XSS-Protection, HSTS, Referrer-Policy, Permissions-PolicyActive
Rate LimitingIn-memory limiter on webhook endpoint (30 req/min per IP)Active
Error MonitoringGlobal window.onerror + unhandled promise rejection → Firestore errorLogsActive
Usage AnalyticsDaily counters in Firestore analytics collection (logins, exports, statements)Active
Health MonitoringCloud Function endpoint testing Firestore + Stripe connectivityActive
Daily Metrics BackupScheduled function captures subscriber counts nightly at midnight ETActive
Error Log CleanupAutomated weekly purge of error logs older than 7 daysActive
Session Expiry8-hour timeout, auto sign-out on checkActive
Sign-Up BlockingSIGNUPS_DISABLED = true — blocks public registrationTesting
Stripe Webhook VerificationSignature verification via constructEvent()Active
Admin Bypassgetnoteflowapp@gmail.com skips subscription gateActive
2FA / Phone AuthCode present but commented out — enable when readyStandby
Firestore RulesUsers can only read/write their own documentsActive

Environment Variables (functions/.env)

VariablePurpose
STRIPE_SECRET_KEYStripe API secret (currently test mode: sk_test_...)
STRIPE_WEBHOOK_SECRETWebhook signature verification key
RESEND_API_KEYResend email API key (pending setup)

🚀 Deployment Guide

1
Copy source to public/

cp "Financial Statement Prep index.html" public/index.html

2
Deploy Hosting

npx firebase-tools deploy --only hosting

3
Deploy Cloud Functions (if changed)

npx firebase-tools deploy --only functions

4
Verify

Check https://getnoteflowapp.com — confirm login, statement generation, and exports work. Check Firebase Console → Functions for deployment status.

Pre-Launch Checklist