# alex1emc2/mini-dapp-hardhat architecture

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

- Interactive diagram: https://gitdiagram.com/alex1emc2/mini-dapp-hardhat
- Repository: https://github.com/alex1emc2/mini-dapp-hardhat

## Overview

This is a small Hardhat example project with three Solidity contracts, a Voting deployment module, and a script demonstrating an OP-style transaction. The visible runtime path is the deployment module constructing the Voting contract; the script creates a simulated OP network and sends a transaction. Network configuration also defines Sepolia. Contract internals were not sampled, so their behavior and interactions are not inferred. The README describes testing and deployment examples, but test infrastructure is excluded from this runtime view.

Main entry points: [`ignition/modules/Voting.ts`](https://github.com/alex1emc2/mini-dapp-hardhat/blob/main/ignition/modules/Voting.ts) (Voting deploy module), [`hardhat.config.ts`](https://github.com/alex1emc2/mini-dapp-hardhat/blob/main/hardhat.config.ts) (Network configuration), [`scripts/send-op-tx.ts`](https://github.com/alex1emc2/mini-dapp-hardhat/blob/main/scripts/send-op-tx.ts) (OP transaction example), [`contracts/Voting.sol`](https://github.com/alex1emc2/mini-dapp-hardhat/blob/main/contracts/Voting.sol) (Voting)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_contracts["Smart contracts"]
  node_counter["Counter<br/>[Counter.sol]"]
  node_token["Token<br/>[Token.sol]"]
  node_voting["Voting<br/>[Voting.sol]"]
end

subgraph group_deployment["Deployment"]
  node_voting_deploy["Voting deploy module<br/>[Voting.ts]"]
end

subgraph group_networks["Network access"]
  node_network_config["Network configuration<br/>[hardhat.config.ts]"]
  node_op_tx["OP transaction example<br/>[send-op-tx.ts]"]
end

node_op_simulator{{"OP simulator"}}
node_sepolia{{"Sepolia network"}}

node_voting_deploy -->|"deploys"| node_voting
node_op_tx -->|"creates network"| node_op_simulator
node_network_config -->|"configures"| node_sepolia

click node_counter "https://github.com/alex1emc2/mini-dapp-hardhat/blob/main/contracts/Counter.sol"
click node_token "https://github.com/alex1emc2/mini-dapp-hardhat/blob/main/contracts/Token.sol"
click node_voting "https://github.com/alex1emc2/mini-dapp-hardhat/blob/main/contracts/Voting.sol"
click node_voting_deploy "https://github.com/alex1emc2/mini-dapp-hardhat/blob/main/ignition/modules/Voting.ts"
click node_network_config "https://github.com/alex1emc2/mini-dapp-hardhat/blob/main/hardhat.config.ts"
click node_op_tx "https://github.com/alex1emc2/mini-dapp-hardhat/blob/main/scripts/send-op-tx.ts"

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_counter,node_token,node_voting toneBlue
class node_voting_deploy toneAmber
class node_network_config,node_op_tx toneMint
class node_op_simulator,node_sepolia toneIndigo
```

## Components

### Smart contracts

- [Counter](https://github.com/alex1emc2/mini-dapp-hardhat/blob/main/contracts/Counter.sol): `contracts/Counter.sol`
- [Token](https://github.com/alex1emc2/mini-dapp-hardhat/blob/main/contracts/Token.sol): `contracts/Token.sol`
- [Voting](https://github.com/alex1emc2/mini-dapp-hardhat/blob/main/contracts/Voting.sol): `contracts/Voting.sol`

### Deployment

- [Voting deploy module](https://github.com/alex1emc2/mini-dapp-hardhat/blob/main/ignition/modules/Voting.ts): `ignition/modules/Voting.ts`

### Network access

- [Network configuration](https://github.com/alex1emc2/mini-dapp-hardhat/blob/main/hardhat.config.ts): `hardhat.config.ts`
- [OP transaction example](https://github.com/alex1emc2/mini-dapp-hardhat/blob/main/scripts/send-op-tx.ts): `scripts/send-op-tx.ts`

### Other components

- **OP simulator**
- **Sepolia network**

## Connections

- Voting deploy module → Voting: deploys (evidence: `ignition/modules/Voting.ts`)
- OP transaction example → OP simulator: creates network (evidence: `scripts/send-op-tx.ts`)
- Network configuration → Sepolia network: configures (evidence: `hardhat.config.ts`)
