# tomi2107/eth-kipu-front-react architecture

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

- Interactive diagram: https://gitdiagram.com/tomi2107/eth-kipu-front-react
- Repository: https://github.com/tomi2107/eth-kipu-front-react

## Overview

SimpleDEX is a browser-based Ethereum DEX. A user connects a MetaMask wallet, then uses the app to add or remove liquidity, swap tokens, or query a token price through the SimpleDEX contract. The app also initializes an ethers provider and checks the network. The README documents these product capabilities; excerpts confirm wallet/provider and contract setup, but do not show the full operation handlers or Solidity implementation, so those links are documented rather than inferred from unseen code.

Main entry points: [`app.js`](https://github.com/tomi2107/eth-kipu-front-react/blob/main/app.js) (DEX interface and workflow), [`contratos/SimpleDEX_corr.sol`](https://github.com/tomi2107/eth-kipu-front-react/blob/main/contratos/SimpleDEX_corr.sol) (SimpleDEX contract), [`ether.js`](https://github.com/tomi2107/eth-kipu-front-react/blob/main/ether.js) (RPC and gas helper)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["DEX application"]
  node_app["DEX interface and workflow<br/>[app.js]"]
  node_add["Add liquidity<br/>[app.js]"]
  node_remove["Remove liquidity<br/>[app.js]"]
  node_swap["Swap tokens<br/>[app.js]"]
  node_price["Query token price<br/>[app.js]"]
end

subgraph group_contracts["On-chain contracts"]
  node_dex{{"SimpleDEX contract<br/>[SimpleDEX_corr.sol]"}}
  node_tokena{{"Token A contract<br/>[TokenA.sol]"}}
  node_tokenb{{"Token B contract<br/>[TokenB.sol]"}}
end

subgraph group_rpc["RPC access"]
  node_rpc_helper["RPC and gas helper<br/>[ether.js]"]
end

node_user(("User"))
node_wallet["MetaMask wallet"]
node_network[("Ethereum network")]
node_rpc_service["Alchemy RPC service"]

node_user -->|"uses"| node_app
node_app -->|"requests accounts"| node_wallet
node_app -->|"checks network"| node_network
node_app -->|"initializes contract"| node_dex
node_app -->|"offers"| node_add
node_app -->|"offers"| node_remove
node_app -->|"offers"| node_swap
node_app -->|"offers"| node_price
node_add -.->|"calls"| node_dex
node_remove -.->|"calls"| node_dex
node_swap -.->|"calls"| node_dex
node_price -.->|"queries"| node_dex
node_rpc_helper -->|"queries"| node_rpc_service

click node_app "https://github.com/tomi2107/eth-kipu-front-react/blob/main/app.js"
click node_add "https://github.com/tomi2107/eth-kipu-front-react/blob/main/app.js"
click node_remove "https://github.com/tomi2107/eth-kipu-front-react/blob/main/app.js"
click node_swap "https://github.com/tomi2107/eth-kipu-front-react/blob/main/app.js"
click node_price "https://github.com/tomi2107/eth-kipu-front-react/blob/main/app.js"
click node_dex "https://github.com/tomi2107/eth-kipu-front-react/blob/main/contratos/SimpleDEX_corr.sol"
click node_tokena "https://github.com/tomi2107/eth-kipu-front-react/blob/main/contratos/TokenA.sol"
click node_tokenb "https://github.com/tomi2107/eth-kipu-front-react/blob/main/contratos/TokenB.sol"
click node_rpc_helper "https://github.com/tomi2107/eth-kipu-front-react/blob/main/ether.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_add,node_remove,node_swap,node_price,node_user toneBlue
class node_dex,node_tokena,node_tokenb,node_network toneAmber
class node_rpc_helper toneMint
class node_wallet,node_rpc_service toneIndigo
```

## Components

### DEX application

- [DEX interface and workflow](https://github.com/tomi2107/eth-kipu-front-react/blob/main/app.js): `app.js`
- [Add liquidity](https://github.com/tomi2107/eth-kipu-front-react/blob/main/app.js): `app.js`
- [Remove liquidity](https://github.com/tomi2107/eth-kipu-front-react/blob/main/app.js): `app.js`
- [Swap tokens](https://github.com/tomi2107/eth-kipu-front-react/blob/main/app.js): `app.js`
- [Query token price](https://github.com/tomi2107/eth-kipu-front-react/blob/main/app.js): `app.js`

### On-chain contracts

- [SimpleDEX contract](https://github.com/tomi2107/eth-kipu-front-react/blob/main/contratos/SimpleDEX_corr.sol): `contratos/SimpleDEX_corr.sol`
- [Token A contract](https://github.com/tomi2107/eth-kipu-front-react/blob/main/contratos/TokenA.sol): `contratos/TokenA.sol`
- [Token B contract](https://github.com/tomi2107/eth-kipu-front-react/blob/main/contratos/TokenB.sol): `contratos/TokenB.sol`

### RPC access

- [RPC and gas helper](https://github.com/tomi2107/eth-kipu-front-react/blob/main/ether.js): `ether.js`

### Other components

- **User**
- **MetaMask wallet**
- **Ethereum network**
- **Alchemy RPC service**

## Connections

- User → DEX interface and workflow: uses (evidence: `README.md`)
- DEX interface and workflow → MetaMask wallet: requests accounts (evidence: `app.js`)
- DEX interface and workflow → Ethereum network: checks network (evidence: `app.js`)
- DEX interface and workflow → SimpleDEX contract: initializes contract (evidence: `app.js`)
- DEX interface and workflow → Add liquidity: offers (evidence: `README.md`)
- DEX interface and workflow → Remove liquidity: offers (evidence: `README.md`)
- DEX interface and workflow → Swap tokens: offers (evidence: `README.md`)
- DEX interface and workflow → Query token price: offers (evidence: `README.md`)
- Add liquidity → SimpleDEX contract: calls (evidence: `README.md`)
- Remove liquidity → SimpleDEX contract: calls (evidence: `README.md`)
- Swap tokens → SimpleDEX contract: calls (evidence: `README.md`)
- Query token price → SimpleDEX contract: queries (evidence: `README.md`)
- RPC and gas helper → Alchemy RPC service: queries (evidence: `ether.js`)
