From a6fb9624abfc85fb0e5f70641ad8253988ce98a8 Mon Sep 17 00:00:00 2001 From: Benjamin Arthuys Date: Mon, 2 Jan 2023 14:41:53 +0100 Subject: [PATCH] more friendly developers stection structure #104 --- .../Getting Started/_category_.json | 9 +++ .../{sdk => Getting Started}/events.md | 0 .../installation.md} | 8 +-- .../{sdk => Getting Started}/sdk-workflows.md | 0 docs/for-developers/_category_.json | 7 +++ .../{sdk => }/cookbook/batch.md | 0 docs/for-developers/cookbook/index.md | 16 +++++ .../for-developers/{sdk => }/cookbook/ipfs.md | 0 .../{sdk => }/cookbook/rentalNFT.md | 0 docs/for-developers/e2e.md | 63 ------------------- docs/for-developers/{index.md => faq.md} | 20 +----- docs/for-developers/{sdk => }/introduction.md | 15 +++-- docs/for-developers/playground.md | 12 ++++ docs/for-developers/sdk/_category_.json | 10 --- docs/for-developers/sdk/cookbook/index.md | 16 ----- 15 files changed, 59 insertions(+), 117 deletions(-) create mode 100644 docs/for-developers/Getting Started/_category_.json rename docs/for-developers/{sdk => Getting Started}/events.md (100%) rename docs/for-developers/{sdk/getting-started.md => Getting Started/installation.md} (95%) rename docs/for-developers/{sdk => Getting Started}/sdk-workflows.md (100%) create mode 100644 docs/for-developers/_category_.json rename docs/for-developers/{sdk => }/cookbook/batch.md (100%) create mode 100644 docs/for-developers/cookbook/index.md rename docs/for-developers/{sdk => }/cookbook/ipfs.md (100%) rename docs/for-developers/{sdk => }/cookbook/rentalNFT.md (100%) delete mode 100644 docs/for-developers/e2e.md rename docs/for-developers/{index.md => faq.md} (77%) rename docs/for-developers/{sdk => }/introduction.md (64%) create mode 100644 docs/for-developers/playground.md delete mode 100644 docs/for-developers/sdk/_category_.json delete mode 100644 docs/for-developers/sdk/cookbook/index.md diff --git a/docs/for-developers/Getting Started/_category_.json b/docs/for-developers/Getting Started/_category_.json new file mode 100644 index 0000000..f2ce06c --- /dev/null +++ b/docs/for-developers/Getting Started/_category_.json @@ -0,0 +1,9 @@ +{ + "label": "Getting Started", + "position": 2, + "link": { + "type": "generated-index" + } +} + + diff --git a/docs/for-developers/sdk/events.md b/docs/for-developers/Getting Started/events.md similarity index 100% rename from docs/for-developers/sdk/events.md rename to docs/for-developers/Getting Started/events.md diff --git a/docs/for-developers/sdk/getting-started.md b/docs/for-developers/Getting Started/installation.md similarity index 95% rename from docs/for-developers/sdk/getting-started.md rename to docs/for-developers/Getting Started/installation.md index d42a61c..b74a826 100644 --- a/docs/for-developers/sdk/getting-started.md +++ b/docs/for-developers/Getting Started/installation.md @@ -2,11 +2,9 @@ sidebar_position: 2 --- -# Getting Started +# Installation -___ - -## Ternoa-js SDK ⚙️ + ## Installation ⌨️ diff --git a/docs/for-developers/sdk/sdk-workflows.md b/docs/for-developers/Getting Started/sdk-workflows.md similarity index 100% rename from docs/for-developers/sdk/sdk-workflows.md rename to docs/for-developers/Getting Started/sdk-workflows.md diff --git a/docs/for-developers/_category_.json b/docs/for-developers/_category_.json new file mode 100644 index 0000000..90fae30 --- /dev/null +++ b/docs/for-developers/_category_.json @@ -0,0 +1,7 @@ +{ + "label": "For Developers", + "position": 4, + "link": { + "type": "generated-index" + } +} \ No newline at end of file diff --git a/docs/for-developers/sdk/cookbook/batch.md b/docs/for-developers/cookbook/batch.md similarity index 100% rename from docs/for-developers/sdk/cookbook/batch.md rename to docs/for-developers/cookbook/batch.md diff --git a/docs/for-developers/cookbook/index.md b/docs/for-developers/cookbook/index.md new file mode 100644 index 0000000..213dbbd --- /dev/null +++ b/docs/for-developers/cookbook/index.md @@ -0,0 +1,16 @@ +--- +sidebar_position: 5 +sidebar_label: Cookbook +--- + +# Cookbook + +This section covers some basic use cases. These _**code snippets**_ allow you to discover the different way to use/interact with a feature, some options and best practices, and provides crusty information. + +_If you are looking for full exemple instead of short code snippets,_ you rather look at our [Ternoa-js dApp](https://e2e.ternoa.network/) and [gitHub](https://github.com/capsule-corp-ternoa/ternoa-js-test-dapp) repo. Depending of the community requests and feedback, we will implement more of those cookbook examples and make them available for everyone below. + +```mdx-code-block +import DocCardList from '@theme/DocCardList'; + + +``` diff --git a/docs/for-developers/sdk/cookbook/ipfs.md b/docs/for-developers/cookbook/ipfs.md similarity index 100% rename from docs/for-developers/sdk/cookbook/ipfs.md rename to docs/for-developers/cookbook/ipfs.md diff --git a/docs/for-developers/sdk/cookbook/rentalNFT.md b/docs/for-developers/cookbook/rentalNFT.md similarity index 100% rename from docs/for-developers/sdk/cookbook/rentalNFT.md rename to docs/for-developers/cookbook/rentalNFT.md diff --git a/docs/for-developers/e2e.md b/docs/for-developers/e2e.md deleted file mode 100644 index 4805600..0000000 --- a/docs/for-developers/e2e.md +++ /dev/null @@ -1,63 +0,0 @@ ---- -sidebar_position: 4 -sidebar_label: E2E Test dApp ---- - -# 🧩 E2E Test dApp - -**The E2E test dApp is the easiest way to test our SDK.** - -=> [E2E Test dApp](https://e2e.ternoa.network/) - -## Getting Started the Ternoa JS Test Dapp -### [Node.js](https://nodejs.org/en/download/) - -```bash -npm install ternoa-js -``` - -First, run the development server: - -```bash -npm run dev -``` - -Open **[http://localhost:3000](http://localhost:3000)** with your browser to see the result. - -### Code Style - -This project uses recommended ESLint and Typescript rules to ensure coding good practices. - -We've setup linters and formatters to help catch errors and improve the development experience: - -- **[Prettier](https://prettier.io/)** – ensures that code is formatted in a readable way. -- **[ESLint](https://eslint.org/)** — checks code for antipatterns as well as formatting. - -**[Husky](https://typicode.github.io/husky)** proceeds some checks before pushing a new commit. It ensures that: the project is building, there are no linter/formatting issues and the test suites are not broken. - -> If you use Visual Studio Code editor we suggest you to install **[ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)** and **[Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)** extensions. - -___ - -## App Worklow 🏄‍♂️ -The **[Helpers](https://e2e.ternoa.network/app/NFT/CreateNFT)** section list several helpers from our SDK and their parameters presented in a form. The request is created once the required fields are correctly filled in. It has to be signed before being submited to the chain. You can connect your Ternoa Wallet with Wallet Connect or use your Polkadot extension. - -Ternoa ecosystem is based on 2 environments: **Alphanet** & **Mainnet**, where transactions are conducted in **$CAPS token**. -- **Alphanet** stands for the gateway to explore and test the Ternoa chain. It uses test $CAPS tokens claimable on our faucet: **[Alphanet Faucet](https://www.ternoa.network/alphanet)**. -- **Mainnet** is the main chain where data is stored. - -:::tip - -**By default** the dApp is connected to the Alphanet chain. -You can swith to Mainnet by clicking on the pill located on the top right corner. - -::: - -___ - -## Contribution 🤝 -ternoa-js SDK and the ternoa-js-test-dapp are open-source projects. Feel free to interact and move forward with us. - -If you are interested in contributing to ternoa-js-test-dapp read our **[contributing guidelines](https://github.com/capsule-corp-ternoa/ternoa-js-test-dapp/blob/main/CONTRIBUTING.md)**. - -If you have questions about anything related to Ternoa-js, we will be please to help you. Open a discussion on our **[GitHub Discussions](https://github.com/capsule-corp-ternoa/ternoa-js/discussions)**. And if you find an issue, lets us know about it here in our **[GitHub Issues](https://github.com/capsule-corp-ternoa/ternoa-js/issues)** section. \ No newline at end of file diff --git a/docs/for-developers/index.md b/docs/for-developers/faq.md similarity index 77% rename from docs/for-developers/index.md rename to docs/for-developers/faq.md index e0a0d7c..13bd0d3 100644 --- a/docs/for-developers/index.md +++ b/docs/for-developers/faq.md @@ -1,23 +1,9 @@ --- -sidebar_position: 4 -sidebar_label: For Developers +sidebar_position: 5 +sidebar_label: FAQ --- -# For Developers - -## Overview - -Let's learn about the most important tools to build on top of Ternoa chain! - -```mdx-code-block -import DocCardList from '@theme/DocCardList'; - - -``` - -The sections above will provide you with all you need to know to install and use [Ternoa-JS SDK](/category/javascript-sdk), [Indexer](/category/indexer) and [Dictionary](/for-developers/indexer/dictionary/). The following [FAQ](#faq) answers common questions about which tool to use. - -## FAQ +# FAQ ### When should I use Ternoa-JS getters or Indexer queries to get on-chain data? diff --git a/docs/for-developers/sdk/introduction.md b/docs/for-developers/introduction.md similarity index 64% rename from docs/for-developers/sdk/introduction.md rename to docs/for-developers/introduction.md index 71bf390..2246c65 100644 --- a/docs/for-developers/sdk/introduction.md +++ b/docs/for-developers/introduction.md @@ -1,18 +1,23 @@ --- sidebar_position: 1 +description: Welcome to the Ternoa developer documentation. --- # Introduction -___ +Welcome to the Ternoa developer documentation. ## Overview ⚙️ -Welcome to the Ternoa-js developer documentation. Ternoa-js main objective is to be: **one of the most user-friendly tools to build web3 projects** on top of the Ternoa Chain. Based on Polkadot{.js} API and Javascript, it offers developers the ability to query and interact with substrate chains like the Ternoa chain. It provides a seamless experience and allows you to start building at a glance: an extra short init and just a few lines of code, and your first NFT will be live on the chain. +In Ternoa we have provided a seamless experience building a Javascirpt SDK `ternoa-js` to allow any developer to start building at a glance: an extra short init and just a few lines of code, and your first NFT will be live on the network. + +`ternoa-js` main objective is to be: **one of the most user-friendly tools to build web3 projects** on top of the Ternoa Chain. Based on Polkadot{.js} API and Javascript, it offers developers the ability to query and interact with the Ternoa network. + + ### Forward Together -Ternoa-js is an open-source project. Feel free to interact and move forward with us. If you have questions about anything related to Ternoa, need help, or want to request features, you can open a discussion on our [GitHub Discussions]([https://github.com/capsule-corp-ternoa/ternoa-js/discussions](https://github.com/capsule-corp-ternoa/ternoa-js/discussions)) And if you find an issue, lets us know in our [GitHub Issues]([https://github.com/capsule-corp-ternoa/ternoa-js/issues](https://github.com/capsule-corp-ternoa/ternoa-js/issues)) section. +`ternoa-js` is an open-source project. Feel free to interact and move forward with us. If you have questions about anything related to Ternoa, need help, or want to request features, you can open a discussion on our [GitHub Discussions]([https://github.com/capsule-corp-ternoa/ternoa-js/discussions](https://github.com/capsule-corp-ternoa/ternoa-js/discussions)) And if you find an issue, lets us know in our [GitHub Issues]([https://github.com/capsule-corp-ternoa/ternoa-js/issues](https://github.com/capsule-corp-ternoa/ternoa-js/issues)) section. ## API Architecture @@ -40,6 +45,4 @@ For those familiar with Polkadot, you will quickly recognize the design structur As it makes sense for us to provide the most accessible tools to build on the Ternoa chain, **we also tried to simplify the response format of our functions whenever we could**. Depending if you want to get things done for you or if you go with the fully customizable way and handle your callback, we invite you to choose the correct function: _Events and features datas will be provided directly on some function while only transaction hash hex will be returned on others._ We will cover this topic later in the doc. -## Ready to discover more? - -If you are looking for full examples or short code snippet, move to the Cookbook to get a look at our most common use-cases or go to the [e2e Test dApp](https://e2e.ternoa.network/) and [github](https://github.com/capsule-corp-ternoa/ternoa-js-test-dapp) repository to get a full example. +### Ready to discover more? diff --git a/docs/for-developers/playground.md b/docs/for-developers/playground.md new file mode 100644 index 0000000..261da37 --- /dev/null +++ b/docs/for-developers/playground.md @@ -0,0 +1,12 @@ +--- +sidebar_position: 4 +sidebar_label: Playground +--- + +# 🧩 Playground + +Our E2E App allow you to play with our SDK getting snippet code for your project. + +:::tip +Use [e2e.ternoa.network](https://e2e.ternoa.network/app/NFT/CreateNFT) as an easy-to-remember shortcut. +::: \ No newline at end of file diff --git a/docs/for-developers/sdk/_category_.json b/docs/for-developers/sdk/_category_.json deleted file mode 100644 index 919e166..0000000 --- a/docs/for-developers/sdk/_category_.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "label": "Javascript SDK", - "position": 1, - "link": { - "type": "generated-index", - "description": "Welcome to the Ternoa-JS SDK documentation" - } -} - - diff --git a/docs/for-developers/sdk/cookbook/index.md b/docs/for-developers/sdk/cookbook/index.md deleted file mode 100644 index 74f3402..0000000 --- a/docs/for-developers/sdk/cookbook/index.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -sidebar_position: 5 -sidebar_label: 🥣 Cookbook ---- - -# Cookbook - -## Overview - -This section covers some basic use cases. These _**code snippets**_ allow you to discover the different way to use/interact with a feature, some options and best practices, and provides crusty information. _If you are looking for full exemple instead of short code snippets,_ you rather look at our [Ternoa-js dApp](https://e2e.ternoa.network/) and [gitHub](https://github.com/capsule-corp-ternoa/ternoa-js-test-dapp) repo. Depending of the community requests and feedback, we will implement more of those cookbook examples and make them available for everyone below. - -```mdx-code-block -import DocCardList from '@theme/DocCardList'; - - -```