# david-laugh/gomgomi architecture

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

- Interactive diagram: https://gitdiagram.com/david-laugh/gomgomi
- Repository: https://github.com/david-laugh/gomgomi

## Overview

Gomgomi is a React Native mobile app for emotionally supportive AI chat, with account management, text chat, voice input/output, and emotion-related user status. The main workflow is login, enter the authenticated app, choose a chat mode, and send text or recorded audio to the service; profile management is a separate branch. The sampled code shows context-based account/API handling and a voice upload path. Other screen internals and the backend are not fully sampled, so those links rely only on documented capabilities or indexed imports.

Main entry points: [`src/navigations/MainTab.js`](https://github.com/david-laugh/gomgomi/blob/master/src/navigations/MainTab.js) (Main tabs), [`src/components`](https://github.com/david-laugh/gomgomi/tree/master/src/components) (Shared interface components), [`src/App.js`](https://github.com/david-laugh/gomgomi/blob/master/src/App.js) (App bootstrap), [`src/contexts/User.js`](https://github.com/david-laugh/gomgomi/blob/master/src/contexts/User.js) (User and chat state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and navigation"]
  node_app["App bootstrap<br/>[App.js]"]
  node_navigation["Auth routing<br/>[index.js]"]
  node_authnav["Login navigation<br/>[AuthStack.js]"]
  node_mainnav["Main navigation<br/>[MainStack.js]"]
  node_tabs["Main tabs<br/>[MainTab.js]"]
end

subgraph group_account["Account and profile"]
  node_login["Login<br/>[Login.js]"]
  node_signup["Signup<br/>[Signup.js]"]
  node_profile["Profile<br/>[Profile.js]"]
  node_profileform["Profile editor<br/>[ProfileForm.js]"]
end

subgraph group_conversation["Conversation"]
  node_home["Home<br/>[Home.js]"]
  node_textchat["Text chat<br/>[ChatRoom.js]"]
  node_talkchat["Chat talk<br/>[ChatTalk.js]"]
  node_voicechat["Voice chat<br/>[ChatCall.js]"]
  node_voicecapture["Voice capture and playback<br/>[ChatCallRoom.js]"]
end

subgraph group_shared["Shared runtime"]
  node_userstate["User and chat state<br/>[User.js]"]
  node_progress["Progress state<br/>[Progress.js]"]
  node_api["REST API client<br/>[api.js]"]
  node_chatui["Chat message UI"]
  node_toolbar["Chat input toolbar<br/>[InputToolbar.js]"]
  node_components["Shared interface components"]
  node_theme["Visual theme<br/>[theme.js]"]
end

node_user(("Mobile user"))
node_backend["Gomgomi service"]

node_user -->|"opens app"| node_app
node_app -->|"renders"| node_navigation
node_app -->|"provides state"| node_userstate
node_app -->|"provides state"| node_progress
node_navigation -->|"shows when logged out"| node_authnav
node_navigation -->|"shows when authenticated"| node_mainnav
node_authnav -->|"routes to"| node_login
node_authnav -->|"routes to"| node_signup
node_mainnav -->|"includes"| node_tabs
node_tabs -->|"routes to"| node_home
node_tabs -->|"routes to"| node_textchat
node_tabs -->|"routes to"| node_talkchat
node_tabs -->|"routes to"| node_voicechat
node_tabs -->|"routes to"| node_profile
node_login -->|"authenticates through"| node_userstate
node_signup -->|"uses form"| node_profileform
node_profile -->|"opens editor"| node_profileform
node_userstate -->|"requests account and chat data"| node_api
node_api -->|"sends REST requests"| node_backend
node_voicecapture -->|"uploads recorded audio"| node_backend
node_voicecapture -->|"reads user token"| node_userstate
node_textchat -->|"uses message display"| node_chatui
node_textchat -->|"uses input toolbar"| node_toolbar
node_home -->|"uses interface elements"| node_components
node_login -->|"uses interface elements"| node_components
node_profile -->|"uses interface elements"| node_components
node_profileform -->|"uses interface elements"| node_components
node_components -->|"uses styling"| node_theme
node_backend -.->|"returns chat and emotion responses"| node_user
node_voicecapture -.->|"records and plays audio"| node_user

click node_app "https://github.com/david-laugh/gomgomi/blob/master/src/App.js"
click node_navigation "https://github.com/david-laugh/gomgomi/blob/master/src/navigations/index.js"
click node_authnav "https://github.com/david-laugh/gomgomi/blob/master/src/navigations/AuthStack.js"
click node_mainnav "https://github.com/david-laugh/gomgomi/blob/master/src/navigations/MainStack.js"
click node_tabs "https://github.com/david-laugh/gomgomi/blob/master/src/navigations/MainTab.js"
click node_login "https://github.com/david-laugh/gomgomi/blob/master/src/screens/Login.js"
click node_signup "https://github.com/david-laugh/gomgomi/blob/master/src/screens/Signup.js"
click node_home "https://github.com/david-laugh/gomgomi/blob/master/src/screens/Home.js"
click node_textchat "https://github.com/david-laugh/gomgomi/blob/master/src/screens/ChatRoom.js"
click node_talkchat "https://github.com/david-laugh/gomgomi/blob/master/src/screens/ChatTalk.js"
click node_voicechat "https://github.com/david-laugh/gomgomi/blob/master/src/screens/ChatCall.js"
click node_voicecapture "https://github.com/david-laugh/gomgomi/blob/master/src/screens/ChatCallRoom.js"
click node_profile "https://github.com/david-laugh/gomgomi/blob/master/src/screens/Profile.js"
click node_profileform "https://github.com/david-laugh/gomgomi/blob/master/src/screens/ProfileForm.js"
click node_userstate "https://github.com/david-laugh/gomgomi/blob/master/src/contexts/User.js"
click node_progress "https://github.com/david-laugh/gomgomi/blob/master/src/contexts/Progress.js"
click node_api "https://github.com/david-laugh/gomgomi/blob/master/src/utils/api.js"
click node_chatui "https://github.com/david-laugh/gomgomi/blob/master/src/components/MessageContainer.js"
click node_toolbar "https://github.com/david-laugh/gomgomi/blob/master/src/utils/InputToolbar.js"
click node_components "https://github.com/david-laugh/gomgomi/tree/master/src/components"
click node_theme "https://github.com/david-laugh/gomgomi/blob/master/src/theme.js"

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_navigation,node_authnav,node_mainnav,node_tabs,node_user toneBlue
class node_login,node_signup,node_profile,node_profileform toneAmber
class node_home,node_textchat,node_talkchat,node_voicechat,node_voicecapture toneMint
class node_userstate,node_progress,node_api,node_chatui,node_toolbar,node_components,node_theme toneRose
class node_backend toneIndigo
```

## Components

### App and navigation

- [App bootstrap](https://github.com/david-laugh/gomgomi/blob/master/src/App.js): `src/App.js`
- [Auth routing](https://github.com/david-laugh/gomgomi/blob/master/src/navigations/index.js): `src/navigations/index.js`
- [Login navigation](https://github.com/david-laugh/gomgomi/blob/master/src/navigations/AuthStack.js): `src/navigations/AuthStack.js`
- [Main navigation](https://github.com/david-laugh/gomgomi/blob/master/src/navigations/MainStack.js): `src/navigations/MainStack.js`
- [Main tabs](https://github.com/david-laugh/gomgomi/blob/master/src/navigations/MainTab.js): `src/navigations/MainTab.js`

### Account and profile

- [Login](https://github.com/david-laugh/gomgomi/blob/master/src/screens/Login.js): `src/screens/Login.js`
- [Signup](https://github.com/david-laugh/gomgomi/blob/master/src/screens/Signup.js): `src/screens/Signup.js`
- [Profile](https://github.com/david-laugh/gomgomi/blob/master/src/screens/Profile.js): `src/screens/Profile.js`
- [Profile editor](https://github.com/david-laugh/gomgomi/blob/master/src/screens/ProfileForm.js): `src/screens/ProfileForm.js`

### Conversation

- [Home](https://github.com/david-laugh/gomgomi/blob/master/src/screens/Home.js): `src/screens/Home.js`
- [Text chat](https://github.com/david-laugh/gomgomi/blob/master/src/screens/ChatRoom.js): `src/screens/ChatRoom.js`
- [Chat talk](https://github.com/david-laugh/gomgomi/blob/master/src/screens/ChatTalk.js): `src/screens/ChatTalk.js`
- [Voice chat](https://github.com/david-laugh/gomgomi/blob/master/src/screens/ChatCall.js): `src/screens/ChatCall.js`
- [Voice capture and playback](https://github.com/david-laugh/gomgomi/blob/master/src/screens/ChatCallRoom.js): `src/screens/ChatCallRoom.js`

### Shared runtime

- [User and chat state](https://github.com/david-laugh/gomgomi/blob/master/src/contexts/User.js): `src/contexts/User.js`
- [Progress state](https://github.com/david-laugh/gomgomi/blob/master/src/contexts/Progress.js): `src/contexts/Progress.js`
- [REST API client](https://github.com/david-laugh/gomgomi/blob/master/src/utils/api.js): `src/utils/api.js`
- [Chat message UI](https://github.com/david-laugh/gomgomi/blob/master/src/components/MessageContainer.js): `src/components/MessageContainer.js`
- [Chat input toolbar](https://github.com/david-laugh/gomgomi/blob/master/src/utils/InputToolbar.js): `src/utils/InputToolbar.js`
- [Shared interface components](https://github.com/david-laugh/gomgomi/tree/master/src/components): `src/components`
- [Visual theme](https://github.com/david-laugh/gomgomi/blob/master/src/theme.js): `src/theme.js`

### Other components

- **Mobile user**
- **Gomgomi service**

## Connections

- Mobile user → App bootstrap: opens app (evidence: `README.md`)
- App bootstrap → Auth routing: renders (evidence: `src/App.js`)
- App bootstrap → User and chat state: provides state (evidence: `src/App.js`)
- App bootstrap → Progress state: provides state (evidence: `src/App.js`)
- Auth routing → Login navigation: shows when logged out (evidence: `src/navigations/index.js`)
- Auth routing → Main navigation: shows when authenticated (evidence: `src/navigations/index.js`)
- Login navigation → Login: routes to (evidence: `src/navigations/AuthStack.js`)
- Login navigation → Signup: routes to (evidence: `src/navigations/AuthStack.js`)
- Main navigation → Main tabs: includes (evidence: `src/navigations/MainStack.js`)
- Main tabs → Home: routes to (evidence: `src/navigations/MainTab.js`)
- Main tabs → Text chat: routes to (evidence: `src/navigations/MainTab.js`)
- Main tabs → Chat talk: routes to (evidence: `src/navigations/MainTab.js`)
- Main tabs → Voice chat: routes to (evidence: `src/navigations/MainTab.js`)
- Main tabs → Profile: routes to (evidence: `src/navigations/MainTab.js`)
- Login → User and chat state: authenticates through (evidence: `src/screens/Login.js`)
- Signup → Profile editor: uses form (evidence: `src/screens/Signup.js`)
- Profile → Profile editor: opens editor
- User and chat state → REST API client: requests account and chat data (evidence: `src/contexts/User.js`)
- REST API client → Gomgomi service: sends REST requests (evidence: `src/utils/api.js`)
- Voice capture and playback → Gomgomi service: uploads recorded audio (evidence: `src/screens/ChatCallRoom.js`)
- Voice capture and playback → User and chat state: reads user token (evidence: `src/screens/ChatCallRoom.js`)
- Text chat → Chat message UI: uses message display (evidence: `src/screens/ChatRoom.js`)
- Text chat → Chat input toolbar: uses input toolbar (evidence: `src/screens/ChatRoom.js`)
- Home → Shared interface components: uses interface elements (evidence: `src/screens/Home.js`)
- Login → Shared interface components: uses interface elements (evidence: `src/screens/Login.js`)
- Profile → Shared interface components: uses interface elements (evidence: `src/screens/Profile.js`)
- Profile editor → Shared interface components: uses interface elements (evidence: `src/screens/ProfileForm.js`)
- Shared interface components → Visual theme: uses styling (evidence: `src/components/Accordian.js`)
- Gomgomi service → Mobile user: returns chat and emotion responses (evidence: `README.md`)
- Voice capture and playback → Mobile user: records and plays audio (evidence: `README.md`)
