# Clique Application Structure

Clique provides an official task registry for the community to download, publish, build, and share tasks. You can easily submit a query composed of these tasks through our config file [clique-manifest](https://docs.clique.tech/references/clique-manifest "mention"). You can also deploy custom tasks yourself if there is no existing task that fits your needs.

### Task Deployment

You can deploy a custom task by:

* Initialize a custom task template through [clique-cli](https://docs.clique.tech/build-with-clique/clique-cli "mention")
* Customize your task code and update your task manifest
* Verify the manifest and submit it to the Clique TEE Network through [clique-cli](https://docs.clique.tech/build-with-clique/clique-cli "mention")

Here is a simple generated task manifest

```toml
spec-version = "1"
name = "clique_fibonacci"
type = "Dynamic"

proof-type = ["TEE"]

[input]
n = { type = "u256", description = "n" }

[output]
result = { type = "u256", description = "fibonacci sequence for n" }

[code]
type = "EVM"
data = "6080604052348015600e575f80fd5b5061022d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063371432331461002d575b5f80fd5b610047600480360381019061004291906100fd565b61005d565b6040516100549190610137565b60405180910390f35b5f80820361006d575f90506100c1565b6001820361007e57600190506100c1565b5f80600190505f80600290505b8581116100b957828461009e919061017d565b915082935081925080806100b1906101b0565b91505061008b565b508093505050505b919050565b5f80fd5b5f819050919050565b6100dc816100ca565b81146100e6575f80fd5b50565b5f813590506100f7816100d3565b92915050565b5f60208284031215610112576101116100c6565b5b5f61011f848285016100e9565b91505092915050565b610131816100ca565b82525050565b5f60208201905061014a5f830184610128565b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f610187826100ca565b9150610192836100ca565b92508282019050808211156101aa576101a9610150565b5b92915050565b5f6101ba826100ca565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036101ec576101eb610150565b5b60018201905091905056fea2646970667358221220365d9643fc7bf275e8e02fe7cd0f5a26ff14400be75bed36b39c21b2dd78440964736f6c634300081a0033"
abi = '[{"inputs":[{"internalType":"uint256","name":"n","type":"uint256"}],"name":"evaluate","outputs":[{"internalType":"uint256","name":"result","type":"uint256"}],"stateMutability":"pure","type":"function"}]'
```

The EVM template for the custom task is available on GitHub at

<https://github.com/CliqueOfficial/template-evm>

### Clique Integration Flow

#### On-chain Application

Here is a diagram that describes how the Clique Network can be integrated with your DApp.

<figure><img src="https://1307284042-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSTne2Xo5UxvisoRfW7CR%2Fuploads%2FvniZU96kEXnCYLgYMvKc%2Fimage.png?alt=media&#x26;token=1dc15505-15f2-4d0e-b94e-353422ab5fb5" alt=""><figcaption><p>Smart Contract Integration with the Clique Network</p></figcaption></figure>

**Step-by-Step Integration Flow**

1. Register a callback by using our [smart-contract-sdk](https://docs.clique.tech/build-with-clique/smart-contract-sdk "mention")
2. Once the response is fulfilled and verified by the `CliqueTaskManager` contract, it will invoke a callback registration.&#x20;

#### Off-chain Application

You can check out our [clique-client-sdk](https://docs.clique.tech/build-with-clique/clique-client-sdk "mention") to integrate with your off-chain service. Here are integration examples for a few different languages:

* \[Rust example link]
* \[NodeJS example link]
* \[Web example link]
