settings integrations - BevvyTech/BrewskiDocs GitHub Wiki
Settings – Integrations (/settings/integrations)
Purpose
Surface third-party integrations available to the brewery, starting with the Breww.com sync and the Kegstar keg management link.
Provide a consistent entry point for upcoming connectors while the backend contracts are finalised.
Data & Dependencies
Fetches integration state from the admin API (GET /integrations?teamId=...) and maps the response into provider cards.
Uses i18n keys under settings-integrations-* and ships brand assets from public/integrations/.
Key Interactions
Breadcrumb trail links back to the dashboard and Settings index.
Displays five integration cards in a responsive grid; each live connector shows status, logo, name, and the last-connected timestamp (or “Never” when nothing has been authorised).
Status chips use colour to indicate connection readiness (Connected, Not connected, Coming soon) and each card footer hosts the standard action button.
Empty slots now prompt “Need a new integration?” with a support ticket CTA that opens the global “Raise a support ticket” dialog; these placeholders hide the status chip and last-connected text.
Clicking “Connect/Manage” on the Breww card opens a modal prompting for the Breww API key; submitting calls /integrations/breww/connect, verifies connectivity against https://breww.com/api/business-details/, and persists the key for the active team.
Implementation Notes
Card data is supplied by provider modules under src/features/integrations/; each provider conforms to a shared interface so backend-driven state can be injected without touching the page layout.
Integration state is stored in the team_integrations table (via the /integrations API) and passed to providers through the shared context so status badges and metadata (e.g., Breww business name) reflect server truth.
Cards accept an optional squareLogoSrc so brands with non-square artwork can supply a dedicated square variant for the grid; the UI favours that property and falls back to logoSrc. The Kegstar provider now references the square asset at public/integrations/kegstar2.svg, and placeholder slots reuse public/images/logo-clear.png with a grayscale filter while emitting the brewski:support/open-ticket event consumed by the shared support menu.