Infrastructure
132 components in the infrastructure layer
Infrastructure components provide foundational utilities, system integrations, and supporting functionality for the application.
Thin wrapper around the SharedPreferences plugin providing typed read/write helpers. Isolates the rest of the codebase from the concrete per...
Infrastructure component that loads and exposes the terminology and label mappings for the selected organization. Drives the OrganizationLab...
Utility widget or mixin providing keyboard-aware scrolling behavior for form screens. Automatically adjusts scroll offset when the software ...
Infrastructure wrapper around the Supabase Flutter SDK's auth module. Provides an injectable singleton client used across all authentication...
Integration client for the third-party BankID broker service. Manages session initiation requests, WebView URL generation, and assertion tok...
Intercepts incoming deep links during OAuth flows for both Vipps and BankID. Registers the app's custom URI scheme, parses authorization cod...
Thin wrapper around Flutter Secure Storage providing a consistent interface for encrypted local persistence. Used by multiple authentication...
Low-level HTTP client for the Vipps Login API. Handles endpoint configuration for test and production environments, request signing, and err...
Configuration component that manages per-organization Vipps client credentials and tracks the cost-sharing agreement across participating or...
Thin adapter around the Flutter local_auth package that abstracts platform-specific configuration for iOS (Face ID / Touch ID) and Android (...
Centralized service responsible for Supabase session lifecycle operations including token refresh, session validation, and sign-out. Shared ...
Integrates with Flutter's StatefulShellRoute and GoRouter to enforce role-based navigation at the routing level. Redirects unauthorized role...
Low-level infrastructure component that queries Supabase for role assignment records. Reads from user JWT claims, user metadata, or a dedica...
Thin wrapper around the Flutter url_launcher package used by the admin portal link widget to open external URLs in the device browser. Provi...
Thin wrapper around the device key-value store (SharedPreferences on Flutter) providing a typed, async interface for persisting small prefer...
Low-level Supabase client wrapper scoped to the activities table. Abstracts PostgREST query construction and error mapping, providing a type...
Riverpod provider that loads and exposes the per-organisation terminology overrides used throughout the app. Extended for activity types so ...
Shared singleton that initialises and exposes the Supabase client instance used by all repository layers throughout the app. Configured with...
Fetches and parses the JSON field configuration stored in Supabase that defines org-specific form fields. Supports adding custom fields per ...
Wraps Flutter's speech_to_text package and exposes a simplified interface for per-field transcription. Handles microphone permission request...
Phase 3 integration client providing a unified interface for exporting approved expense records to external accounting systems. Supports bot...
Client-side interface for the Supabase Edge Function that runs server-side auto-approval logic on expense insert. The Edge Function evaluate...
Configuration provider for organisation-specific expense thresholds including receipt requirement amount (default 100 kr for HLF) and auto-a...
Thin adapter wrapping the Supabase RPC function responsible for atomically inserting multiple activity rows in a single database call. Handl...
Listens for Supabase realtime events on the activities table and triggers invalidation of the stats Riverpod provider. Ensures the dashboard...
Backend Supabase SQL views or materialized views that pre-aggregate activity counts, hour totals, and reimbursement amounts grouped by peer ...
Supabase Edge Function that accepts org_id, scope_id, scope_level, and date range parameters and returns either a preview payload or a final...
Supabase Storage bucket configuration for persisting generated export files (PDF, CSV). Files are stored with org-scoped paths and access-co...
Flutter utility that receives a file URL or byte payload from the edge function and triggers the native device download or share sheet. Hand...
Flutter BLoC state management unit for the duplicate detection flow. Manages the state transitions between idle, checking, duplicate-found (...
Lightweight interceptor layer that injects the duplicate_reviewed field into the activity insert payload based on user resolution decisions....
Utility that constructs Supabase query filters aligned with the Row Level Security policies for the contacts and peer_mentors tables. Transl...
Client-side validation utilities for the edit contact form, enforcing required field rules, format constraints (e.g., phone number, email), ...
Utility layer providing decryption of sensitive contact fields stored encrypted in Supabase. Handles key retrieval, decryption logic, and er...
Flutter ThemeData extension exposing the project's design token system (colors, typography, spacing, radii) as typed Dart constants. Used by...
Riverpod provider supplying organization-specific terminology strings (e.g., 'peer mentor' vs 'likeperson' vs 'kontaktperson') used in UI la...
Riverpod provider exposing the initialized Supabase client instance to all repository layers. Centralizes client configuration and session m...
Supabase Edge Function or scheduled PostgreSQL job that runs periodically to detect peer mentors whose certifications have expired and autom...
BLoC state management layer for the pause and reactivation UI flows. Manages async status transitions, loading states, and error handling, e...
Infrastructure utility that logs duplicate activity warning events including whether the user dismissed or cancelled the submission. Support...
Low-level Supabase client adapter that maps ContactChapter domain objects to and from Supabase database rows. Handles RLS policy compliance ...
Wraps a RxDart or Timer-based debounce around the search input stream to prevent excessive Supabase queries on every keystroke. Configurable...
Records an immutable audit log entry for every proxy registration action. Captures who acted (coordinator), on whose behalf (mentor), what w...
Configuration module that centralizes all privacy-related settings for location data, including data retention policies, consent expiry peri...
Abstracts the underlying map SDK (flutter_map with OpenStreetMap tiles or Google Maps Flutter plugin) behind a unified interface consumed by...
Utility layer that converts Flutter LatLngBounds and coordinate objects into PostGIS-compatible SQL spatial queries executed via Supabase RP...
Lightweight event tracker that records which expense types are selected and how often mutual exclusion is triggered, providing anonymised us...
Thin wrapper around Flutter's local storage (SharedPreferences) for persisting the last-used distance per user. Keeps the prefill mechanism ...
Low-level Supabase client wrapper scoped to the mileage claims and org configuration tables. Translates domain model objects to/from Supabas...
Wraps the Flutter image_picker package to provide a unified interface for both camera capture and gallery/file-picker selection. Abstracts p...
Infrastructure wrapper that manages Supabase Realtime channel subscriptions for the coordinator review queue and for the peer mentor's own c...
Server-authoritative Supabase Edge Function that re-executes the same threshold evaluation logic as the client-side ThresholdEvaluationServi...
Records a tamper-evident audit trail for all declaration lifecycle events including creation, delivery, reading, acknowledgement, and revoca...
Database-backed configuration record controlling the availability of the driver administration and confidentiality declaration feature per o...
Secure server-side store for per-organization accounting API credentials (Xledger API keys, Dynamics OAuth tokens). Credentials are stored i...
Utility that converts structured export records into a downloadable CSV or JSON file. Handles encoding, column ordering, header row generati...
Server-side Supabase Edge Function that handles the full export generation pipeline away from the mobile client, preventing accounting crede...
Static configuration that maps the application's internal activity types to Bufdir's official reporting category identifiers. Acts as the au...
PostgreSQL functions deployed to Supabase that execute server-side aggregation logic, performing COUNT DISTINCT, SUM, and GROUP BY operation...
BLoC state management unit for the period selection screen. Coordinates preset loading, custom range changes, record count fetching, and val...
Utility functions and constants supporting WCAG 2.2 AA compliance specifically within the Bufdir preview feature. Provides contrast-checked ...
Supabase Row Level Security policy definitions for the bufdir_report_history table. Ensures all queries are automatically scoped to the user...
Riverpod provider that computes and caches default values for bulk registration (current date, most recently used activity type) and persist...
Utility that enforces coordinator or higher role authorization before granting access to proxy registration UI and service endpoints. Redire...
HTTP client wrapper for the HLF Dynamics portal API, handling authentication, request formation, retry logic, and error mapping. Abstracts t...
Infrastructure component that schedules and triggers backend cron jobs, specifically the nightly certification expiry check. Built on Supaba...
Dispatches push notifications from admin-triggered actions such as certification reminder sends and bulk reminders to expiring mentors. Wrap...
Database-level row-level security policy definitions for org_admin and super_admin roles in Supabase. Policies are applied to the users, act...
Generates a human-readable PDF version of the Bufdir export, formatted according to Bufdir's report template. The PDF is intended for manual...
Generates Excel (.xlsx) and CSV export files from mapped Bufdir rows. Uses a server-side Dart library to produce formatted spreadsheets with...
Uploads generated export files and attachment ZIPs to Supabase Storage under organisation-scoped paths. Generates time-limited signed URLs f...
Wraps the Supabase Storage SDK to provide a typed interface for file upload, deletion, and signed URL generation. Configures bucket-level RL...
A scheduled backend job that runs nightly to identify certifications approaching expiry and those that have expired on the current day. Invo...
Shared service that handles transitioning a peer mentor into and out of paused status. Used by the certification feature to auto-pause mento...
Shared infrastructure service for dispatching push notifications to mobile devices. Used by certification reminders to alert peer mentors an...
BLoC state management unit for the coordinator statistics dashboard. Handles loading, filtering, refreshing, and error states. Subscribes to...
BLoC state management unit for the personal peer mentor statistics view. Manages loading and display of individual mentor statistics and del...
Thin adapter layer wrapping the fl_chart Flutter library to provide typed, app-specific chart configuration builders. Centralizes chart styl...
Registers and refreshes Firebase Cloud Messaging device tokens in Supabase, associating them with the authenticated user and device. Handles...
Configures flutter_local_notifications channels with accessibility-compliant settings including high-contrast notification channel colors, V...
Supabase pg_cron scheduled job or Edge Function cron trigger that invokes the reminder scheduler service on a daily schedule. Handles execut...
Shared infrastructure service that delivers push notifications to mobile devices. Used by the reminder dispatch service to send reminder and...
Supabase Edge Function that runs on a daily cron schedule to query all peer mentors with upcoming or lapsed certification expiry dates. It i...
Supabase Row Level Security policy configuration that enforces automatic suppression of expired peer mentors from coordinator queries and pu...
Shared infrastructure component responsible for sending push notifications via Firebase Cloud Messaging. Used across certificate expiry noti...
Shared Firebase Cloud Messaging dispatch function that sends push notifications to device tokens and writes in-app notification records to t...
Supabase database webhook that fires on INSERT or UPDATE of the status column in the peer_mentor_profiles table. Validates the payload, dete...
Shared infrastructure component responsible for sending push notifications via the platform push service (FCM/APNs through Supabase). Accept...
Supabase Edge Function executed on a scheduled cron trigger (e.g., every hour) that invokes the Scenario Prompt Scheduler Service. Handles a...
Utility providing screen reader announcements for notification centre state changes. Announces new notification arrivals, unread count updat...
Manages Supabase Realtime channel subscriptions for the notifications table, scoped to the current user's user_id. Emits a stream of notific...
Wraps the flutter_screenshot or RepaintBoundary approach to render any widget to a PNG byte array without displaying a native screenshot UI....
Centralises WCAG 2.2 AA accessibility logic for the summary feature. Generates semantically complete strings for each slide type so VoiceOve...
Manages Flutter AnimationController instances and Rive runtime integrations for the summary presentation. Provides a centralised registry of...
Flutter BLoC state management for badge-related UI state including loading earned badges, handling badge earn events, and managing badge det...
Supabase Edge Function triggered by a database webhook on activity insert/update. Invokes the badge evaluation service to check all badge cr...
Manages badge icon assets ensuring WCAG 2.2 AA contrast compliance. Provides icon resolution by badge definition ID, supports locked/unlocke...
Middleware utility that enforces organisation-scoped row-level security on all summary-related Supabase queries. Ensures that summary genera...
Supabase scheduled Edge Function that triggers the summary generation service at the start of each half-year and quarterly period boundary. ...
Thin infrastructure wrapper around the FCM/APNs push delivery layer. Accepts a normalised notification payload and device token from the tri...
Supabase Edge Function that acts as the scheduled entry point for periodic scenario evaluation. Triggered by pg_cron (or equivalent) at conf...
Environment-driven configuration that defines scenario thresholds, cooldown windows, cron schedule, supported scenario types, and feature fl...
Processes incoming deep links containing referral tokens when a new member taps the referral URL. Extracts the referral code, routes the app...
Utility wrapper around a Flutter QR code rendering package (e.g., qr_flutter). Accepts a referral URL string and returns a renderable QR cod...
Wraps the Flutter Share plugin (share_plus) to invoke the native iOS and Android system share sheet. Packages the referral URL and an option...
BLoC state management layer for the calculator screen. Handles input change events, triggers recalculation via the calculation service, and ...
A testing utility that provides helper methods for widget tests targeting semantic correctness. Includes matchers for semantic labels, roles...
Abstracts Flutter's SemanticsService and platform accessibility APIs behind a unified interface to simplify testing and enable consistent an...
Development-time utility that evaluates colour contrast ratios, touch target sizes, and semantic completeness against WCAG 2.2 AA criteria. ...
Ensures all UI components consume colour, typography, and spacing values exclusively from the project's design token system. Prevents hard-c...
Development-time utility that inspects widget trees and route configurations for cognitive accessibility violations. Runs as a Flutter test ...
Assembles the final Flutter ThemeData by composing the contrast-safe color scheme, the accessible text theme, and token-driven component the...
A Dart CLI script (or custom lint rule set) integrated into the CI pipeline that runs the contrast ratio validator and touch-target checks a...
Configuration for flutter_accessibility_lints (or equivalent custom lint package) that activates rules for semantic labels, minimum touch ta...
A development-time utility that automates gesture-accessibility checks using Flutter's SemanticsController and integration test helpers. Sim...
Central GoRouter configuration that defines all application routes with accessibility constraints built in: StatefulShellRoute for tab branc...
A shared utility that posts accessibility announcements to the platform's screen reader via Flutter's SemanticsService. Used by the recordin...
A platform-channel abstraction layer that routes speech recognition calls to the correct native engine — SFSpeechRecognizer on iOS and Speec...
Infrastructure component that loads and exposes the organization-specific feature flag configuration fetched from Supabase after org selecti...
Abstraction layer over Flutter's platform secure storage (Keychain on iOS, Keystore on Android) used for persisting sensitive session data s...
Infrastructure utility that injects the selected organization ID into the Supabase client configuration so all subsequent queries are automa...
A compile-time constant registry of all label keys used across the application, defined as a Dart abstract class with static string constant...
Defines the Riverpod provider graph for the terminology system: the root organizationLabelsProvider, derived providers for individual label ...
Infrastructure utility that bridges the terminology system with Flutter's Semantics tree to satisfy WCAG 2.2 AA requirements. Provides helpe...
Bootstrap service that pre-loads feature flags for the authenticated organization during app startup and after organization selection. Ensur...
A centralized constants file defining all valid feature flag keys as typed string constants. Prevents magic strings scattered across the cod...
Supabase database trigger or scheduled Edge Function that compares activity fingerprints (date, type, participant overlap) within a configur...
Utility service that validates the structural integrity of the organization hierarchy before and after mutations. Checks for orphaned nodes,...
Manages Supabase Row Level Security policies that join through the unit assignment junction table to enforce data access scoping. Generates ...
Validation utility ensuring integration configurations are complete and consistent before save. Validates that all required credential keys ...
Supabase Edge Functions hosting the REST API adapter logic and integration orchestration. Each integration type dispatches to the appropriat...
Configuration registry that declares supported integration types, their required credential fields, available field mapping targets, and fea...
Other Component Types
User Interface components handle presentation logic, user interactions, and visual elements of the application.
Service Layer components contain business logic, orchestrate operations, and provide core application functionality.
Data Layer components manage data persistence, storage operations, and data access patterns throughout the application.