# janeeva1/pixel-perfect-copy architecture

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

- Interactive diagram: https://gitdiagram.com/janeeva1/pixel-perfect-copy
- Repository: https://github.com/janeeva1/pixel-perfect-copy

## Overview

Pixel Perfect Copy is an institutional attendance-management app: users sign in, manage student and staff records, and use attendance sessions to turn biometric exports into present/absent registers. The sampled people route shows spreadsheet parsing, record normalization, and Supabase persistence; the README documents session-based register generation, but the dashboard implementation was not excerpted, so its internal steps are not inferred. The map also includes authentication, routing, preview-session storage, and error handling. Some route and dashboard links rely on the SOURCE INDEX rather than full excerpts.

Main entry points: [`src/integrations/supabase/client.ts`](https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/integrations/supabase/client.ts) (Supabase client), [`src/routeTree.gen.ts`](https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/routeTree.gen.ts) (Route graph), [`src/routes/auth.tsx`](https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/routes/auth.tsx) (Sign-in page), [`src/routes/_authenticated/people.tsx`](https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/routes/_authenticated/people.tsx) (People management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_landing["Landing page<br/>[index.tsx]"]
  node_router["Router setup<br/>[router.tsx]"]
  node_routegraph["Route graph<br/>[routeTree.gen.ts]"]
  node_root["Root route<br/>[__root.tsx]"]
  node_shell["App shell<br/>[AppShell.tsx]"]
  node_ui_controls["UI controls<br/>[button.tsx]"]
end

subgraph group_attendance["People and attendance"]
  node_dashboard["Attendance dashboard<br/>[dashboard.tsx]"]
  node_people["People management<br/>[people.tsx]"]
  node_spreadsheet["Spreadsheet reader<br/>[spreadsheet.ts]"]
  node_attendance_logic["Attendance utilities<br/>[attendance.ts]"]
end

subgraph group_identity["Identity and data"]
  node_authpage["Sign-in page<br/>[auth.tsx]"]
  node_guard["Authenticated layout<br/>[route.tsx]"]
  node_auth_hook["Session and roles<br/>[useAuth.ts]"]
  node_supabase_client["Supabase client<br/>[client.ts]"]
  node_preview_storage["Preview auth storage"]
  node_supabase[("Supabase service")]
  node_lovable_oauth["Lovable OAuth adapter<br/>[index.ts]"]
end

subgraph group_runtime["Runtime support"]
  node_error_capture["Error capture<br/>[error-capture.ts]"]
  node_error_page["Error page<br/>[error-page.ts]"]
end

node_user(("Institution user"))

node_user -->|"opens"| node_landing
node_landing -->|"routes unauthenticated"| node_authpage
node_landing -->|"routes signed-in"| node_dashboard
node_user -->|"signs in or up"| node_authpage
node_authpage -->|"authenticates with"| node_supabase_client
node_authpage -->|"starts Google OAuth"| node_lovable_oauth
node_router -->|"uses routes"| node_routegraph
node_routegraph -->|"registers route"| node_root
node_routegraph -->|"registers route"| node_landing
node_routegraph -->|"registers route"| node_authpage
node_routegraph -->|"registers route"| node_guard
node_routegraph -->|"registers route"| node_dashboard
node_routegraph -->|"registers route"| node_people
node_guard -->|"checks user"| node_supabase_client
node_guard -->|"redirects unauthenticated"| node_authpage
node_guard -->|"wraps authenticated pages"| node_shell
node_shell -->|"reads session"| node_auth_hook
node_dashboard -->|"queries attendance data"| node_supabase_client
node_dashboard -->|"checks session"| node_auth_hook
node_people -->|"reads and saves records"| node_supabase_client
node_people -->|"reads uploaded file"| node_spreadsheet
node_people -->|"normalizes records"| node_attendance_logic
node_people -->|"checks permissions"| node_auth_hook
node_auth_hook -->|"loads session and roles"| node_supabase_client
node_supabase_client -->|"configures auth storage"| node_preview_storage
node_supabase_client -->|"connects to"| node_supabase
node_supabase_client -.->|"falls back to local storage"| node_preview_storage
node_root -->|"uses error handling"| node_error_page
node_error_page -.->|"reports errors"| node_error_capture
node_landing -->|"renders buttons"| node_ui_controls
node_authpage -->|"renders buttons"| node_ui_controls

click node_landing "https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/routes/index.tsx"
click node_authpage "https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/routes/auth.tsx"
click node_router "https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/router.tsx"
click node_routegraph "https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/routeTree.gen.ts"
click node_root "https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/routes/__root.tsx"
click node_guard "https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/routes/_authenticated/route.tsx"
click node_shell "https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/components/AppShell.tsx"
click node_dashboard "https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/routes/_authenticated/dashboard.tsx"
click node_people "https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/routes/_authenticated/people.tsx"
click node_spreadsheet "https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/lib/spreadsheet.ts"
click node_attendance_logic "https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/lib/attendance.ts"
click node_auth_hook "https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/lib/useAuth.ts"
click node_supabase_client "https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/integrations/supabase/client.ts"
click node_preview_storage "https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/integrations/supabase/previewAuthStorage.ts"
click node_lovable_oauth "https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/integrations/lovable/index.ts"
click node_error_capture "https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/lib/error-capture.ts"
click node_error_page "https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/lib/error-page.ts"
click node_ui_controls "https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/components/ui/button.tsx"

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_landing,node_router,node_routegraph,node_root,node_shell,node_ui_controls,node_user toneBlue
class node_dashboard,node_people,node_spreadsheet,node_attendance_logic toneAmber
class node_authpage,node_guard,node_auth_hook,node_supabase_client,node_preview_storage,node_supabase,node_lovable_oauth toneMint
class node_error_capture,node_error_page toneRose
```

## Components

### App experience

- [Landing page](https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/routes/index.tsx): `src/routes/index.tsx`
- [Router setup](https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/router.tsx): `src/router.tsx`
- [Route graph](https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/routeTree.gen.ts): `src/routeTree.gen.ts`
- [Root route](https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/routes/__root.tsx): `src/routes/__root.tsx`
- [App shell](https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/components/AppShell.tsx): `src/components/AppShell.tsx`
- [UI controls](https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/components/ui/button.tsx): `src/components/ui/button.tsx`

### People and attendance

- [Attendance dashboard](https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/routes/_authenticated/dashboard.tsx): `src/routes/_authenticated/dashboard.tsx`
- [People management](https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/routes/_authenticated/people.tsx): `src/routes/_authenticated/people.tsx`
- [Spreadsheet reader](https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/lib/spreadsheet.ts): `src/lib/spreadsheet.ts`
- [Attendance utilities](https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/lib/attendance.ts): `src/lib/attendance.ts`

### Identity and data

- [Sign-in page](https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/routes/auth.tsx): `src/routes/auth.tsx`
- [Authenticated layout](https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/routes/_authenticated/route.tsx): `src/routes/_authenticated/route.tsx`
- [Session and roles](https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/lib/useAuth.ts): `src/lib/useAuth.ts`
- [Supabase client](https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/integrations/supabase/client.ts): `src/integrations/supabase/client.ts`
- [Preview auth storage](https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/integrations/supabase/previewAuthStorage.ts): `src/integrations/supabase/previewAuthStorage.ts`
- **Supabase service**
- [Lovable OAuth adapter](https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/integrations/lovable/index.ts): `src/integrations/lovable/index.ts`

### Runtime support

- [Error capture](https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/lib/error-capture.ts): `src/lib/error-capture.ts`
- [Error page](https://github.com/janeeva1/pixel-perfect-copy/blob/main/src/lib/error-page.ts): `src/lib/error-page.ts`

### Other components

- **Institution user**

## Connections

- Institution user → Landing page: opens (evidence: `src/routes/index.tsx`)
- Landing page → Sign-in page: routes unauthenticated (evidence: `src/routes/index.tsx`)
- Landing page → Attendance dashboard: routes signed-in (evidence: `src/routes/index.tsx`)
- Institution user → Sign-in page: signs in or up (evidence: `src/routes/auth.tsx`)
- Sign-in page → Supabase client: authenticates with (evidence: `src/routes/auth.tsx`)
- Sign-in page → Lovable OAuth adapter: starts Google OAuth (evidence: `src/routes/auth.tsx`)
- Router setup → Route graph: uses routes (evidence: `src/router.tsx`)
- Route graph → Root route: registers route (evidence: `src/routeTree.gen.ts`)
- Route graph → Landing page: registers route (evidence: `src/routeTree.gen.ts`)
- Route graph → Sign-in page: registers route (evidence: `src/routeTree.gen.ts`)
- Route graph → Authenticated layout: registers route (evidence: `src/routeTree.gen.ts`)
- Route graph → Attendance dashboard: registers route (evidence: `src/routeTree.gen.ts`)
- Route graph → People management: registers route (evidence: `src/routeTree.gen.ts`)
- Authenticated layout → Supabase client: checks user (evidence: `src/routes/_authenticated/route.tsx`)
- Authenticated layout → Sign-in page: redirects unauthenticated (evidence: `src/routes/_authenticated/route.tsx`)
- Authenticated layout → App shell: wraps authenticated pages (evidence: `src/routes/_authenticated/route.tsx`)
- App shell → Session and roles: reads session (evidence: `src/components/AppShell.tsx`)
- Attendance dashboard → Supabase client: queries attendance data (evidence: `src/routes/_authenticated/dashboard.tsx`)
- Attendance dashboard → Session and roles: checks session (evidence: `src/routes/_authenticated/dashboard.tsx`)
- People management → Supabase client: reads and saves records (evidence: `src/routes/_authenticated/people.tsx`)
- People management → Spreadsheet reader: reads uploaded file (evidence: `src/routes/_authenticated/people.tsx`)
- People management → Attendance utilities: normalizes records (evidence: `src/routes/_authenticated/people.tsx`)
- People management → Session and roles: checks permissions (evidence: `src/routes/_authenticated/people.tsx`)
- Session and roles → Supabase client: loads session and roles (evidence: `src/lib/useAuth.ts`)
- Supabase client → Preview auth storage: configures auth storage (evidence: `src/integrations/supabase/client.ts`)
- Supabase client → Supabase service: connects to (evidence: `src/integrations/supabase/client.ts`)
- Supabase client → Preview auth storage: falls back to local storage (evidence: `src/integrations/supabase/previewAuthStorage.ts`)
- Root route → Error page: uses error handling (evidence: `src/routes/__root.tsx`)
- Error page → Error capture: reports errors (evidence: `src/lib/error-page.ts`)
- Landing page → UI controls: renders buttons (evidence: `src/routes/index.tsx`)
- Sign-in page → UI controls: renders buttons (evidence: `src/routes/auth.tsx`)
