# dikay0310/locket-vip architecture

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

- Interactive diagram: https://gitdiagram.com/dikay0310/locket-vip
- Repository: https://github.com/dikay0310/locket-vip

## Overview

This repository contains Locket request/response rewrite scripts for a proxy client, not the Locket app itself. The visible workflow is a client forwarding an app request to a service and the proxy applying a matching rewrite. The excerpts show response-body rewriting for subscription and remote configuration, plus a request-header edit. The large configuration file is partial, so its full set of configured capabilities is not inferable; edges below represent only relationships visible in the supplied excerpts.

Main entry points: [`locket_gold.js`](https://github.com/dikay0310/locket-vip/blob/main/locket_gold.js) (Gold response rewrite), [`deleteheader.js`](https://github.com/dikay0310/locket-vip/blob/main/deleteheader.js) (Header rewrite), [`locket_config.js`](https://github.com/dikay0310/locket-vip/blob/main/locket_config.js) (Remote config rewrite)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_rewrites["Proxy rewrites"]
  node_gold["Gold response rewrite<br/>[locket_gold.js]"]
  node_headers["Header rewrite<br/>[deleteheader.js]"]
end

subgraph group_config["Remote configuration"]
  node_remote_config["Remote config rewrite<br/>[locket_config.js]"]
end

node_client(("Locket client"))
node_service{{"Remote API"}}
node_proxy["Rewrite proxy"]

node_client -->|"sends request"| node_proxy
node_proxy -.->|"forwards request"| node_service
node_proxy -.->|"runs rewrite"| node_headers
node_proxy -.->|"runs rewrite"| node_gold
node_proxy -.->|"runs rewrite"| node_remote_config
node_gold -->|"returns body"| node_proxy
node_remote_config -->|"rewrites body"| node_proxy
node_headers -->|"returns headers"| node_proxy
node_service -.->|"returns response"| node_proxy

click node_gold "https://github.com/dikay0310/locket-vip/blob/main/locket_gold.js"
click node_headers "https://github.com/dikay0310/locket-vip/blob/main/deleteheader.js"
click node_remote_config "https://github.com/dikay0310/locket-vip/blob/main/locket_config.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_gold,node_headers,node_client toneBlue
class node_remote_config toneAmber
class node_service toneMint
class node_proxy toneIndigo
```

## Components

### Proxy rewrites

- [Gold response rewrite](https://github.com/dikay0310/locket-vip/blob/main/locket_gold.js): `locket_gold.js`
- [Header rewrite](https://github.com/dikay0310/locket-vip/blob/main/deleteheader.js): `deleteheader.js`

### Remote configuration

- [Remote config rewrite](https://github.com/dikay0310/locket-vip/blob/main/locket_config.js): `locket_config.js`

### Other components

- **Locket client**
- **Remote API**
- **Rewrite proxy**

## Connections

- Locket client → Rewrite proxy: sends request (evidence: `README.md`)
- Rewrite proxy → Remote API: forwards request
- Rewrite proxy → Header rewrite: runs rewrite
- Rewrite proxy → Gold response rewrite: runs rewrite
- Rewrite proxy → Remote config rewrite: runs rewrite
- Gold response rewrite → Rewrite proxy: returns body (evidence: `locket_gold.js`)
- Remote config rewrite → Rewrite proxy: rewrites body (evidence: `locket_config.js`)
- Header rewrite → Rewrite proxy: returns headers (evidence: `deleteheader.js`)
- Remote API → Rewrite proxy: returns response
