# aditya-singh2005/looply architecture

> Architecture diagram of the GitHub repository aditya-singh2005/looply, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-05-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aditya-singh2005/looply
- Repository: https://github.com/aditya-singh2005/looply

## Overview

1. This is a Next.js App Router application for an OKR / performance-goals portal. The domain surface is centered on goals, quarterly check-ins, team management, admin reporting, and approval workflows.

2. The app is organized around route groups and role-specific areas rather than a single monolithic page tree. The main authenticated area lives under `src/app/(portal)`, with sub-areas for `admin`, `manager`, `dashboard`, `goals`, and `checkin`. There is also a separate `src/app/dashboard` route family with role-specific pages for `admin`, `manager`, and `employee`.

3. The top-level layout structure is important for the UI architecture. `src/app/layout.tsx` and `src/app/globals.css` provide the global shell, while `src/app/(portal)/layout.tsx` and `src/app/dashboard/layout.tsx` likely provide authenticated app framing. Reusable chrome is split into `AppShell`, `Sidebar`, `Topbar`, `RoleSwitcher`, and `TimeTravelWidget`.

4. Authentication and authorization are cross-cutting concerns. `src/lib/context/AuthContext.tsx`, `src/lib/hooks/useRole.ts`, and `src/middleware.ts` indicate that route access is guarded centrally, with role-based rendering and navigation decisions happening both at the edge and in the client.

5. Supabase is the main backend dependency and persistence layer. The repo has separate client/server entry points in `src/lib/supabase.ts`, `src/lib/supabase/client.ts`, `src/lib/supabase/server.ts`, and `src/lib/supabase-server.ts`, plus domain-specific query helpers in `src/lib/supabase/queries.ts` and audit helpers in `src/lib/supabase/audit.ts`. This suggests the app uses Supabase for auth, database access, and probably audit/event storage.

6. The primary user workflows are goal-centric. Under `src/app/(portal)/goals` there are list, detail, and new-goal pages, backed by components such as `MyGoalsPage`, `GoalDetailPage`, `GoalWizard`, `GoalRow`, `FilterPills`, `GoalStatusBadge`, and `WeightageBar`. The data flow appears to be: page/component → goals hooks/queries → Supabase.

7. Check-ins are a separate workflow with their own presentation layer. `src/app/(portal)/checkin/page.tsx` and `src/components/checkin/QuarterlyCheckinPage.tsx` indicate a dedicated quarterly review flow, with `ScorePill` and shared score utilities in `src/lib/utils/score.ts` and `src/components/shared/ProgressRing.tsx` supporting scoring and progress visualization.

8. Manager-specific screens focus on team oversight. `src/app/(portal)/manager/team` and `src/app/(portal)/manager/checkins` pair with `TeamGoalsView` and `TeamCheckinsView`, which implies managers can review direct reports’ goals and check-in status rather than only their own data.

9. Admin functionality is split into operational subdomains: audit, cycles, shared goals, and reports. This is a strong indicator of a back-office control plane for configuration, governance, and analytics rather than just user-facing productivity screens.

10. API routes are used for server-side mutations and operational actions. The notable endpoints are `src/app/api/goals/[id]/approve/route.ts` for goal approval and `src/app/api/seed/route.ts` for bootstrapping sample data. These sit alongside the Supabase server helpers, so the architecture mixes client-side fetching with server-mediated mutations where appropriate.

11. The repo has a clear separation between domain logic and UI primitives. Utility modules like `src/lib/utils/dates.ts`, `goal-format.ts`, `weightage.ts`, and `score.ts` encapsulate business rules, while the `src/components/ui` folder contains reusable design-system primitives (largely consistent with shadcn/ui patterns).

12. Supporting infrastructure includes Tailwind/PostCSS for styling, TypeScript for type safety, and a small set of scripts for operational tasks. `scripts/signup.js` and `scripts/run_qa.js` suggest automated account setup and QA/bootstrap flows, which matters for understanding how the app is exercised outside the browser.

13. For an architecture diagram, the key boundaries are: authenticated portal vs public auth pages, role-based views vs shared domain components, client UI vs Supabase-backed data access, and user-driven flows vs admin/manager oversight flows. The most important external system is Supabase; the most important internal orchestration layer is the Next.js route/layout structure plus middleware-based access control.

Main entry points: [`src/lib/supabase/queries.ts`](https://github.com/aditya-singh2005/looply/blob/main/src/lib/supabase/queries.ts) (Queries), [`src/components/layout/AppShell.tsx`](https://github.com/aditya-singh2005/looply/blob/main/src/components/layout/AppShell.tsx) (App shell UI), [`src/lib/hooks/useGoals.ts`](https://github.com/aditya-singh2005/looply/blob/main/src/lib/hooks/useGoals.ts) (Goal hooks), [`src/app/layout.tsx`](https://github.com/aditya-singh2005/looply/blob/main/src/app/layout.tsx) (Root layout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app_shell["App shell"]
  node_root_layout["Root layout<br/>next layout<br/>[layout.tsx]"]
  node_global_styles["Global styles<br/>[globals.css]"]
  node_portal_layout["Portal layout<br/>route layout<br/>[layout.tsx]"]
  node_dashboard_layout["Dashboard layout<br/>route layout<br/>[layout.tsx]"]
  node_middleware{{"Middleware<br/>access guard<br/>[middleware.ts]"}}
  node_auth_context["Auth context<br/>client auth<br/>[AuthContext.tsx]"]
  node_role_hook["Role hook<br/>client role<br/>[useRole.ts]"]
end

subgraph group_portal["Portal areas"]
  node_goals_page["Goals page<br/>portal page<br/>[page.tsx]"]
  node_goal_detail["Goal detail<br/>portal page<br/>[page.tsx]"]
  node_goal_new["New goal<br/>portal page<br/>[page.tsx]"]
  node_checkin_page["Check-in page<br/>portal page<br/>[page.tsx]"]
  node_manager_team["Team goals<br/>manager page<br/>[page.tsx]"]
  node_manager_checkins["Team check-ins<br/>manager page<br/>[page.tsx]"]
  node_admin_home["Admin home<br/>admin page<br/>[page.tsx]"]
  node_admin_audit["Audit<br/>admin page<br/>[page.tsx]"]
  node_admin_cycles["Cycles<br/>admin page<br/>[page.tsx]"]
  node_admin_reports["Reports<br/>admin page<br/>[page.tsx]"]
  node_admin_shared["Shared goals<br/>admin page<br/>[page.tsx]"]
end

subgraph group_dashboard_routes["Dashboard routes"]
  node_dashboard_admin["Admin dashboard<br/>role dashboard<br/>[page.tsx]"]
  node_dashboard_manager["Manager dashboard<br/>role dashboard<br/>[page.tsx]"]
  node_dashboard_employee["Employee dashboard<br/>role dashboard<br/>[page.tsx]"]
end

subgraph group_domain_data["Domain data"]
  node_goal_hooks["Goal hooks<br/>client data<br/>[useGoals.ts]"]
  node_supabase_queries["Queries<br/>data access<br/>[queries.ts]"]
  node_supabase_audit["Audit helpers<br/>data access<br/>[audit.ts]"]
  node_supabase_client["Supabase client<br/>browser db<br/>[client.ts]"]
  node_supabase_server["Supabase server<br/>server db<br/>[server.ts]"]
  node_supabase_core["Supabase core<br/>db bootstrap<br/>[supabase.ts]"]
  node_supabase_legacy["Server bridge<br/>server db<br/>[supabase-server.ts]"]
  node_goal_utils["Goal utils<br/>business rules<br/>[goal-format.ts]"]
end

subgraph group_shared_ui["Shared UI"]
  node_app_shell_ui["App shell UI<br/>chrome<br/>[AppShell.tsx]"]
  node_sidebar["Sidebar<br/>nav chrome<br/>[Sidebar.tsx]"]
  node_topbar["Topbar<br/>nav chrome<br/>[Topbar.tsx]"]
  node_role_switcher["Role switcher<br/>navigation control<br/>[RoleSwitcher.tsx]"]
  node_time_travel["Time travel<br/>context widget"]
end

node_root_layout -->|"loads"| node_global_styles
node_root_layout -->|"hosts"| node_portal_layout
node_root_layout -->|"hosts"| node_dashboard_layout
node_middleware -->|"guards"| node_auth_context
node_auth_context -->|"feeds"| node_role_hook
node_portal_layout -->|"renders"| node_app_shell_ui
node_app_shell_ui -->|"includes"| node_sidebar
node_app_shell_ui -->|"includes"| node_topbar
node_app_shell_ui -->|"includes"| node_role_switcher
node_app_shell_ui -->|"includes"| node_time_travel
node_goals_page -->|"loads"| node_goal_hooks
node_goal_detail -->|"loads"| node_goal_hooks
node_goal_new -->|"creates"| node_goal_hooks
node_checkin_page -->|"uses"| node_goal_utils
node_manager_team -->|"reads"| node_supabase_queries
node_manager_checkins -->|"reads"| node_supabase_queries
node_admin_audit -->|"reads"| node_supabase_audit
node_admin_cycles -->|"reads"| node_supabase_queries
node_admin_reports -->|"reads"| node_supabase_queries
node_admin_shared -->|"reads"| node_supabase_queries
node_dashboard_admin -->|"reads"| node_supabase_queries
node_dashboard_manager -->|"reads"| node_supabase_queries
node_dashboard_employee -->|"reads"| node_goal_hooks
node_goal_hooks -->|"uses"| node_supabase_client
node_supabase_queries -->|"uses"| node_supabase_server
node_supabase_server -->|"bridges"| node_supabase_core
node_supabase_client -->|"bridges"| node_supabase_core
node_supabase_legacy -->|"bridges"| node_supabase_core
node_supabase_audit -->|"writes"| node_supabase_server
node_supabase_queries -->|"uses"| node_supabase_client
node_goal_detail -->|"reads"| node_supabase_queries
node_goal_new -->|"writes"| node_supabase_queries
node_checkin_page -->|"writes"| node_supabase_queries
node_middleware -->|"protects"| node_portal_layout
node_middleware -->|"protects"| node_dashboard_layout
node_dashboard_layout -->|"adapts"| node_role_hook

click node_root_layout "https://github.com/aditya-singh2005/looply/blob/main/src/app/layout.tsx"
click node_global_styles "https://github.com/aditya-singh2005/looply/blob/main/src/app/globals.css"
click node_portal_layout "https://github.com/aditya-singh2005/looply/blob/main/src/app/(portal)/layout.tsx"
click node_dashboard_layout "https://github.com/aditya-singh2005/looply/blob/main/src/app/dashboard/layout.tsx"
click node_middleware "https://github.com/aditya-singh2005/looply/blob/main/src/middleware.ts"
click node_auth_context "https://github.com/aditya-singh2005/looply/blob/main/src/lib/context/AuthContext.tsx"
click node_role_hook "https://github.com/aditya-singh2005/looply/blob/main/src/lib/hooks/useRole.ts"
click node_app_shell_ui "https://github.com/aditya-singh2005/looply/blob/main/src/components/layout/AppShell.tsx"
click node_sidebar "https://github.com/aditya-singh2005/looply/blob/main/src/components/layout/Sidebar.tsx"
click node_topbar "https://github.com/aditya-singh2005/looply/blob/main/src/components/layout/Topbar.tsx"
click node_role_switcher "https://github.com/aditya-singh2005/looply/blob/main/src/components/layout/RoleSwitcher.tsx"
click node_time_travel "https://github.com/aditya-singh2005/looply/blob/main/src/components/layout/TimeTravelWidget.tsx"
click node_goals_page "https://github.com/aditya-singh2005/looply/blob/main/src/app/(portal)/goals/page.tsx"
click node_goal_detail "https://github.com/aditya-singh2005/looply/blob/main/src/app/(portal)/goals/[id]/page.tsx"
click node_goal_new "https://github.com/aditya-singh2005/looply/blob/main/src/app/(portal)/goals/new/page.tsx"
click node_checkin_page "https://github.com/aditya-singh2005/looply/blob/main/src/app/(portal)/checkin/page.tsx"
click node_manager_team "https://github.com/aditya-singh2005/looply/blob/main/src/app/(portal)/manager/team/page.tsx"
click node_manager_checkins "https://github.com/aditya-singh2005/looply/blob/main/src/app/(portal)/manager/checkins/page.tsx"
click node_admin_home "https://github.com/aditya-singh2005/looply/blob/main/src/app/(portal)/admin/page.tsx"
click node_admin_audit "https://github.com/aditya-singh2005/looply/blob/main/src/app/(portal)/admin/audit/page.tsx"
click node_admin_cycles "https://github.com/aditya-singh2005/looply/blob/main/src/app/(portal)/admin/cycles/page.tsx"
click node_admin_reports "https://github.com/aditya-singh2005/looply/blob/main/src/app/(portal)/admin/reports/page.tsx"
click node_admin_shared "https://github.com/aditya-singh2005/looply/blob/main/src/app/(portal)/admin/shared-goals/page.tsx"
click node_dashboard_admin "https://github.com/aditya-singh2005/looply/blob/main/src/app/dashboard/admin/page.tsx"
click node_dashboard_manager "https://github.com/aditya-singh2005/looply/blob/main/src/app/dashboard/manager/page.tsx"
click node_dashboard_employee "https://github.com/aditya-singh2005/looply/blob/main/src/app/dashboard/employee/page.tsx"
click node_goal_hooks "https://github.com/aditya-singh2005/looply/blob/main/src/lib/hooks/useGoals.ts"
click node_supabase_queries "https://github.com/aditya-singh2005/looply/blob/main/src/lib/supabase/queries.ts"
click node_supabase_audit "https://github.com/aditya-singh2005/looply/blob/main/src/lib/supabase/audit.ts"
click node_supabase_client "https://github.com/aditya-singh2005/looply/blob/main/src/lib/supabase/client.ts"
click node_supabase_server "https://github.com/aditya-singh2005/looply/blob/main/src/lib/supabase/server.ts"
click node_supabase_core "https://github.com/aditya-singh2005/looply/blob/main/src/lib/supabase.ts"
click node_supabase_legacy "https://github.com/aditya-singh2005/looply/blob/main/src/lib/supabase-server.ts"
click node_goal_utils "https://github.com/aditya-singh2005/looply/blob/main/src/lib/utils/goal-format.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_root_layout,node_global_styles,node_portal_layout,node_dashboard_layout,node_middleware,node_auth_context,node_role_hook toneBlue
class node_goals_page,node_goal_detail,node_goal_new,node_checkin_page,node_manager_team,node_manager_checkins,node_admin_home,node_admin_audit,node_admin_cycles,node_admin_reports,node_admin_shared toneAmber
class node_dashboard_admin,node_dashboard_manager,node_dashboard_employee toneMint
class node_goal_hooks,node_supabase_queries,node_supabase_audit,node_supabase_client,node_supabase_server,node_supabase_core,node_supabase_legacy,node_goal_utils toneRose
class node_app_shell_ui,node_sidebar,node_topbar,node_role_switcher,node_time_travel toneIndigo
```

## Components

### App shell

Global and authenticated route framing plus access control.

- [Root layout](https://github.com/aditya-singh2005/looply/blob/main/src/app/layout.tsx): next layout · Global app shell and metadata entrypoint. · `src/app/layout.tsx`
- [Global styles](https://github.com/aditya-singh2005/looply/blob/main/src/app/globals.css): styles · Application-wide styling foundation. · `src/app/globals.css`
- [Portal layout](https://github.com/aditya-singh2005/looply/blob/main/src/app/(portal)/layout.tsx): route layout · Authenticated framing for the main portal routes. · `src/app/(portal)/layout.tsx`
- [Dashboard layout](https://github.com/aditya-singh2005/looply/blob/main/src/app/dashboard/layout.tsx): route layout · Shared framing for the role-specific dashboard family. · `src/app/dashboard/layout.tsx`
- [Middleware](https://github.com/aditya-singh2005/looply/blob/main/src/middleware.ts): access guard · Edge-level route protection and role-aware access control. · `src/middleware.ts`
- [Auth context](https://github.com/aditya-singh2005/looply/blob/main/src/lib/context/AuthContext.tsx): client auth · Client-side authentication and session state. · `src/lib/context/AuthContext.tsx`
- [Role hook](https://github.com/aditya-singh2005/looply/blob/main/src/lib/hooks/useRole.ts): client role · Role detection used by navigation and rendering. · `src/lib/hooks/useRole.ts`

### Portal areas

Primary authenticated OKR and performance-goals experience under the portal route group.

- [Goals page](https://github.com/aditya-singh2005/looply/blob/main/src/app/(portal)/goals/page.tsx): portal page · Personal goals list and entrypoint. · `src/app/(portal)/goals/page.tsx`
- [Goal detail](https://github.com/aditya-singh2005/looply/blob/main/src/app/(portal)/goals/[id]/page.tsx): portal page · Single-goal inspection and management. · `src/app/(portal)/goals/[id]/page.tsx`
- [New goal](https://github.com/aditya-singh2005/looply/blob/main/src/app/(portal)/goals/new/page.tsx): portal page · Goal creation flow. · `src/app/(portal)/goals/new/page.tsx`
- [Check-in page](https://github.com/aditya-singh2005/looply/blob/main/src/app/(portal)/checkin/page.tsx): portal page · Quarterly review and scoring workflow. · `src/app/(portal)/checkin/page.tsx`
- [Team goals](https://github.com/aditya-singh2005/looply/blob/main/src/app/(portal)/manager/team/page.tsx): manager page · Manager view over direct reports' goals. · `src/app/(portal)/manager/team/page.tsx`
- [Team check-ins](https://github.com/aditya-singh2005/looply/blob/main/src/app/(portal)/manager/checkins/page.tsx): manager page · Manager view over team check-in status. · `src/app/(portal)/manager/checkins/page.tsx`
- [Admin home](https://github.com/aditya-singh2005/looply/blob/main/src/app/(portal)/admin/page.tsx): admin page · Back-office landing page for governance tasks. · `src/app/(portal)/admin/page.tsx`
- [Audit](https://github.com/aditya-singh2005/looply/blob/main/src/app/(portal)/admin/audit/page.tsx): admin page · Audit trail and oversight screen. · `src/app/(portal)/admin/audit/page.tsx`
- [Cycles](https://github.com/aditya-singh2005/looply/blob/main/src/app/(portal)/admin/cycles/page.tsx): admin page · Quarter/goal cycle administration. · `src/app/(portal)/admin/cycles/page.tsx`
- [Reports](https://github.com/aditya-singh2005/looply/blob/main/src/app/(portal)/admin/reports/page.tsx): admin page · Operational and analytical reporting. · `src/app/(portal)/admin/reports/page.tsx`
- [Shared goals](https://github.com/aditya-singh2005/looply/blob/main/src/app/(portal)/admin/shared-goals/page.tsx): admin page · Shared-goal configuration and governance. · `src/app/(portal)/admin/shared-goals/page.tsx`

### Dashboard routes

Role-specific dashboard family with separate entry points.

- [Admin dashboard](https://github.com/aditya-singh2005/looply/blob/main/src/app/dashboard/admin/page.tsx): role dashboard · Admin-specific dashboard entrypoint. · `src/app/dashboard/admin/page.tsx`
- [Manager dashboard](https://github.com/aditya-singh2005/looply/blob/main/src/app/dashboard/manager/page.tsx): role dashboard · Manager-specific dashboard entrypoint. · `src/app/dashboard/manager/page.tsx`
- [Employee dashboard](https://github.com/aditya-singh2005/looply/blob/main/src/app/dashboard/employee/page.tsx): role dashboard · Employee-specific dashboard entrypoint. · `src/app/dashboard/employee/page.tsx`

### Domain data

Supabase-backed access layer, mutations, and business-rule utilities.

- [Goal hooks](https://github.com/aditya-singh2005/looply/blob/main/src/lib/hooks/useGoals.ts): client data · Client-side goal loading and state orchestration. · `src/lib/hooks/useGoals.ts`
- [Queries](https://github.com/aditya-singh2005/looply/blob/main/src/lib/supabase/queries.ts): data access · Domain queries and reads against Supabase. · `src/lib/supabase/queries.ts`
- [Audit helpers](https://github.com/aditya-singh2005/looply/blob/main/src/lib/supabase/audit.ts): data access · Audit/event write helpers for governance flows. · `src/lib/supabase/audit.ts`
- [Supabase client](https://github.com/aditya-singh2005/looply/blob/main/src/lib/supabase/client.ts): browser db · Client-side Supabase entrypoint. · `src/lib/supabase/client.ts`
- [Supabase server](https://github.com/aditya-singh2005/looply/blob/main/src/lib/supabase/server.ts): server db · Server-side Supabase entrypoint for authenticated requests. · `src/lib/supabase/server.ts`
- [Supabase core](https://github.com/aditya-singh2005/looply/blob/main/src/lib/supabase.ts): db bootstrap · Primary Supabase configuration bridge. · `src/lib/supabase.ts`
- [Server bridge](https://github.com/aditya-singh2005/looply/blob/main/src/lib/supabase-server.ts): server db · Additional server-side Supabase bridge. · `src/lib/supabase-server.ts`
- [Goal utils](https://github.com/aditya-singh2005/looply/blob/main/src/lib/utils/goal-format.ts): business rules · Goal formatting and weightage calculations. · `src/lib/utils/goal-format.ts`

### Shared UI

Reusable feature components and design-system primitives.

- [App shell UI](https://github.com/aditya-singh2005/looply/blob/main/src/components/layout/AppShell.tsx): chrome · Main authenticated shell composition. · `src/components/layout/AppShell.tsx`
- [Sidebar](https://github.com/aditya-singh2005/looply/blob/main/src/components/layout/Sidebar.tsx): nav chrome · Primary navigation rail. · `src/components/layout/Sidebar.tsx`
- [Topbar](https://github.com/aditya-singh2005/looply/blob/main/src/components/layout/Topbar.tsx): nav chrome · Top-level app header and actions. · `src/components/layout/Topbar.tsx`
- [Role switcher](https://github.com/aditya-singh2005/looply/blob/main/src/components/layout/RoleSwitcher.tsx): navigation control · Role-aware navigation affordance. · `src/components/layout/RoleSwitcher.tsx`
- [Time travel](https://github.com/aditya-singh2005/looply/blob/main/src/components/layout/TimeTravelWidget.tsx): context widget · Temporal context selector for viewing other periods. · `src/components/layout/TimeTravelWidget.tsx`

## Connections

- Root layout → Global styles: loads · Root shell applies global styling.
- Root layout → Portal layout: hosts · Authenticated route group hangs off the root app.
- Root layout → Dashboard layout: hosts · Role dashboards mount under the root app.
- Middleware → Auth context: guards · Route protection is coordinated with app auth state.
- Auth context → Role hook: feeds · Session state informs role-aware UI decisions.
- Portal layout → App shell UI: renders · Portal framing composes the shared shell.
- App shell UI → Sidebar: includes · Shell navigation uses the sidebar.
- App shell UI → Topbar: includes · Shell header uses the topbar.
- App shell UI → Role switcher: includes · Shell exposes role switching.
- App shell UI → Time travel: includes · Shell exposes temporal context control.
- Goals page → Goal hooks: loads · Goals list is backed by client goal state.
- Goal detail → Goal hooks: loads · Goal details reuse the same goal data layer.
- New goal → Goal hooks: creates · Goal creation flow shares the goal state layer.
- Check-in page → Goal utils: uses · Check-in scoring relies on shared business rules.
- Team goals → Queries: reads · Manager oversight screen pulls team goal data.
- Team check-ins → Queries: reads · Manager oversight screen pulls team check-in data.
- Audit → Audit helpers: reads · Audit view is backed by audit records.
- Cycles → Queries: reads · Cycle administration uses domain reads.
- Reports → Queries: reads · Reports are assembled from query helpers.
- Shared goals → Queries: reads · Shared-goal governance uses domain reads.
- Admin dashboard → Queries: reads · Admin dashboard summarizes operational data.
- Manager dashboard → Queries: reads · Manager dashboard summarizes team data.
- Employee dashboard → Goal hooks: reads · Employee dashboard is driven by personal goals.
- Goal hooks → Supabase client: uses · Client hooks query Supabase from the browser.
- Queries → Supabase server: uses · Server-side reads and mutations go through the server client.
- Supabase server → Supabase core: bridges · Server client is configured from the shared Supabase setup.
- Supabase client → Supabase core: bridges · Browser client is configured from the shared Supabase setup.
- Server bridge → Supabase core: bridges · Legacy server entrypoint connects to the shared Supabase setup.
- Audit helpers → Supabase server: writes · Audit helpers persist via server-side access.
- Queries → Supabase client: uses · Read helpers can also be used from client-side flows.
- Goal detail → Queries: reads · Goal detail page resolves goal data from queries.
- New goal → Queries: writes · Creation flow persists new goal records.
- Check-in page → Queries: writes · Check-in workflow submits quarterly updates.
- Middleware → Portal layout: protects · Middleware enforces portal access.
- Middleware → Dashboard layout: protects · Middleware enforces dashboard access.
- Dashboard layout → Role hook: adapts · Dashboard framing adapts to the current role.
