Admin Tools Guide
The Foundation platform includes a comprehensive suite of admin tools for managing the devnet environment. All tools are accessible from the Admin Panel > Testing tab.
Access
Admin access is granted when any of these conditions are met:
- Your wallet address is in the
VITE_ADMIN_WALLETSenvironment variable - Your email is in the admin email list
- Your WebAuthn credential ID is in
VITE_ADMIN_CREDENTIAL_IDS - On devnet: the first registered user is auto-admin
Navigate to the Admin panel via the Admin button in the navbar.
Diagnostic Tools
Health Check
Tests connectivity to all platform services:
| Check | What it tests |
|---|---|
| Firestore | Database connectivity (samples 1 doc) |
| Cloud Functions | Callable reachability via a smoke-test function |
| Solana RPC | Devnet RPC getHealth method |
| Pillar 2 Data | Funds collection has seeded data |
| Pillar 3 Data | Products collection has seeded data |
| Proposals | Governance proposals exist |
Reports latency per check and overall pass/warn/fail status.
Data Stats
Fetches document counts across all collections:
- Proposals (total + active)
- Voters (registered)
- Total votes cast
- Funds (Pillar 2 initiatives)
- Products (Pillar 3 marketplace items)
- Savings summary presence
- Mail queue size
- Access codes count
Database Validator
Full schema + referential integrity + aggregate consistency validator.
Runs three validation phases:
Phase 1 — Schema Validation
Validates every document in 10 collections against expected field types, required fields, enum values, and structural constraints:
| Collection | Key checks |
|---|---|
proposals |
Required fields, status/scope enums, options map structure, numeric non-negative, ISO dates |
voters |
Wallet address, status enum, boolean verification flags, age >= 0 |
votes |
proposal_id, option_id, anonymous_hash required |
supporter_signatures |
proposal_id, anonymous_hash required |
voting_rounds |
round_type and status enums |
funds |
Status enum, categories array structure, numeric balances |
distributions |
fundId reference, status enum |
product_requests |
Status enum, bids array structure |
savings_summary |
Singleton doc ID "current", numeric fields |
identity_proofs |
proofType/trustTier enums, trustTier matches proofType |
Phase 2 — Referential Integrity
Checks that all foreign-key references point to existing documents:
- Votes reference existing proposals and valid option IDs
- Supporter signatures reference existing proposals
- Voting rounds reference existing proposals
- Distributions reference existing funds
- Identity proofs reference existing voters
- Product request proposalIds (if set) reference existing proposals
Phase 3 — Aggregate Consistency
Cross-validates computed fields against actual document counts:
proposal.total_votesmatches actual vote document countproposal.options[x].votesmatches actual vote documents for that optionproposal.support_countmatches actual supporter signature count- Detects duplicate votes (same anonymous_hash on same proposal)
- Detects duplicate supports (same anonymous_hash on same proposal)
Results are displayed with expandable per-collection sections, color-coded severity (errors in red, warnings in amber, passes in green).
Data Seeding Tools
Seed Demo Data
Populates Firestore with the standard demo dataset:
- 7 community funds (Stockton SEED, Jackson Mothers Trust, Denver, Austin, Chicago, Newark, LA)
- 3 distribution history records
- ~50 marketplace products with supplier bids and price comparisons
- Savings summary singleton
- Demo governance proposals
Idempotent — checks for existing data before seeding. If data exists, reports "already seeded" and skips.
Population Seeder
Creates demo voter records at a specific location:
- Location picker — Google Places Autocomplete for selecting a city, neighborhood, or street
- Voter count — Configurable from 100 to 100,000
- Auto-inferred scope — Determines geographic_scope from address components
- Realistic data — Random wallet addresses, ~85% verification rate, varied ages (18-80), registration dates spanning 6 months
Batch-processes 50 voters at a time with real-time progress bar.
Vote Seeder
Generates votes on a specific active proposal:
- Pillar filter — Filter proposals by YourVoice / YourShare / YourMarket
- Proposal selector — Choose from active proposals
- Vote count — Configurable from 100 to 100,000
- Distribution modes:
- Random — Even spread across all options
- Landslide Approve — ~80% on the first option
- Landslide Reject — ~80% on the last option
- Head to Head — Top 2 options nearly tied (~48% each)
Creates corresponding voter records for each simulated vote (audit trail). Updates vote tallies atomically via Firestore increment().
Voting Simulation
Quick simulation: generates 20 random votes distributed across all active proposals. Simpler than the Vote Seeder — useful for quick testing.
Reset Tools
Danger zone — all reset tools require confirmation before executing.
Reset Vote Counts
Zeros out vote tallies on all proposals while preserving proposal structure (options, thresholds, descriptions). Does not delete vote documents — only resets the counters on proposal records.
Reset Voters
Deletes all voter records from Firestore in batches of 200. Queries raw collection (no ordering) to catch all documents including those missing the registered_at field. Shows running count of deleted documents.
Reset All & Re-seed
Nuclear option: deletes ALL data and re-seeds fresh:
- Deletion phase (0-70%): Clears proposals, voters, votes, funds, distributions, product_requests, savings_summary, supporter_signatures
- Re-seed phase (70-100%): Seeds fresh demo data via the standard seed function
Other Admin Features
Constitution Admin
Route: /admin/constitution
Edit the community governance framework:
- Modify preamble text
- Add/remove/edit governance principles
- Categorize by type (rights, governance, ethics, procedural)
- Set principle weights (core, important, advisory)
- Save versioned constitutions
- Reset to default
Manual Review Admin
Accessible from Admin Panel > ID Reviews tab.
Identity verification queue for manual-review tier proofs:
- Lists pending
manual_review_requestsfrom Firestore - Displays uploaded ID documents (front/back/selfie)
- Approve/reject actions invoke the
approveManualReviewCloud Function - Filter: pending only vs. all statuses
Voters Management
Admin Panel > Voters tab:
- Search/filter all voters
- View verification status (biometric + ID verified)
- Manage voter status (activate/suspend)
Proposals Management
Admin Panel > Proposals tab:
- Search proposals by title
- View support counts and vote tallies
- Manage proposal lifecycle (activate, close, pass, discard)
Reports
Admin Panel > Reports tab:
- Date-range filterable voting results
- Winner analysis per completed proposal
- Participation metrics
- Geographic distribution breakdown