Skip to content

Commit

Permalink
Simplify docs structure (#1707)
Browse files Browse the repository at this point in the history
* feat: back to single page for build

* feat: re-org into single page

* fix: landing pages

* Update docs/2.develop/contracts/whatiscontract.md

Co-authored-by: Damián Parrino <bucanero@users.noreply.github.com>

* Update docs/2.develop/whataredatasolutions.md

Co-authored-by: Damián Parrino <bucanero@users.noreply.github.com>

* fix: link

---------

Co-authored-by: Damián Parrino <bucanero@users.noreply.github.com>
  • Loading branch information
gagdiez and bucanero authored Feb 9, 2024
1 parent d3d0fe1 commit 3cb81dd
Show file tree
Hide file tree
Showing 15 changed files with 595 additions and 491 deletions.
7 changes: 1 addition & 6 deletions docs/2.develop/contracts/quickstart.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
id: quickstart
title: Hello Contract
sidebar_label: Quickstart
sidebar_label: Quickstart
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
Expand All @@ -11,11 +11,6 @@ import {CodeTabs, Language, Github} from "@site/src/components/codetabs"

In this quickstart tutorial, we will guide you in creating your first smart contract in the NEAR **testnet** that stores and retrieves a greeting.


:::info
This quickstart is dedicated to creating smart contracts. We also have one dedicated only to [frontends](../integrate/quickstart.md)
:::

---

## Prerequisites
Expand Down
35 changes: 18 additions & 17 deletions docs/2.develop/contracts/whatiscontract.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
---
id: whatisacontract
title: What is a Smart Contract?
sidebar_label: What is a Smart Contract?
sidebar_label: What is a Contract?
---

Smart contracts are pieces of **executable code** that live in a NEAR account. They can **store data**, **perform transactions** in the account’s name, and **expose methods** so other accounts can interact with them.

![img](/docs/assets/welcome-pages/contracts.png)

Do not worry if you don't know how smart-contract blockchains work. As a developer, it is sufficient to understand that NEAR smart-contracts:
1. Have **limited** computational resources.
2. Interact with other contracts in an **asynchronous** way.
Expand All @@ -17,28 +19,32 @@ Smart contracts **cannot perform HTTP requests**, meaning they can't fetch data

---

## Where do Contracts Live?
Smart Contracts are deployed into [**NEAR accounts**](../../1.concepts/basics/accounts/introduction.md). Any NEAR account can hold a contract, needing to pay for the **contract's code** and the **data it stores**. Since storage is cheap (0.01Ⓝ per kb) deploying a contract generally costs just a few cents.

![img](/docs/assets/welcome-pages/contract-landing.png)
## Where do contracts live?
Smart Contracts are deployed into [**NEAR accounts**](../../1.concepts/basics/accounts/introduction.md). Any NEAR account can hold a contract, needing to pay for the **contract's code** and the **data it stores**.

Once in an account, anyone can interact with the contract. Thanks to the underlying network structure, executing code from a contract is both **fast** (avg. 1.4s finality) and **cheap**. Moreover, **read-only** operations are **free for everyone**.

:::tip
Storing 100kb costs 1Ⓝ, so deploying a contract generally costs only a few $NEARs.
:::

---

## Life Cycle of a Contract
## Development flow

Just like any piece of software, smart contracts have a “life cycle” - starting with its creation and ending with monitoring it, all of which we cover in our documentation.
Just like any piece of software, smart contracts have a development flow - starting with its creation and ending with monitoring it, all of which we cover in our documentation.

![img](/docs/assets/welcome-pages/contract-lifecycle.png)

The development flow can be summarized as follows:
- [**Scaffold**](../contracts/quickstart.md): The simplest way to create a project is by starting from a template.
- [**Build**](../contracts/): To write a contract developers can choose between Javascript and Rust.
- [**Test**](../testing/introduction.md): Our Sandbox enables to simulate interactions with one or multiple contracts in a realistic environment.
- [**Deploy**](../deploy.md): After making sure the contract is secure, developers can deploy the contract into their accounts.
- [**Use**](https://mynearwallet.com): Any user can interact with the contract through their NEAR Wallet.
- [**Monitor**](../monitor.md): The contract's activity can be monitored through simple APIs.

#### Supported Languages
During the whole cycle, developers can choose between [JavaScript](https://www.learn-js.org/) and [Rust](https://www.rust-lang.org/), allowing them to use their favorite language at each step of their journey.

<details>
Expand All @@ -50,14 +56,9 @@ We envision that in the future, more languages will be supported and the support

---

## Contract Primitives
Contract primitives are the fundamental building blocks that can be combined to create a fully functional application. Blockchain primitives include Fungible Tokens (FT), Non Fungible Tokens (NFT), Decentralized Autonomous organizations (DAO), Link Drops and more.

- [Fungible Tokens (FT)](/primitives/ft): Fungible token is representation of an asset on a blockchain that is interchangeable. Besides the native NEAR token, users can issue their own fungible tokens or use those that are already present in the ecosystem and created by other users or projects.

- [Non Fungible Tokens (NFT)](/primitives/nft): In contrast with fungible tokens, non-fungible tokens (NFT) are unitary and therefore unique. This makes NFTs ideal to represent ownership of assets such as a piece of digital content, or a ticket for an event.

- [Decentralized Autonomous organizations (DAO)](/primitives/dao): Decentralized Autonomous Organizations (DAOs) are self-organized groups that form around common purposes. Membership, decision making, and funding are coordinated by publicly voting on proposals through a smart contract.

- [LinkDrops](/primitives/linkdrop): LinkDrops are an easy way to distribute digital assets (NFTs, FTs) via links. You provide a link for users and they can claim your drop.
## Contract primitives
Contract primitives such as FT, NFT, and DAOs are fundamental building blocks that can be combined to create awesome user experiences such as reward tokens, decision-making tools, and marketplaces.

:::tip
Check our section on [primitives](../../7.primitives/whatareprimitives.md) to learn more about them
:::
2 changes: 1 addition & 1 deletion docs/2.develop/integrate/backend.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: backend-login
title: Login with NEAR
title: Authenticate NEAR Users
---
Recently NEAR has approved a new standard that, among other things, enables users to authenticate into a backend service.

Expand Down
27 changes: 27 additions & 0 deletions docs/2.develop/web3-apps/quickstart.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
id: whatareweb3apps
title: What are Web3 Apps?
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import {CodeTabs, Language, Github} from "@site/src/components/codetabs"

Web3 Applications - also known as decentralized apps (dApps) - leverage [smart contracts](../contracts/whatiscontract.md) and blockchain data to offer **transparency**, **security** and **giving back control** to users over their assets and data.

![img](/docs/assets/welcome-pages/examples.png)

NEAR simplifies building Web3 apps for the general public, making it easy to **interact** with different blockchains, while helping to **onboard users** that are not familiarized with crypto.

---

### Why Integrating NEAR to your App?
Any application can benefit from integrating NEAR, including games, financial services, social platforms, and more.

- **Easy Onboarding**: Users can create accounts using familiar methods such as email login. Furthermore, applications can cover all transactional costs for their users, so they never have to worry about handling crypto.

- **Ownership**: Users have true ownership of digital assets within their accounts. Fungible Tokens can be used as reward systems, Non-Fungible Tokens can denote holdings, and wallets can represent digital identities.

- **Fast, Cheap and Scalable**: Near’s efficient consensus mechanism and fee model make transactions cost effective for both users and developers.

- **Security & Transparency**: All transactions and data on the blockchain is transparent and auditable, thus ensuring trust in the application’s behavior.

68 changes: 42 additions & 26 deletions docs/2.develop/welcome.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,57 @@
---
id: welcome
title: Developer Documentation
title: Build on NEAR
sidebar_label: Home
hide_table_of_contents: true
hide_breadcrumb: true
---

import {FeatureList, Column, Feature} from "@site/src/components/featurelist"
import ContactUs from '@site/src/components/ContactUs.mdx';


Welcome! Here you will find documentation on how to develop decentralized apps using NEAR.

Do not worry if you are new to blockchain technologies, we will get you up to speed in no time.
Welcome! Here you will find all the information on what you can **build** on NEAR and **how to** build it. Do not worry if you are new to Web3 or Blockchain, we are here to **guide you** through the process of learning.

<FeatureList>
<Column title="Build dApps">
<Feature url="/develop/quickstart-guide" title="Quickstart" subtitle="Spin-up your first dApp" image="quickstart.png" highlight="true" />
<Feature url="/tutorials/welcome" title="Tutorials & Examples" subtitle="Check-out a vast library of examples" image="tutorials.png" />
<Feature url="/develop/contracts/introduction" title="Build a Contract" subtitle="Learn how to write smart contracts" image="smartcontract.png" />
<Feature url="/develop/testing/introduction" title="Test the Contract" subtitle="Write unit & integration tests" image="test.png" />
<Feature url="/develop/integrate/frontend" title="Build a Web Frontend" subtitle="Learn how to make a web dApp" image="frontend.png" />
<Feature url="/tools/realtime" title="Track Your Users Activity" subtitle="Learn how to use Indexers" image="monitor.png" />
<Column title="Contracts">
<Feature url="/develop/contracts/whatisacontract" title="What is a Contract?"
subtitle="Learn what a smart contract is" image="contract.png" />
<Feature url="/develop/contracts/quickstart" title="Build a Contract"
subtitle="Spin-up your first smart contract" image="smartcontract.png" />
<Feature url="/develop/testing/introduction" title="Test a Contract" subtitle="Write unit & integration tests" image="test.png" />
<Feature url="/develop/deploy" title="Deploy a Contract" subtitle="Deploy the contract to the network" image="near-cli.png" />
</Column>
<Column title="Components">
<Feature url="/bos/tutorial/quickstart" title="What is a Component?"
subtitle="Learn about multi-chain components" image="bos-lido.png" />
<Feature url="/bos/dev/intro" title="Dev Environment"
subtitle="Choose your dev environment" image="update.png" />
<Feature url="/bos/api/state" title="Build a Component"
subtitle="Learn everything a Component can do" image="multiple.png" />
<Feature url="/develop/integrate/frontend-components" title="Use Components in a WebApp"
subtitle="Use the contract in a frontend" image="frontend-bos.png" />
</Column>
<Column title="Applications">
<Feature url="/develop/web3-apps/whatareweb3apps" title="What are Web3 Apps?"
subtitle="Learn about decentralized apps" image="near-logo.png" />
<Feature url="/develop/integrate/quickstart-frontend" title="Quickstart a Web3 App"
subtitle="Use the contract in a frontend" image="quickstart.png" />
<Feature url="/develop/integrate/frontend" title="Integrate Contracts"
subtitle="Integrate with Contracts" image="bos-contract.png" />
<Feature url="/develop/integrate/frontend" title="Build a Web Frontend"
subtitle="Use the contract in a frontend" image="frontend.png" />
</Column>
<Column title="Developer Tools">
<Feature url="/sdk/js/introduction" title="Javascript SDK" subtitle="Write Contracts in Javascript" image="smartcontract-js.png" />
<Feature url="/sdk/rust/introduction" title="Rust SDK" subtitle="Write Contracts in Rust" image="smartcontract-rust.png" />
<Feature url="/tools/near-cli" title="NEAR CLI" subtitle="Use NEAR from the Terminal" image="near-cli.png" />
<Feature url="/tools/near-api-js/quick-reference" title="NEAR API JS" subtitle="Interact with NEAR from JS" image="near-api-js.png" />
<Feature url="/api/rpc/introduction" title="RPC API" subtitle="Interact with the NEAR RPC API" image="rpc.png" />
<Feature url="/tools/indexer-for-explorer" title="Indexer for Explorer" subtitle="Query usage information for a contract" image="blocks.png" />
<Column title="Primitives">
<Feature url="/primitives/ft" title="Fungible Tokens" subtitle="Learn how to use and make FT" image="ft.png" />
<Feature url="/primitives/nft" title="Non-Fungible Tokens" subtitle="Enter the NFT space" image="nft.png" />
<Feature url="/primitives/dao" title="Autonomous Organizations" subtitle="Understand DAOs" image="dao.png" />
<Feature url="/primitives/linkdrop" title="Linkdrops" subtitle="Drop assets & onboard users" image="key.png" />
<Feature url="/primitives/oracles" title="Oracles" subtitle="On-chain oracles to query prices" image="oracle.png" />
</Column>
<Column title="Unleash the Web3">
<Feature url="/develop/relevant-contracts/ft" title="Fungible Tokens" subtitle="Learn how to use and make FT" image="ft.png" />
<Feature url="/develop/relevant-contracts/nft" title="Non-Fungible Tokens" subtitle="Enter the NFT space" image="nft.png" />
<Feature url="/develop/relevant-contracts/dao" title="Autonomous Organizations" subtitle="Understand DAOs" image="dao.png" />
<Feature url="/develop/relevant-contracts/oracles" title="Oracles" subtitle="Supercharge your app with on-chain oracles" image="oracle.png" />
<Feature url="https://rainbowbridge.app/transfer" title="Rainbow Bridge" subtitle="Bridge assets with other chains" image="rainbow.png" />
<Feature url="https://aurora.dev" title="Aurora EVM" subtitle="Run Ethereum apps natively" image="aurora.png" />
<Column title="Data Infrastructure">
<Feature url="/bos/queryapi/big-query" title="Google BigQuery"
subtitle="Query network data efficiently" image="experiment.png" />
<Feature url="/bos/queryapi/intro" title="QueryAPI" subtitle="The simplest way to build indexers" image="blocks.png" />
<Feature url="/tools/near-lake" title="NEAR Lake" subtitle="An Indexer that stores chain events" image="monitor.png" />
</Column>
</FeatureList>

Expand Down
40 changes: 40 additions & 0 deletions docs/2.develop/whataredatasolutions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
id: whataredatasolutions
title: What is Data Infrastructure?
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import {CodeTabs, Language, Github} from "@site/src/components/codetabs"

NEAR offers ready-to-use solutions to access and monitor on-chain data easily. This is very useful to automate actions based on specific **events**, cache data to **reduce latency**, gather **usage data** of the blockchain, and even **study user preferences**.

![img](/docs/assets/welcome-pages/data-lake.png)

NEAR offers three main solutions to access and monitor on-chain data: [**BigQuery Public Dataset**](#bigquery-public-dataset), [**QueryAPI**](#queryapi-indexers-made-simple), and [**NEAR Lake**](#near-lake). Each of these solutions is designed to fit different needs and use cases, and can be used in combination to create a complete data infrastructure for your application.

---

## [BigQuery: Public Dataset](/bos/queryapi/big-query)
A large dataset with on-chain data publicly available on Google Cloud Platform. Obtain near real-time blockchain data using simple SQL queries. **All the data, zero setup**.

- Instant insights: Historic on-chain data queried at scale. No need to run your own infrastructure.
- Cost-effective: Eliminate the need to store and process bulk NEAR Protocol data. Query as little or as much data as you like.
- As easy as SQL: No prior experience with blockchain technology is required. Just bring a general knowledge of SQL to unlock insights.

<hr subclass="subsection" />

## [QueryAPI: Indexers Made Simple](/bos/queryapi/intro)

A fully managed solution to build indexer functions, extract on-chain data, and easily query it using GraphQL endpoints and subscriptions.

- Your data, your way: Decide how you want to store data. Design the tables and databases that better suit your needs.
- Indexers made simple: Create the logic of your indexer and we will execute it for you. Forget about infrastructure—focus on solutions.
- Plug & play to your app: Fetch your data from any application through our API. Leverage GraphQL to query exactly what you need.

<hr subclass="subsection" />

## [NEAR Lake](/tools/near-lake)
A solution that watches over the NEAR network and stores all the events for your easy access.

- Cost-efficient solution: Cost-efficient solution for building self-hosted indexers in Rust, JavaScript, Python, Go and other languages
- Streamlined data management: Use NEAR Lake Framework to stream blocks to your server directly from NEAR Lake
3 changes: 2 additions & 1 deletion docs/3.tutorials/examples/frontend-multiple-contracts.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
id: frontend-multiple-contracts
title: Frontend Multiple Contracts
title: Frontend Interacting with Multiple Contracts
sidebar_label: Frontend & Multiple Contracts
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
Expand Down
19 changes: 11 additions & 8 deletions docs/3.tutorials/welcome.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
id: welcome
title: Examples & Tutorials
sidebar_label: Home
hide_table_of_contents: true

---

import {FeatureList, Column, Feature} from "@site/src/components/featurelist"
Expand All @@ -21,17 +21,20 @@ Explore our collection of Examples and Tutorials
<Feature url="/tutorials/examples/frontend-multiple-contracts" title="Multi-Contract Frontend" subtitle="Interact with multiple contracts" image="multiple.png" />

</Column>

<Column title="How to: DeFi & Governance">
<Feature url="/develop/relevant-contracts/ft" title="Fungible Tokens" subtitle="Learn how to use and make FT" image="ft.png" />
<Feature url="/develop/relevant-contracts/nft" title="Non-Fungible Tokens" subtitle="Enter the NFT space" image="nft.png" />
<Feature url="/develop/relevant-contracts/dao" title="Autonomous Organizations" subtitle="Understand autonomous organizations" image="dao.png" />
<Column title="Popular Tutorials">
<Feature url="/bos/tutorial/interaction" title="Components & Contracts" subtitle="Use a contract from your component" image="bos-contract.png" />
<Feature url="/bos/tutorial/lido" title="ETH Component" subtitle="Build an Ethereum Component" image="bos-lido.png" />
<Feature url="/tutorials/nfts/minting-nfts" title="NFT Mint" subtitle="Mint an NFT without using code" image="frontend-bos.png" />
<Feature url="/tutorials/indexer/nft-indexer" title="Events (NEAR Lake)"
subtitle="Use our Data Lake to listen for events" image="monitor.png" />
</Column>
<Column title="From Zero to Hero">
<Feature url="/tutorials/nfts/js/introduction" title="Master NFTs on NEAR (JS)" subtitle="Learn everything about NFT in JS" image="nft-marketplace-js.png" />
<Feature url="/tutorials/nfts/introduction" title="Master NFTs on NEAR (RS)" subtitle="Learn everything about NFT in Rust" image="nft-marketplace-rs.png" />
<Feature url="/tutorials/fts/introduction" title="Fungible Tokens 101" subtitle="Learn everything about fungible tokens" image="ft.png" />
<Feature url="/tutorials/crosswords/basics/overview" title="Crossword Game" subtitle="Build a Crossword Game from zero" image="crossword.png" />
<Feature url="/tutorials/fts/introduction" title="Fungible Tokens 101"
subtitle="Learn everything about fungible tokens" image="ft.png" />
<Feature url="/tutorials/crosswords/basics/overview" title="Crossword Game"
subtitle="Build a Crossword Game from zero" image="crossword.png" />
</Column>
</FeatureList>

Expand Down
Loading

0 comments on commit 3cb81dd

Please sign in to comment.