# vamamurin/remotepcviagmail architecture

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

- Interactive diagram: https://gitdiagram.com/vamamurin/remotepcviagmail
- Repository: https://github.com/vamamurin/remotepcviagmail

## Overview

This is a Gmail-controlled Windows computer utility. Its main workflow polls Gmail for a new message, extracts the sender and command, dispatches the command to local system actions, and sends results back by email; a Qt window also exposes command actions. The sampled server and helper excerpts establish the polling, dispatch, several action-to-result paths, and email sending. OAuth setup and some GUI/action wiring are represented from repository references or documented interfaces, so uncertain links are omitted or dashed.

Main entry points: [`commandHelper/commandHelper.cpp`](https://github.com/vamamurin/remotepcviagmail/blob/main/commandHelper/commandHelper.cpp) (Command dispatcher), [`Source/Server.cpp`](https://github.com/vamamurin/remotepcviagmail/blob/main/Source/Server.cpp) (Mail command loop), [`gmailSender/gmailSender.cpp`](https://github.com/vamamurin/remotepcviagmail/blob/main/gmailSender/gmailSender.cpp) (Email creation and sending), [`base64_encode/base64_encode.cpp`](https://github.com/vamamurin/remotepcviagmail/blob/main/base64_encode/base64_encode.cpp) (Image encoding)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Control and setup"]
  node_server["Mail command loop<br/>[Server.cpp]"]
  node_oauth["OAuth setup<br/>[__inIt__.cpp]"]
  node_gui["Qt command window<br/>[MainWindow.cpp]"]
end

subgraph group_actions["Computer actions"]
  node_dispatch["Command dispatcher<br/>[commandHelper.cpp]"]
  node_system["System commands<br/>[commandHelper.cpp]"]
  node_network["Network details<br/>[ipconfig.cpp]"]
  node_files["File operations<br/>[getfile.cpp]"]
  node_delete["File deletion<br/>[deletefile.cpp]"]
  node_screen["Screen capture<br/>[screencapture.cpp]"]
  node_webcam["Webcam capture<br/>[webcam.cpp]"]
end

subgraph group_mail["Gmail messaging"]
  node_gmail{{"Gmail API"}}
  node_messaging["Email creation and sending<br/>[gmailSender.cpp]"]
end

subgraph group_support["Shared support"]
  node_encoding["Image encoding<br/>[base64_encode.cpp]"]
  node_callback["HTTP callbacks<br/>[callBack.cpp]"]
  node_json["JSON parsing<br/>[json.hpp]"]
  node_base64["Base64 codec<br/>[base64.hpp]"]
end

node_user(("Computer user"))

node_user -.->|"sends commands"| node_gmail
node_server -->|"polls messages"| node_gmail
node_server -->|"loads credentials"| node_oauth
node_server -->|"parses responses"| node_json
node_server -->|"dispatches commands"| node_dispatch
node_server -->|"reads sender"| node_messaging
node_dispatch -->|"runs commands"| node_system
node_dispatch -->|"runs network query"| node_network
node_dispatch -->|"retrieves files"| node_files
node_dispatch -->|"deletes files"| node_delete
node_dispatch -->|"captures screen"| node_screen
node_dispatch -->|"records video"| node_webcam
node_dispatch -->|"sends results"| node_messaging
node_gui -.->|"invokes actions"| node_dispatch
node_messaging -->|"sends email"| node_gmail
node_messaging -->|"encodes attachments"| node_encoding
node_messaging -->|"uses callbacks"| node_callback
node_encoding -.->|"encodes bytes"| node_base64

click node_server "https://github.com/vamamurin/remotepcviagmail/blob/main/Source/Server.cpp"
click node_oauth "https://github.com/vamamurin/remotepcviagmail/blob/main/Source/__inIt__.cpp"
click node_gui "https://github.com/vamamurin/remotepcviagmail/blob/main/GUI/MainWindow.cpp"
click node_dispatch "https://github.com/vamamurin/remotepcviagmail/blob/main/commandHelper/commandHelper.cpp"
click node_system "https://github.com/vamamurin/remotepcviagmail/blob/main/commandHelper/commandHelper.cpp"
click node_network "https://github.com/vamamurin/remotepcviagmail/blob/main/commandHelper/ipconfig.cpp"
click node_files "https://github.com/vamamurin/remotepcviagmail/blob/main/commandHelper/getfile.cpp"
click node_delete "https://github.com/vamamurin/remotepcviagmail/blob/main/commandHelper/deletefile.cpp"
click node_screen "https://github.com/vamamurin/remotepcviagmail/blob/main/commandHelper/screencapture.cpp"
click node_webcam "https://github.com/vamamurin/remotepcviagmail/blob/main/commandHelper/webcam.cpp"
click node_messaging "https://github.com/vamamurin/remotepcviagmail/blob/main/gmailSender/gmailSender.cpp"
click node_encoding "https://github.com/vamamurin/remotepcviagmail/blob/main/base64_encode/base64_encode.cpp"
click node_callback "https://github.com/vamamurin/remotepcviagmail/blob/main/callBack/callBack.cpp"
click node_json "https://github.com/vamamurin/remotepcviagmail/blob/main/include/json.hpp"
click node_base64 "https://github.com/vamamurin/remotepcviagmail/blob/main/include/base64.hpp"

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_server,node_oauth,node_gui,node_user toneBlue
class node_dispatch,node_system,node_network,node_files,node_delete,node_screen,node_webcam toneAmber
class node_gmail,node_messaging toneMint
class node_encoding,node_callback,node_json,node_base64 toneRose
```

## Components

### Control and setup

- [Mail command loop](https://github.com/vamamurin/remotepcviagmail/blob/main/Source/Server.cpp): `Source/Server.cpp`
- [OAuth setup](https://github.com/vamamurin/remotepcviagmail/blob/main/Source/__inIt__.cpp): `Source/__inIt__.cpp`
- [Qt command window](https://github.com/vamamurin/remotepcviagmail/blob/main/GUI/MainWindow.cpp): `GUI/MainWindow.cpp`

### Computer actions

- [Command dispatcher](https://github.com/vamamurin/remotepcviagmail/blob/main/commandHelper/commandHelper.cpp): `commandHelper/commandHelper.cpp`
- [System commands](https://github.com/vamamurin/remotepcviagmail/blob/main/commandHelper/commandHelper.cpp): `commandHelper/commandHelper.cpp`
- [Network details](https://github.com/vamamurin/remotepcviagmail/blob/main/commandHelper/ipconfig.cpp): `commandHelper/ipconfig.cpp`
- [File operations](https://github.com/vamamurin/remotepcviagmail/blob/main/commandHelper/getfile.cpp): `commandHelper/getfile.cpp`
- [File deletion](https://github.com/vamamurin/remotepcviagmail/blob/main/commandHelper/deletefile.cpp): `commandHelper/deletefile.cpp`
- [Screen capture](https://github.com/vamamurin/remotepcviagmail/blob/main/commandHelper/screencapture.cpp): `commandHelper/screencapture.cpp`
- [Webcam capture](https://github.com/vamamurin/remotepcviagmail/blob/main/commandHelper/webcam.cpp): `commandHelper/webcam.cpp`

### Gmail messaging

- **Gmail API**
- [Email creation and sending](https://github.com/vamamurin/remotepcviagmail/blob/main/gmailSender/gmailSender.cpp): `gmailSender/gmailSender.cpp`

### Shared support

- [Image encoding](https://github.com/vamamurin/remotepcviagmail/blob/main/base64_encode/base64_encode.cpp): `base64_encode/base64_encode.cpp`
- [HTTP callbacks](https://github.com/vamamurin/remotepcviagmail/blob/main/callBack/callBack.cpp): `callBack/callBack.cpp`
- [JSON parsing](https://github.com/vamamurin/remotepcviagmail/blob/main/include/json.hpp): `include/json.hpp`
- [Base64 codec](https://github.com/vamamurin/remotepcviagmail/blob/main/include/base64.hpp): `include/base64.hpp`

### Other components

- **Computer user**

## Connections

- Computer user → Gmail API: sends commands (evidence: `README.md`)
- Mail command loop → Gmail API: polls messages (evidence: `Source/Server.cpp`)
- Mail command loop → OAuth setup: loads credentials (evidence: `Source/Server.cpp`)
- Mail command loop → JSON parsing: parses responses (evidence: `Source/Server.cpp`)
- Mail command loop → Command dispatcher: dispatches commands (evidence: `Source/Server.cpp`)
- Mail command loop → Email creation and sending: reads sender (evidence: `Source/Server.cpp`)
- Command dispatcher → System commands: runs commands (evidence: `commandHelper/commandHelper.cpp`)
- Command dispatcher → Network details: runs network query (evidence: `commandHelper/commandHelper.cpp`)
- Command dispatcher → File operations: retrieves files (evidence: `commandHelper/commandHelper.cpp`)
- Command dispatcher → File deletion: deletes files (evidence: `commandHelper/commandHelper.cpp`)
- Command dispatcher → Screen capture: captures screen (evidence: `commandHelper/commandHelper.cpp`)
- Command dispatcher → Webcam capture: records video (evidence: `commandHelper/commandHelper.cpp`)
- Command dispatcher → Email creation and sending: sends results (evidence: `commandHelper/commandHelper.cpp`)
- Qt command window → Command dispatcher: invokes actions
- Email creation and sending → Gmail API: sends email (evidence: `gmailSender/gmailSender.cpp`)
- Email creation and sending → Image encoding: encodes attachments (evidence: `gmailSender/gmailSender.cpp`)
- Email creation and sending → HTTP callbacks: uses callbacks (evidence: `gmailSender/gmailSender.cpp`)
- Image encoding → Base64 codec: encodes bytes
