# samou2/codealpha_personal_portfolio_crypto_locking_smart_contract architecture

> Architecture diagram of the GitHub repository samou2/codealpha_personal_portfolio_crypto_locking_smart_contract, 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/samou2/codealpha_personal_portfolio_crypto_locking_smart_contract
- Repository: https://github.com/samou2/codealpha_personal_portfolio_crypto_locking_smart_contract

## Overview

This repository describes an ETH time-locking product: a user connects a wallet through a React DApp, deposits ETH with a lock duration, and withdraws after the unlock time. The README documents the contract’s deposit records, time check, withdrawal, and safety behavior, plus a Sepolia/MetaMask deployment path. The file tree does not expose the documented `src/` or `contracts/` sources (the contract is mentioned as being supplied in an archive), so implementation paths and internal call wiring cannot be verified; the graph reflects documented relationships only.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dapp["DApp"]
  node_dapp["React DApp"]
end

subgraph group_contract["Locking contract"]
  node_deposit["ETH deposit"]
  node_records[("Deposit records")]
  node_lockcheck["Unlock-time check"]
  node_withdraw["Withdrawal"]
  node_directreject["Direct-send rejection"]
end

node_user(("Wallet user"))
node_wallet["MetaMask wallet"]
node_sepolia{{"Sepolia network"}}
node_eth[("ETH balance")]

node_user -->|"uses"| node_dapp
node_user -->|"connects"| node_wallet
node_dapp -->|"uses contract on"| node_sepolia
node_wallet -->|"injects provider"| node_sepolia
node_dapp -->|"requests deposit"| node_deposit
node_dapp -->|"requests withdrawal"| node_withdraw
node_deposit -->|"stores amount and time"| node_records
node_deposit -->|"receives ETH"| node_eth
node_withdraw -->|"checks unlock time"| node_lockcheck
node_lockcheck -->|"releases after expiry"| node_eth
node_directreject -->|"rejects direct sends"| node_eth

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_dapp,node_user toneBlue
class node_deposit,node_records,node_lockcheck,node_withdraw,node_directreject,node_eth toneAmber
class node_wallet,node_sepolia toneIndigo
```

## Components

### DApp

- **React DApp**

### Locking contract

- **ETH deposit**
- **Deposit records**
- **Unlock-time check**
- **Withdrawal**
- **Direct-send rejection**

### Other components

- **Wallet user**
- **MetaMask wallet**
- **Sepolia network**
- **ETH balance**

## Connections

- Wallet user → React DApp: uses (evidence: `README.md`)
- Wallet user → MetaMask wallet: connects (evidence: `README.md`)
- React DApp → Sepolia network: uses contract on (evidence: `README.md`)
- MetaMask wallet → Sepolia network: injects provider (evidence: `README.md`)
- React DApp → ETH deposit: requests deposit (evidence: `README.md`)
- React DApp → Withdrawal: requests withdrawal (evidence: `README.md`)
- ETH deposit → Deposit records: stores amount and time (evidence: `README.md`)
- ETH deposit → ETH balance: receives ETH (evidence: `README.md`)
- Withdrawal → Unlock-time check: checks unlock time (evidence: `README.md`)
- Unlock-time check → ETH balance: releases after expiry (evidence: `README.md`)
- Direct-send rejection → ETH balance: rejects direct sends (evidence: `README.md`)
