Learn NEAR Protocol smart contract development through interactive, hands-on coding examples.
Welcome to NEAR by Example — an open source learning platform for building smart contracts on the NEAR Protocol blockchain. Whether you're new to Web3 or an experienced developer exploring NEAR, this project gives you a browser-based environment to write, compile, deploy, and test smart contracts without a local setup.
NEAR by Example is a browser-based learning platform that teaches NEAR smart contract development through interactive examples. It combines:
- 60+ Live Examples with syntax highlighting for both Rust and JavaScript/TypeScript
- Instant compilation via backend services
- TestNet deployment to NEAR TestNet
- Live code editing with syntax highlighting for Rust and JavaScript/TypeScript
- Interactive feedback with transaction links to NEAR Explorer
- AI assistance for explaining concepts (when configured)
- Function testing for deployed contract methods
The platform is organized into learning categories: Basics, Access Control & Security, Collections & Data, NFTs, Fungible Tokens, Cross-Contract, and Advanced Patterns.
This organization hosts three main repositories:
| Repository | Description |
|---|---|
| Frontend | The NEAR by Example web app — CodeMirror editor, example browser, deployment UI, and NEAR wallet integration. |
| Backend (Rust) | REST API for compiling Rust NEAR contracts to WASM and deploying them to NEAR TestNet. |
| Backend (JS Endpoints) | REST API for compiling JavaScript/TypeScript NEAR contracts and deploying them to NEAR TestNet. |
Each repository has its own README, LICENSE, and CONTRIBUTING documentation. For setup, API details, and contribution guidelines, see the relevant repository.
- Clone the frontend repository and follow its README for local development.
- Use one of the backend services depending on your contract language (Rust or JS/TS).
- Open the app in your browser and start with the examples.
NEAR by Example is fully open source. We encourage contributions, feedback, and reuse. All repositories are licensed under MIT (or as specified in each repo’s LICENSE file).
We welcome contributions from developers of all levels. To contribute:
- Choose a repository (frontend or one of the backends).
- Read that repository’s CONTRIBUTING guide.
- Open issues or pull requests as described there.
We aim to provide a welcoming and inclusive environment. Please read the Code of Conduct in the relevant repository before participating.
Built with ❤️ for the NEAR developer community