# rockbenben/chatgpt-shortcut architecture

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

- Interactive diagram: https://gitdiagram.com/rockbenben/chatgpt-shortcut
- Repository: https://github.com/rockbenben/chatgpt-shortcut

## Overview

AiShort is a multilingual AI-prompt discovery and management application. A visitor searches or browses prompts, copies one for use in an external AI tool, and—after login—can organize a collection, manage custom prompts, or participate in community sharing and discussion. The graph preserves those documented product branches and the sampled authentication, API, and collection layers. Some UI-to-service wiring and several documented capabilities were not sampled; those links are shown only where the README or source index supports them.

Main entry points: [`src/api`](https://github.com/rockbenben/chatgpt-shortcut/tree/main/src/api) (Application APIs), [`src/api/client.ts`](https://github.com/rockbenben/chatgpt-shortcut/blob/main/src/api/client.ts) (HTTP client), [`src/components/HomePage.tsx`](https://github.com/rockbenben/chatgpt-shortcut/blob/main/src/components/HomePage.tsx) (Prompt home), [`src/components/SearchBar/index.tsx`](https://github.com/rockbenben/chatgpt-shortcut/blob/main/src/components/SearchBar/index.tsx) (Tag and keyword search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Prompt discovery"]
  node_home["Prompt home<br/>[HomePage.tsx]"]
  node_search["Tag and keyword search<br/>[index.tsx]"]
  node_prompt_cards["Prompt cards<br/>[Base.tsx]"]
  node_copy["One-click copy"]
end

subgraph group_identity["Accounts and collection"]
  node_auth_ui["Login interface<br/>[login.tsx]"]
  node_auth_context["Authentication state<br/>[AuthContext.tsx]"]
  node_auth_api["Authentication APIs<br/>[auth.ts]"]
  node_myspace["My Collection<br/>[MySpace.tsx]"]
  node_space_items["Collection items<br/>[useSpaceItems.ts]"]
  node_tag_manager["Custom tag manager"]
  node_user_prompts["Custom prompts<br/>[useUserPrompt.tsx]"]
  node_export["Data import and export"]
end

subgraph group_community["Community features"]
  node_community_pages["Community browsing"]
  node_favorite_hook["Favorites and votes<br/>[useFavorite.tsx]"]
  node_comments["Comments and replies"]
end

subgraph group_platform["Shared platform"]
  node_api["Application APIs"]
  node_api_client["HTTP client<br/>[client.ts]"]
  node_session_cache["Session cache<br/>[sessionCache.ts]"]
end

node_visitor(("Visitor"))
node_ai_tool(("AI tool"))
node_backend{{"Strapi API"}}

node_visitor -->|"browses"| node_home
node_home -->|"finds prompts"| node_search
node_search -->|"filters prompts"| node_prompt_cards
node_prompt_cards -->|"copies prompt"| node_copy
node_copy -->|"pastes into"| node_ai_tool
node_visitor -->|"signs in"| node_auth_ui
node_auth_ui -.->|"establishes session"| node_auth_context
node_auth_context -->|"loads account data"| node_api
node_auth_api -->|"sends auth requests"| node_api_client
node_api_client -->|"clears on 401"| node_session_cache
node_visitor -->|"organizes collection"| node_myspace
node_myspace -.->|"manages items"| node_space_items
node_space_items -.->|"assigns custom tags"| node_tag_manager
node_visitor -->|"creates prompts"| node_user_prompts
node_user_prompts -->|"submits changes"| node_api
node_visitor -->|"exports data"| node_export
node_visitor -->|"discovers shared prompts"| node_community_pages
node_community_pages -.->|"votes and favorites"| node_favorite_hook
node_favorite_hook -->|"patches favorites"| node_api
node_visitor -->|"discusses prompts"| node_comments
node_comments -->|"polls for replies"| node_api
node_api -.->|"uses HTTP client"| node_api_client
node_api_client -->|"requests API"| node_backend
node_visitor -->|"chooses language"| node_home

click node_home "https://github.com/rockbenben/chatgpt-shortcut/blob/main/src/components/HomePage.tsx"
click node_search "https://github.com/rockbenben/chatgpt-shortcut/blob/main/src/components/SearchBar/index.tsx"
click node_prompt_cards "https://github.com/rockbenben/chatgpt-shortcut/blob/main/src/components/PromptCard/Base.tsx"
click node_copy "https://github.com/rockbenben/chatgpt-shortcut/blob/main/src/hooks/useCopyToClipboard.ts"
click node_auth_ui "https://github.com/rockbenben/chatgpt-shortcut/blob/main/src/components/user/login.tsx"
click node_auth_context "https://github.com/rockbenben/chatgpt-shortcut/blob/main/src/components/AuthContext.tsx"
click node_auth_api "https://github.com/rockbenben/chatgpt-shortcut/blob/main/src/api/auth.ts"
click node_myspace "https://github.com/rockbenben/chatgpt-shortcut/blob/main/src/components/user/MySpace.tsx"
click node_space_items "https://github.com/rockbenben/chatgpt-shortcut/blob/main/src/components/user/myspace/useSpaceItems.ts"
click node_tag_manager "https://github.com/rockbenben/chatgpt-shortcut/blob/main/src/components/user/myspace/TagManagerModal.tsx"
click node_user_prompts "https://github.com/rockbenben/chatgpt-shortcut/blob/main/src/hooks/useUserPrompt.tsx"
click node_export "https://github.com/rockbenben/chatgpt-shortcut/blob/main/src/components/user/account/useImportExport.tsx"
click node_community_pages "https://github.com/rockbenben/chatgpt-shortcut/blob/main/src/pages/community-prompts.tsx"
click node_favorite_hook "https://github.com/rockbenben/chatgpt-shortcut/blob/main/src/hooks/useFavorite.tsx"
click node_comments "https://github.com/rockbenben/chatgpt-shortcut/blob/main/src/components/CommentComponent/usePollForAIReply.ts"
click node_api "https://github.com/rockbenben/chatgpt-shortcut/tree/main/src/api"
click node_api_client "https://github.com/rockbenben/chatgpt-shortcut/blob/main/src/api/client.ts"
click node_session_cache "https://github.com/rockbenben/chatgpt-shortcut/blob/main/src/api/sessionCache.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_home,node_search,node_prompt_cards,node_copy toneBlue
class node_auth_ui,node_auth_context,node_auth_api,node_myspace,node_space_items,node_tag_manager,node_user_prompts,node_export toneAmber
class node_community_pages,node_favorite_hook,node_comments,node_backend toneMint
class node_api,node_api_client,node_session_cache toneRose
class node_visitor,node_ai_tool toneIndigo
```

## Components

### Prompt discovery

- [Prompt home](https://github.com/rockbenben/chatgpt-shortcut/blob/main/src/components/HomePage.tsx): `src/components/HomePage.tsx`
- [Tag and keyword search](https://github.com/rockbenben/chatgpt-shortcut/blob/main/src/components/SearchBar/index.tsx): `src/components/SearchBar/index.tsx`
- [Prompt cards](https://github.com/rockbenben/chatgpt-shortcut/blob/main/src/components/PromptCard/Base.tsx): `src/components/PromptCard/Base.tsx`
- [One-click copy](https://github.com/rockbenben/chatgpt-shortcut/blob/main/src/hooks/useCopyToClipboard.ts): `src/hooks/useCopyToClipboard.ts`

### Accounts and collection

- [Login interface](https://github.com/rockbenben/chatgpt-shortcut/blob/main/src/components/user/login.tsx): `src/components/user/login.tsx`
- [Authentication state](https://github.com/rockbenben/chatgpt-shortcut/blob/main/src/components/AuthContext.tsx): `src/components/AuthContext.tsx`
- [Authentication APIs](https://github.com/rockbenben/chatgpt-shortcut/blob/main/src/api/auth.ts): `src/api/auth.ts`
- [My Collection](https://github.com/rockbenben/chatgpt-shortcut/blob/main/src/components/user/MySpace.tsx): `src/components/user/MySpace.tsx`
- [Collection items](https://github.com/rockbenben/chatgpt-shortcut/blob/main/src/components/user/myspace/useSpaceItems.ts): `src/components/user/myspace/useSpaceItems.ts`
- [Custom tag manager](https://github.com/rockbenben/chatgpt-shortcut/blob/main/src/components/user/myspace/TagManagerModal.tsx): `src/components/user/myspace/TagManagerModal.tsx`
- [Custom prompts](https://github.com/rockbenben/chatgpt-shortcut/blob/main/src/hooks/useUserPrompt.tsx): `src/hooks/useUserPrompt.tsx`
- [Data import and export](https://github.com/rockbenben/chatgpt-shortcut/blob/main/src/components/user/account/useImportExport.tsx): `src/components/user/account/useImportExport.tsx`

### Community features

- [Community browsing](https://github.com/rockbenben/chatgpt-shortcut/blob/main/src/pages/community-prompts.tsx): `src/pages/community-prompts.tsx`
- [Favorites and votes](https://github.com/rockbenben/chatgpt-shortcut/blob/main/src/hooks/useFavorite.tsx): `src/hooks/useFavorite.tsx`
- [Comments and replies](https://github.com/rockbenben/chatgpt-shortcut/blob/main/src/components/CommentComponent/usePollForAIReply.ts): `src/components/CommentComponent/usePollForAIReply.ts`

### Shared platform

- [Application APIs](https://github.com/rockbenben/chatgpt-shortcut/tree/main/src/api): `src/api`
- [HTTP client](https://github.com/rockbenben/chatgpt-shortcut/blob/main/src/api/client.ts): `src/api/client.ts`
- [Session cache](https://github.com/rockbenben/chatgpt-shortcut/blob/main/src/api/sessionCache.ts): `src/api/sessionCache.ts`

### Other components

- **Visitor**
- **AI tool**
- **Strapi API**

## Connections

- Visitor → Prompt home: browses (evidence: `README.md`)
- Prompt home → Tag and keyword search: finds prompts (evidence: `README.md`)
- Tag and keyword search → Prompt cards: filters prompts (evidence: `README.md`)
- Prompt cards → One-click copy: copies prompt (evidence: `README.md`)
- One-click copy → AI tool: pastes into (evidence: `README.md`)
- Visitor → Login interface: signs in (evidence: `README.md`)
- Login interface → Authentication state: establishes session
- Authentication state → Application APIs: loads account data (evidence: `src/components/AuthContext.tsx`)
- Authentication APIs → HTTP client: sends auth requests (evidence: `src/api/auth.ts`)
- HTTP client → Session cache: clears on 401 (evidence: `src/api/client.ts`)
- Visitor → My Collection: organizes collection (evidence: `README.md`)
- My Collection → Collection items: manages items
- Collection items → Custom tag manager: assigns custom tags
- Visitor → Custom prompts: creates prompts (evidence: `README.md`)
- Custom prompts → Application APIs: submits changes (evidence: `src/hooks/useUserPrompt.tsx`)
- Visitor → Data import and export: exports data (evidence: `README.md`)
- Visitor → Community browsing: discovers shared prompts (evidence: `README.md`)
- Community browsing → Favorites and votes: votes and favorites
- Favorites and votes → Application APIs: patches favorites (evidence: `src/hooks/useFavorite.tsx`)
- Visitor → Comments and replies: discusses prompts (evidence: `README.md`)
- Comments and replies → Application APIs: polls for replies (evidence: `src/components/CommentComponent/usePollForAIReply.ts`)
- Application APIs → HTTP client: uses HTTP client (evidence: `src/api/auth.ts`)
- HTTP client → Strapi API: requests API (evidence: `src/api/client.ts`)
- Visitor → Prompt home: chooses language (evidence: `README.md`)
