How eyucoder/chatgpt-pro works
ChatGPT-Pro is a browser chat UI for OpenAI text and DALL·E generation, with selectable GPT-3.5/GPT-4, conversation history in local storage, and browser-stored API-key settings. The main path is user prompt → ChatView dispatch → text or image generation → message collection/context → rendered chat. The sidebar also clears history and offers theme and key controls. Edges are limited to calls or relationships visible in excerpts and README; unsampled key validation and theme-rendering details are not inferred.
Main entry points: ChatView.jsx Prompt and dispatch · App.jsx Application shell · SideBar.jsx Chat sidebar · chatContext.jsx Shared chat context
Components 20
Chat workflow
- Application shell
src/App.jsx - Prompt and dispatch
src/components/ChatView.jsx
AI generation
- GPT conversation chain
src/utils/davinci.js - OpenAI API
- DALL·E generator
src/utils/dalle.js - Key validation
src/utils/checkKeys.js
State and preferences
- Message collection
src/hooks/useMessageCollection.js - Shared chat context
src/context/chatContext.jsx - Browser local storage
- API key settings
src/components/Setting.jsx - Dark mode state
src/hooks/useDarkMode.js - Preference persistence
src/hooks/useLocalStorage.js
Chat interface
- Message rendering
src/components/Message.jsx - Markdown display
src/components/Markdown.jsx - Generated image display
src/components/Image.jsx - Generation indicator
src/components/Thinking.jsx - Chat sidebar
src/components/SideBar.jsx - Settings dialog
src/components/Modal.jsx - Theme toggle
src/components/ToggleTheme.jsx
Other components
- Chat user
Connections 26
- Chat user → Prompt and dispatch: enters prompt
src/components/ChatView.jsx - Application shell → Prompt and dispatch: renders
src/App.jsx - Application shell → Chat sidebar: renders
src/App.jsx - Application shell → Shared chat context: provides context
src/App.jsx - Shared chat context → Message collection: uses collection
src/context/chatContext.jsx - Message collection → Browser local storage: reads and writes
src/hooks/useMessageCollection.js - Shared chat context → Prompt and dispatch: shares messages
src/components/ChatView.jsx - Prompt and dispatch → GPT conversation chain: calls for GPT
src/components/ChatView.jsx - Prompt and dispatch → DALL·E generator: calls for DALL·E
src/components/ChatView.jsx - GPT conversation chain → OpenAI API: requests completion
src/utils/davinci.js - DALL·E generator → OpenAI API: requests image
README.md - Prompt and dispatch → Message rendering: renders messages
src/components/ChatView.jsx - Message rendering → Markdown display: renders text
src/components/Message.jsx - Message rendering → Generated image display: renders DALL·E
src/components/Message.jsx - Prompt and dispatch → Generation indicator: shows while waiting
src/components/ChatView.jsx - Chat sidebar → Shared chat context: clears chat
src/components/SideBar.jsx - Chat sidebar → Settings dialog: opens settings
src/components/SideBar.jsx - Application shell → Settings dialog: renders settings
src/App.jsx - Settings dialog → API key settings: contains form
src/App.jsx - API key settings → Key validation: checks key
src/components/Setting.jsx - API key settings → Browser local storage: saves key
src/components/Setting.jsx - Prompt and dispatch → Settings dialog: opens missing-key dialog
src/components/ChatView.jsx - Chat sidebar → Theme toggle: renders toggle
src/components/SideBar.jsx - Theme toggle → Dark mode state: uses theme hook
src/components/ToggleTheme.jsx - Dark mode state → Preference persistence: persists theme
src/hooks/useDarkMode.js - Preference persistence → Browser local storage: reads and writes
src/hooks/useLocalStorage.js