# hardiext/wrokchain architecture

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

- Interactive diagram: https://gitdiagram.com/hardiext/wrokchain
- Repository: https://github.com/hardiext/wrokchain

## Overview

Workchain appears to be a Web3 work-agreement application: a client creates and funds a milestone-based project, while workers and clients can view projects and act on agreements and milestone submissions. The sampled creation page submits a contract transaction and parses its ProjectCreated event; the dashboard reads contract state. Other route capabilities and contract interactions are inferred only from the route tree and ABI, so those links are left unverified where source excerpts do not establish them.

Main entry points: [`contracts/WorkChainAgreement.sol`](https://github.com/hardiext/wrokchain/blob/portofolio/contracts/WorkChainAgreement.sol) (Work agreement), [`src/constants/ABI.ts`](https://github.com/hardiext/wrokchain/blob/portofolio/src/constants/ABI.ts) (WorkChain ABI), [`types/ethers-contracts/common.ts`](https://github.com/hardiext/wrokchain/blob/portofolio/types/ethers-contracts/common.ts) (Ethers shared types), [`src/app/create/page.tsx`](https://github.com/hardiext/wrokchain/blob/portofolio/src/app/create/page.tsx) (Create project)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application routes"]
  node_home["Home<br/>[page.tsx]"]
  node_create["Create project<br/>[page.tsx]"]
  node_dashboard["Project dashboard<br/>[page.tsx]"]
  node_project["Project details<br/>[page.tsx]"]
  node_records["Address records<br/>[page.tsx]"]
  node_verify["Project verification<br/>[page.tsx]"]
end

subgraph group_chain["Agreement contract"]
  node_agreement["Work agreement"]
end

subgraph group_wallet["Wallet and chain"]
  node_provider["Wallet providers<br/>[provider.tsx]"]
  node_wagmi_config["Sepolia configuration<br/>[wagmi.ts]"]
end

subgraph group_bindings["Contract bindings"]
  node_abi["WorkChain ABI<br/>[ABI.ts]"]
  node_contract_types["Typed agreement"]
  node_contract_factory["Agreement factory"]
  node_common_types["Ethers shared types<br/>[common.ts]"]
  node_counter_types["Counter bindings<br/>[Counter.ts]"]
  node_counter_factory["Counter factory"]
end

node_user(("Client or worker"))
node_chain_network[("Sepolia network")]

node_user -->|"opens"| node_home
node_user -->|"creates project"| node_create
node_user -->|"views projects"| node_dashboard
node_user -->|"views details"| node_project
node_user -->|"views records"| node_records
node_user -->|"checks project"| node_verify
node_create -->|"uses ABI"| node_abi
node_dashboard -->|"uses ABI"| node_abi
node_project -->|"uses ABI"| node_abi
node_records -->|"uses ABI"| node_abi
node_verify -->|"uses ABI"| node_abi
node_create -.->|"submits project"| node_agreement
node_dashboard -.->|"reads projects"| node_agreement
node_project -.->|"reads or updates"| node_agreement
node_records -.->|"reads records"| node_agreement
node_verify -.->|"checks state"| node_agreement
node_provider -->|"loads config"| node_wagmi_config
node_provider -.->|"provides wallet access"| node_chain_network
node_wagmi_config -->|"configures RPC"| node_chain_network
node_contract_factory -->|"types contract"| node_contract_types
node_contract_factory -->|"uses shared types"| node_common_types
node_contract_types -->|"uses shared types"| node_common_types
node_counter_factory -->|"types contract"| node_counter_types
node_counter_factory -->|"uses shared types"| node_common_types
node_counter_types -->|"uses shared types"| node_common_types

click node_home "https://github.com/hardiext/wrokchain/blob/portofolio/src/app/page.tsx"
click node_create "https://github.com/hardiext/wrokchain/blob/portofolio/src/app/create/page.tsx"
click node_dashboard "https://github.com/hardiext/wrokchain/blob/portofolio/src/app/dashboard/page.tsx"
click node_project "https://github.com/hardiext/wrokchain/blob/portofolio/src/app/project/%5Bid%5D/page.tsx"
click node_records "https://github.com/hardiext/wrokchain/blob/portofolio/src/app/records/%5Baddress%5D/page.tsx"
click node_verify "https://github.com/hardiext/wrokchain/blob/portofolio/src/app/verify/%5Bid%5D/page.tsx"
click node_agreement "https://github.com/hardiext/wrokchain/blob/portofolio/contracts/WorkChainAgreement.sol"
click node_abi "https://github.com/hardiext/wrokchain/blob/portofolio/src/constants/ABI.ts"
click node_contract_types "https://github.com/hardiext/wrokchain/blob/portofolio/types/ethers-contracts/WorkChainAgreement.ts"
click node_contract_factory "https://github.com/hardiext/wrokchain/blob/portofolio/types/ethers-contracts/factories/WorkChainAgreement__factory.ts"
click node_common_types "https://github.com/hardiext/wrokchain/blob/portofolio/types/ethers-contracts/common.ts"
click node_counter_types "https://github.com/hardiext/wrokchain/blob/portofolio/types/ethers-contracts/Counter.ts"
click node_counter_factory "https://github.com/hardiext/wrokchain/blob/portofolio/types/ethers-contracts/factories/Counter__factory.ts"
click node_provider "https://github.com/hardiext/wrokchain/blob/portofolio/src/components/provider.tsx"
click node_wagmi_config "https://github.com/hardiext/wrokchain/blob/portofolio/src/lib/wagmi.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_home,node_create,node_dashboard,node_project,node_records,node_verify toneBlue
class node_agreement,node_chain_network toneAmber
class node_provider,node_wagmi_config toneMint
class node_abi,node_contract_types,node_contract_factory,node_common_types,node_counter_types,node_counter_factory,node_user toneRose
```

## Components

### Application routes

- [Home](https://github.com/hardiext/wrokchain/blob/portofolio/src/app/page.tsx): `src/app/page.tsx`
- [Create project](https://github.com/hardiext/wrokchain/blob/portofolio/src/app/create/page.tsx): `src/app/create/page.tsx`
- [Project dashboard](https://github.com/hardiext/wrokchain/blob/portofolio/src/app/dashboard/page.tsx): `src/app/dashboard/page.tsx`
- [Project details](https://github.com/hardiext/wrokchain/blob/portofolio/src/app/project/%5Bid%5D/page.tsx): `src/app/project/[id]/page.tsx`
- [Address records](https://github.com/hardiext/wrokchain/blob/portofolio/src/app/records/%5Baddress%5D/page.tsx): `src/app/records/[address]/page.tsx`
- [Project verification](https://github.com/hardiext/wrokchain/blob/portofolio/src/app/verify/%5Bid%5D/page.tsx): `src/app/verify/[id]/page.tsx`

### Agreement contract

- [Work agreement](https://github.com/hardiext/wrokchain/blob/portofolio/contracts/WorkChainAgreement.sol): `contracts/WorkChainAgreement.sol`

### Wallet and chain

- [Wallet providers](https://github.com/hardiext/wrokchain/blob/portofolio/src/components/provider.tsx): `src/components/provider.tsx`
- [Sepolia configuration](https://github.com/hardiext/wrokchain/blob/portofolio/src/lib/wagmi.ts): `src/lib/wagmi.ts`

### Contract bindings

- [WorkChain ABI](https://github.com/hardiext/wrokchain/blob/portofolio/src/constants/ABI.ts): `src/constants/ABI.ts`
- [Typed agreement](https://github.com/hardiext/wrokchain/blob/portofolio/types/ethers-contracts/WorkChainAgreement.ts): `types/ethers-contracts/WorkChainAgreement.ts`
- [Agreement factory](https://github.com/hardiext/wrokchain/blob/portofolio/types/ethers-contracts/factories/WorkChainAgreement__factory.ts): `types/ethers-contracts/factories/WorkChainAgreement__factory.ts`
- [Ethers shared types](https://github.com/hardiext/wrokchain/blob/portofolio/types/ethers-contracts/common.ts): `types/ethers-contracts/common.ts`
- [Counter bindings](https://github.com/hardiext/wrokchain/blob/portofolio/types/ethers-contracts/Counter.ts): `types/ethers-contracts/Counter.ts`
- [Counter factory](https://github.com/hardiext/wrokchain/blob/portofolio/types/ethers-contracts/factories/Counter__factory.ts): `types/ethers-contracts/factories/Counter__factory.ts`

### Other components

- **Client or worker**
- **Sepolia network**

## Connections

- Client or worker → Home: opens
- Client or worker → Create project: creates project
- Client or worker → Project dashboard: views projects
- Client or worker → Project details: views details
- Client or worker → Address records: views records
- Client or worker → Project verification: checks project
- Create project → WorkChain ABI: uses ABI (evidence: `src/app/create/page.tsx`)
- Project dashboard → WorkChain ABI: uses ABI (evidence: `src/app/dashboard/page.tsx`)
- Project details → WorkChain ABI: uses ABI (evidence: `src/app/project/[id]/page.tsx`)
- Address records → WorkChain ABI: uses ABI (evidence: `src/app/records/[address]/page.tsx`)
- Project verification → WorkChain ABI: uses ABI (evidence: `src/app/verify/[id]/page.tsx`)
- Create project → Work agreement: submits project
- Project dashboard → Work agreement: reads projects
- Project details → Work agreement: reads or updates
- Address records → Work agreement: reads records
- Project verification → Work agreement: checks state
- Wallet providers → Sepolia configuration: loads config (evidence: `src/components/provider.tsx`)
- Wallet providers → Sepolia network: provides wallet access
- Sepolia configuration → Sepolia network: configures RPC (evidence: `src/lib/wagmi.ts`)
- Agreement factory → Typed agreement: types contract (evidence: `types/ethers-contracts/factories/WorkChainAgreement__factory.ts`)
- Agreement factory → Ethers shared types: uses shared types (evidence: `types/ethers-contracts/factories/WorkChainAgreement__factory.ts`)
- Typed agreement → Ethers shared types: uses shared types (evidence: `types/ethers-contracts/WorkChainAgreement.ts`)
- Counter factory → Counter bindings: types contract (evidence: `types/ethers-contracts/factories/Counter__factory.ts`)
- Counter factory → Ethers shared types: uses shared types (evidence: `types/ethers-contracts/factories/Counter__factory.ts`)
- Counter bindings → Ethers shared types: uses shared types (evidence: `types/ethers-contracts/Counter.ts`)
