# trngclone-lab9262/prompt-weaver architecture

> Architecture diagram of the GitHub repository trngclone-lab9262/prompt-weaver, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/trngclone-lab9262/prompt-weaver
- Repository: https://github.com/trngclone-lab9262/prompt-weaver

## Overview

DYNAMO VIETNAM MC - MES is a role-aware manufacturing execution interface for production control. The user enters through the landing page, signs in or registers, and authenticated users reach a workspace for production monitoring and shop-floor workflows. Documented capabilities include Plan vs Actual timelines and KPIs, machine status, Shinko lists, work orders, personal jobs, imports, and audit history. The sampled code confirms Supabase-backed authentication and role lookup, plus timeline rendering; feature-page data wiring was not sampled, so those connections are intentionally not asserted.

Main entry points: [`src/components/AppShell.tsx`](https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/components/AppShell.tsx) (Application Shell), [`src/integrations/supabase/client.ts`](https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/integrations/supabase/client.ts) (Supabase Client), [`src/routes/_authenticated/route.tsx`](https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/routes/_authenticated/route.tsx) (Authenticated Guard), [`src/routes/index.tsx`](https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/routes/index.tsx) (Landing Page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and Workspace"]
  node_landing["Landing Page<br/>[index.tsx]"]
  node_authpage["Sign-in / Signup<br/>[auth.tsx]"]
  node_authguard["Authenticated Guard<br/>[route.tsx]"]
  node_shell["Application Shell<br/>[AppShell.tsx]"]
end

subgraph group_monitoring["Production Monitoring"]
  node_dashboard["Dashboard and KPIs<br/>[dashboard.tsx]"]
  node_timelinepage["Production Timeline<br/>[timeline.tsx]"]
  node_timelineview["Timeline Renderer<br/>[Timeline.tsx]"]
  node_machines["Machine Status<br/>[machines.tsx]"]
  node_shinko["Shinko List<br/>[shinko.tsx]"]
end

subgraph group_operations["Shop Floor Operations"]
  node_workorders["Work Orders<br/>[work-orders.tsx]"]
  node_myjobs["My Jobs<br/>[my-jobs.tsx]"]
  node_importpage["Production Import<br/>[import.tsx]"]
  node_auditpage["Audit History<br/>[audit.tsx]"]
end

subgraph group_shared["Shared Services"]
  node_authhook["Session and Roles<br/>[useAuth.ts]"]
  node_meslib["MES Domain Helpers<br/>[mes.ts]"]
  node_csvmap["CSV Mapping<br/>[csv-map.ts]"]
  node_supabaseclient["Supabase Client<br/>[client.ts]"]
end

node_operator(("MES User"))
node_supabase[("Supabase Service")]

node_operator -->|"opens"| node_landing
node_landing -->|"signs in"| node_authpage
node_authpage -->|"authenticates"| node_supabaseclient
node_authguard -->|"checks user"| node_supabaseclient
node_authguard -->|"renders"| node_shell
node_shell -->|"hosts route"| node_dashboard
node_shell -->|"hosts route"| node_timelinepage
node_shell -->|"hosts route"| node_machines
node_shell -->|"hosts route"| node_shinko
node_shell -->|"hosts route"| node_workorders
node_shell -->|"hosts route"| node_myjobs
node_shell -->|"hosts route"| node_importpage
node_shell -->|"hosts route"| node_auditpage
node_authhook -->|"reads session and roles"| node_supabaseclient
node_supabaseclient -->|"queries"| node_supabase

click node_landing "https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/routes/index.tsx"
click node_authpage "https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/routes/auth.tsx"
click node_authguard "https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/routes/_authenticated/route.tsx"
click node_shell "https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/components/AppShell.tsx"
click node_dashboard "https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/routes/_authenticated/dashboard.tsx"
click node_timelinepage "https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/routes/_authenticated/timeline.tsx"
click node_timelineview "https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/components/Timeline.tsx"
click node_machines "https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/routes/_authenticated/machines.tsx"
click node_shinko "https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/routes/_authenticated/shinko.tsx"
click node_workorders "https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/routes/_authenticated/work-orders.tsx"
click node_myjobs "https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/routes/_authenticated/my-jobs.tsx"
click node_importpage "https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/routes/_authenticated/import.tsx"
click node_auditpage "https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/routes/_authenticated/audit.tsx"
click node_authhook "https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/hooks/useAuth.ts"
click node_meslib "https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/lib/mes.ts"
click node_csvmap "https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/lib/csv-map.ts"
click node_supabaseclient "https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/integrations/supabase/client.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_landing,node_authpage,node_authguard,node_shell,node_operator toneBlue
class node_dashboard,node_timelinepage,node_timelineview,node_machines,node_shinko,node_supabase toneAmber
class node_workorders,node_myjobs,node_importpage,node_auditpage toneMint
class node_authhook,node_meslib,node_csvmap,node_supabaseclient toneRose
```

## Components

### Access and Workspace

- [Landing Page](https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/routes/index.tsx): `src/routes/index.tsx`
- [Sign-in / Signup](https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/routes/auth.tsx): `src/routes/auth.tsx`
- [Authenticated Guard](https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/routes/_authenticated/route.tsx): `src/routes/_authenticated/route.tsx`
- [Application Shell](https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/components/AppShell.tsx): `src/components/AppShell.tsx`

### Production Monitoring

- [Dashboard and KPIs](https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/routes/_authenticated/dashboard.tsx): `src/routes/_authenticated/dashboard.tsx`
- [Production Timeline](https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/routes/_authenticated/timeline.tsx): `src/routes/_authenticated/timeline.tsx`
- [Timeline Renderer](https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/components/Timeline.tsx): `src/components/Timeline.tsx`
- [Machine Status](https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/routes/_authenticated/machines.tsx): `src/routes/_authenticated/machines.tsx`
- [Shinko List](https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/routes/_authenticated/shinko.tsx): `src/routes/_authenticated/shinko.tsx`

### Shop Floor Operations

- [Work Orders](https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/routes/_authenticated/work-orders.tsx): `src/routes/_authenticated/work-orders.tsx`
- [My Jobs](https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/routes/_authenticated/my-jobs.tsx): `src/routes/_authenticated/my-jobs.tsx`
- [Production Import](https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/routes/_authenticated/import.tsx): `src/routes/_authenticated/import.tsx`
- [Audit History](https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/routes/_authenticated/audit.tsx): `src/routes/_authenticated/audit.tsx`

### Shared Services

- [Session and Roles](https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/hooks/useAuth.ts): `src/hooks/useAuth.ts`
- [MES Domain Helpers](https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/lib/mes.ts): `src/lib/mes.ts`
- [CSV Mapping](https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/lib/csv-map.ts): `src/lib/csv-map.ts`
- [Supabase Client](https://github.com/trngclone-lab9262/prompt-weaver/blob/main/src/integrations/supabase/client.ts): `src/integrations/supabase/client.ts`

### Other components

- **MES User**
- **Supabase Service**

## Connections

- MES User → Landing Page: opens
- Landing Page → Sign-in / Signup: signs in
- Sign-in / Signup → Supabase Client: authenticates
- Authenticated Guard → Supabase Client: checks user
- Authenticated Guard → Application Shell: renders
- Application Shell → Dashboard and KPIs: hosts route
- Application Shell → Production Timeline: hosts route
- Application Shell → Machine Status: hosts route
- Application Shell → Shinko List: hosts route
- Application Shell → Work Orders: hosts route
- Application Shell → My Jobs: hosts route
- Application Shell → Production Import: hosts route
- Application Shell → Audit History: hosts route
- Session and Roles → Supabase Client: reads session and roles
- Supabase Client → Supabase Service: queries
