HomeCase studiesA Cross-Platform Relational Civic Outreach Platform Built...

Case study · Bristol, United Kingdom

A Cross-Platform Relational Civic Outreach Platform Built with Flutter and OAuth

Civic engagement and grassroots campaign organising — relational voter and supporter outreach

Grassroots civic campaigns generate far stronger responses when volunteers reach out to friends, neighbours, and colleagues rather than cold-calling strangers, yet spreadsheets and generic CRM tools fail at relational organizing. We built a cross-platform Flutter mobile application integrated with an OAuth-secured FastAPI backend and coordinator web workspace. Supporters authenticate across campaign organisations, match local phonebook entries without surrendering raw contact lists to central servers, send tailored messages through native share sheets, and log outcomes reliably even in low-connectivity neighbourhoods.

Industry
Civic engagement and grassroots campaign organising — relational voter and supporter outreach
Solution
A cross-platform Flutter mobile application for iOS and Android paired with an OAuth 2.0 identity layer, FastAPI backend, and web administration console for campaign coordinators.
Platforms
Android · iOS · Cross-platform · Web & API
Stack
Flutter · Dart · OAuth · FastAPI · PostgreSQL · Redis
Location
Bristol, United Kingdom · delivered remotely
Role
Engineering, with the team behind for mobile and QA

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.

01 — Questions

asked about this kind of project

How does the app match a volunteer's personal contacts without exposing their entire address book to the campaign?

Contact parsing and normalization happen strictly on the handset. When a volunteer explicitly opts into matching, the app transforms phone numbers into keyed cryptographic digests locally and queries only those digests against the campaign index; unchosen contacts are never persisted on campaign servers, and volunteers choose individually whom to track.

Why use OAuth 2.0 with PKCE for a civic volunteer mobile app?

Volunteers frequently participate across multiple local or national campaigns operated by partner organisations. OAuth 2.0 with Proof Key for Code Exchange lets the Flutter app authenticate securely through a standard authorization server without embedding client secrets in the binary, while issuing tenant-scoped tokens that isolate each campaign's data.

Why hand off outreach through native share sheets rather than sending bulk SMS from the backend?

Relational organizing depends on messages arriving from a person's actual mobile number inside an existing chat thread with their friend. Using native SMS intents and OS share sheets keeps the communication personal, avoids carrier spam filtering, and removes the compliance risk of automated A2P messaging.

How does the app stay usable when volunteers log conversations inside apartment blocks or rural areas?

Assigned outreach lists, talking points, and survey trees are cached inside a local Drift SQLite database on the device. Volunteers record responses offline; each survey submission receives a deterministic client ID and replays automatically in order once connectivity returns.

What information can campaign coordinators see about a volunteer's private contacts?

Coordinators see aggregate progress—such as tasks completed, pledge counts, and matched public-roll records—alongside notes explicitly shared by the volunteer for follow-up. Raw phone numbers and private relationship labels remain restricted according to campaign consent rules.

03 — Similar project?

describe what is different about yours

Build yours.

Tell me what exists, what you need and the deadline. Fixed price for a defined scope, or $55/day (8–9 hours work) with a written plan first.

Solitaire Corporate Park, Makarba, Ahmedabad, Gujarat 380015, India · IST (UTC+5:30) · --:-- IST · Mon–Fri 09:00–18:00 IST · US & EU overlap daily

No newsletter, no CRM. Just a reply.