# redward42/crewmates architecture

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

- Interactive diagram: https://gitdiagram.com/redward42/crewmates
- Repository: https://github.com/redward42/crewmates

## Overview

Crewmates is a React app for creating and managing crewmates. The user enters through the home page or navigation, creates a crewmate, browses the newest-first gallery, and can open a crewmate’s details or edit it; editing also supports deletion. Page components issue database operations through a shared Supabase client. The README documents the user-facing capabilities, while the sampled source shows the route wiring and operations. The Supabase service connection is inferred from client configuration, so that external link is marked unverified.

Main entry points: [`src/App.tsx`](https://github.com/RedWARd42/Crewmates/blob/main/src/App.tsx) (App router), [`src/supabase-client.ts`](https://github.com/RedWARd42/Crewmates/blob/main/src/supabase-client.ts) (Supabase client), [`src/components/Sidebar.tsx`](https://github.com/RedWARd42/Crewmates/blob/main/src/components/Sidebar.tsx) (Sidebar links), [`src/pages/Gallery.tsx`](https://github.com/RedWARd42/Crewmates/blob/main/src/pages/Gallery.tsx) (Crew gallery)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["Navigation and routing"]
  node_app["App router<br/>[App.tsx]"]
  node_sidebar["Sidebar links<br/>[Sidebar.tsx]"]
end

subgraph group_crew_pages["Crewmate pages"]
  node_home["Home page<br/>[Home.tsx]"]
  node_create["Create crewmate<br/>[Create.tsx]"]
  node_gallery["Crew gallery<br/>[Gallery.tsx]"]
  node_details["Crew details<br/>[Details.tsx]"]
  node_edit["Edit and delete<br/>[Edit.tsx]"]
end

subgraph group_presentation["Crew presentation"]
  node_card["Crew card<br/>[Card.tsx]"]
end

subgraph group_persistence["Data access"]
  node_supabase_client["Supabase client<br/>[supabase-client.ts]"]
  node_supabase[("Supabase service")]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_sidebar
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_create
node_app -->|"routes to"| node_gallery
node_app -->|"routes to"| node_details
node_app -->|"routes to"| node_edit
node_sidebar -->|"links to"| node_home
node_sidebar -->|"links to"| node_create
node_sidebar -->|"links to"| node_gallery
node_home -->|"links to"| node_create
node_create -->|"reads and inserts"| node_supabase_client
node_gallery -->|"reads crew"| node_supabase_client
node_gallery -->|"renders"| node_card
node_card -->|"links to"| node_details
node_card -->|"links to"| node_edit
node_details -->|"reads crew"| node_supabase_client
node_details -->|"links to"| node_edit
node_edit -->|"reads and mutates"| node_supabase_client
node_supabase_client -.->|"connects to"| node_supabase

click node_app "https://github.com/RedWARd42/Crewmates/blob/main/src/App.tsx"
click node_sidebar "https://github.com/RedWARd42/Crewmates/blob/main/src/components/Sidebar.tsx"
click node_home "https://github.com/RedWARd42/Crewmates/blob/main/src/pages/Home.tsx"
click node_create "https://github.com/RedWARd42/Crewmates/blob/main/src/pages/Create.tsx"
click node_gallery "https://github.com/RedWARd42/Crewmates/blob/main/src/pages/Gallery.tsx"
click node_details "https://github.com/RedWARd42/Crewmates/blob/main/src/pages/Details.tsx"
click node_edit "https://github.com/RedWARd42/Crewmates/blob/main/src/pages/Edit.tsx"
click node_card "https://github.com/RedWARd42/Crewmates/blob/main/src/components/Card.tsx"
click node_supabase_client "https://github.com/RedWARd42/Crewmates/blob/main/src/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_app,node_sidebar,node_user toneBlue
class node_home,node_create,node_gallery,node_details,node_edit toneAmber
class node_card toneMint
class node_supabase_client,node_supabase toneRose
```

## Components

### Navigation and routing

- [App router](https://github.com/RedWARd42/Crewmates/blob/main/src/App.tsx): `src/App.tsx`
- [Sidebar links](https://github.com/RedWARd42/Crewmates/blob/main/src/components/Sidebar.tsx): `src/components/Sidebar.tsx`

### Crewmate pages

- [Home page](https://github.com/RedWARd42/Crewmates/blob/main/src/pages/Home.tsx): `src/pages/Home.tsx`
- [Create crewmate](https://github.com/RedWARd42/Crewmates/blob/main/src/pages/Create.tsx): `src/pages/Create.tsx`
- [Crew gallery](https://github.com/RedWARd42/Crewmates/blob/main/src/pages/Gallery.tsx): `src/pages/Gallery.tsx`
- [Crew details](https://github.com/RedWARd42/Crewmates/blob/main/src/pages/Details.tsx): `src/pages/Details.tsx`
- [Edit and delete](https://github.com/RedWARd42/Crewmates/blob/main/src/pages/Edit.tsx): `src/pages/Edit.tsx`

### Crew presentation

- [Crew card](https://github.com/RedWARd42/Crewmates/blob/main/src/components/Card.tsx): `src/components/Card.tsx`

### Data access

- [Supabase client](https://github.com/RedWARd42/Crewmates/blob/main/src/supabase-client.ts): `src/supabase-client.ts`
- **Supabase service**

### Other components

- **User**

## Connections

- User → App router: uses
- App router → Sidebar links: renders (evidence: `src/App.tsx`)
- App router → Home page: routes to (evidence: `src/App.tsx`)
- App router → Create crewmate: routes to (evidence: `src/App.tsx`)
- App router → Crew gallery: routes to (evidence: `src/App.tsx`)
- App router → Crew details: routes to (evidence: `src/App.tsx`)
- App router → Edit and delete: routes to (evidence: `src/App.tsx`)
- Sidebar links → Home page: links to (evidence: `src/components/Sidebar.tsx`)
- Sidebar links → Create crewmate: links to (evidence: `src/components/Sidebar.tsx`)
- Sidebar links → Crew gallery: links to (evidence: `src/components/Sidebar.tsx`)
- Home page → Create crewmate: links to (evidence: `src/pages/Home.tsx`)
- Create crewmate → Supabase client: reads and inserts (evidence: `src/pages/Create.tsx`)
- Crew gallery → Supabase client: reads crew (evidence: `src/pages/Gallery.tsx`)
- Crew gallery → Crew card: renders (evidence: `src/pages/Gallery.tsx`)
- Crew card → Crew details: links to (evidence: `src/components/Card.tsx`)
- Crew card → Edit and delete: links to (evidence: `src/components/Card.tsx`)
- Crew details → Supabase client: reads crew (evidence: `src/pages/Details.tsx`)
- Crew details → Edit and delete: links to (evidence: `src/pages/Details.tsx`)
- Edit and delete → Supabase client: reads and mutates (evidence: `src/pages/Edit.tsx`)
- Supabase client → Supabase service: connects to
