Delivered remotely for a business based in Bristol, United Kingdom. Names withheld by agreement.
Project Overview
Cold outreach suffers from diminishing returns: voters and community members routinely ignore unfamiliar numbers and automated texts. Grassroots campaigns turn that dynamic around through relational organising, equipping supporters to contact people already in their own phonebooks. Yet asking volunteers to cross-reference spreadsheets or expose personal address books to external databases creates immediate friction and understandable privacy resistance.
We engineered a cross-platform mobile platform in Flutter alongside an OAuth-protected API and web management console to make relational outreach structured, private, and reliable. Supporters sign in once, browse campaign-approved talking points, selectively identify acquaintances who may need registration reminders or event details, initiate conversations from their own messaging apps, and record follow-up outcomes in seconds.
Business Bottleneck
Previous campaign tooling broke down across three operational seams:
- Address-book trust barrier: Legacy relational tools uploaded a volunteer's entire device contact list to remote servers on first launch, triggering drop-offs from privacy-conscious supporters and creating heavy GDPR compliance exposure.
- Multi-campaign identity fragmentation: Activists volunteering for both a local council drive and a regional issue coalition had to juggle separate logins, leading to abandoned sessions and fragmented coordination.
- Offline canvassing blind spots: Supporters logging outcomes after community meetings or inside transit corridors frequently lost unsaved notes when mobile data dropped mid-request.
Architectural Strategy
Our architecture prioritized local-first privacy and standard delegated identity. Rather than treating the phonebook as raw server input, the Flutter client keeps address-book inspection entirely on-device inside an isolated matching module. Only normalized, cryptographic contact digests leave the handset during opt-in lookup, and only individuals a volunteer explicitly adds to their personal action list are synced to their workspace.
For authentication and multi-organisation access, we implemented OAuth 2.0 with PKCE backed by short-lived JWT access tokens and refresh token rotation. A single Flutter binary connects seamlessly to distinct campaign tenants without shipping static API secrets inside mobile packages, while PostgreSQL row-level security isolates every organisation's supporter records and script trees.
Core Capabilities
- Selective Contact Matching: Volunteers filter or search their local address book on-device, see which acquaintances match public civic priority criteria, and curate a private personal outreach list.
- Dynamic Script & Rebuttal Cards: Campaign coordinators publish branched conversation prompts from the web console, adapting automatically as election deadlines or policy milestones shift.
- One-Tap Native Messaging Handoff: Personalized draft messages pre-populate native SMS, WhatsApp, or OS share sheets so conversations stay inside trusted personal threads.
- Structured Outcome Capture: After chatting, volunteers log contact status, supporter sentiment, and follow-up reminders with two-tap forms designed for one-handed use.
- Team Coaching & Aggregate Dashboards: Field organisers track team completion trends and script effectiveness on the web without inspecting private personal contacts volunteers chose not to share.
Technical Architecture
The Flutter application uses a repository pattern backed by Drift (SQLite) as the single source of truth for UI rendering. Network responses from the Python FastAPI backend hydrate local tables, while outgoing outreach logs enter an ordered outbox queue that survives app restarts and OS background suspension.
Flow: OAuth 2.0 PKCE login -> Scoped tenant token issued -> FastAPI serves scripts & matching index -> On-device Flutter contact normalization & digest match -> Volunteer sends via native share sheet -> Offline Drift outbox queues outcome -> Idempotent sync updates PostgreSQL & Redis team tallies.
On the backend, Redis caches immutable script revisions and aggregates high-frequency leaderboard counters asynchronously, preventing concurrent volunteer check-ins during weekend "day of action" drives from saturating PostgreSQL write locks.
Technology Stack
| Category | Technology detail |
|---|---|
| Mobile client | Flutter and Dart targeting Android and iOS from a single codebase |
| Authentication | OAuth 2.0 with PKCE flow, scoped tenant claims, and rotating refresh tokens |
| Local database | Drift (SQLite) for offline contact selections, scripts, and queued survey logs |
| Contact privacy layer | On-device phone/name normalization and salted hash matching before server lookup |
| Backend API | Python FastAPI with asynchronous request handlers and OpenAPI schemas |
| Primary database | PostgreSQL with row-level security separating campaign organisations |
| Caching & task queue | Redis for script distribution caching and asynchronous tally aggregation |
| Coordinator web panel | Server-backed web console for script authoring, audience segmentation, and team metrics |
| Outreach handoff | Native OS share sheets, SMS intents, and messaging deep links |
| Observability | Structured audit logging and Sentry crash diagnostics across mobile and API |
Engineering Trade-offs & Solutions
| Architectural Dilemma | Chosen Solution & Rationale |
|---|---|
| Full server contact ingestion vs. on-device digest matching | Performed E.164 phone normalization and salted hashing locally before querying the API, avoiding unnecessary storage of uninvolved third-party phone numbers while keeping lookup latency low. |
| In-app proprietary chat vs. native OS share handoff | Routed outreach through native SMS and messaging intents so recipients recognize the volunteer's real identity, sacrificing automatic read-receipt tracking for vastly higher trust and reply rates. |
| Embedded mobile credentials vs. OAuth 2.0 PKCE | Adopted browser-mediated OAuth 2.0 PKCE flows with refresh token rotation, enabling multi-organisation SSO and immediate token revocation if a volunteer leaves a campaign. |
| Real-time relational count queries vs. Redis-backed tallies | Offloaded team progress counters to Redis workers refreshed incrementally on sync, keeping coordinator dashboards snappy during coordinated volunteer surges. |
Security & Reliability
Authentication tokens never sit in plain shared preferences; the Flutter client persists OAuth refresh tokens inside iOS Keychain and Android Keystore-backed encrypted storage. Every API endpoint enforces campaign-tenant claims extracted from verified tokens, backed by PostgreSQL row-level policies so a misconfigured query cannot leak data across civic organisations.
Because outreach logs can be recorded offline and replayed hours later, every outcome payload carries a deterministic client-generated event ID and timestamp. Server handlers apply last-write-wins conflict resolution per volunteer-contact pair while preserving an append-only audit history for compliance reviews. Consent withdrawal or account deletion triggers cascading purges across active tables and scheduled cache invalidations.
Performance & Scale
Supporters with thousands of entries in their phonebooks cannot wait for main-thread parsing to freeze the UI. Address-book normalization and digest computation run inside dedicated Dart isolates, streaming progress incrementally while keeping scrolling responsive at native frame rates.
During peak campaign weekends, thousands of volunteers may download updated script packs and upload check-ins simultaneously. FastAPI's async I/O workers pair with ETag-validated script endpoints and Redis response caching so unchanged campaign scripts return compact 304 Not Modified responses, preserving mobile data plans and server headroom.
Operational Outcomes
Moving relational outreach into a privacy-respecting Flutter application removed the onboarding hesitation that previously stalled volunteer sign-ups. Coordinators gained timely visibility into which talking points resonated across neighbourhoods while remaining insulated from raw personal address-book data, and field volunteers gained a dependable offline-ready companion that worked consistently across older Android devices and modern iOS handsets alike.