secretchaingirl / secret-counter-vuejs-box

Secret Box based on the simple counter contract template

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Secret Box Template secret box logo

Gitpod ready-to-code

The Secret Box Template is a Gitpod-enabled quickstart for dapp development on Secret Network. It consists of a frontend (Vue + Vite + Typescript) and a secret contract (Rust + Secret CosmWasm), based on the secret counter template.

What is a Secret Box?

Secret Boxes are quickstarts or blueprints that contain everything you need to start developing on Secret Network.

They are intended to be run in a developer sandbox so you don't have to worry about installing various tooling, frameworks, etc.

Open in Gitpod

There are a couple of things that make Secret Boxes special πŸš€:

  • In addition to the secret contract, each box comes with a professionally-designed and implemented frontend, which includes a UI/UX kit.

This lets you, as the developer, focus on building and can reduce the time it takes to evolve and deploy it as your own Secret App because you don't have to worry about the design. If you are a developer that can also design and implement the UI/UX for your app, you are a special breed indeed. For many developers, this skillset isn't quite in their wheelhouse. One of the major goals for Secret Boxes is to address this need in the Secret Network developer community.

  • Because they're launched in a developer sandbox environment, they can be configured to perform automated tasks such as starting localsecret (dockerized Secret Network), compiling your secret contract, deploying and more.

When launched the following automated tasks are kicked off:

  • launch an instance of localsecret
  • build and deploy the secret contract to localsecret
  • run unit-tests on the secret contract
  • instantiate the secret contract
  • install app dependencies and launch the frontend using Vite

Creating a Secret Box

Creating a Secret Box involves one part coding and one part technical writing.

Each Secret Box has an accompanying tutorial hosted on the Secret University website. The tutorial is written in Markdown and can be found in the tutorial directory of this repo.

See this guide for more details.

Setup Your Local Developer Environment

This Setting Up Your Environment guide will help you get going on your journey developing a Secret Box.

In addition to the Secret Contract setup, you will also need to install Nodejs and yarn for the integration tests and frontend app.

Install Nodejs

Use the installer for your environment here.

Install Yarn

You can find information on installing yarn, getting started, advanced topics and more here.

Writing Your Guide

Secret Box tutorials are written using Markdown. The tutorial content is placed in app/tutorial/guide.md with any accompanying images kept in the app/tutorial/illustrations directory.

Project Structure

/
.
β”œβ”€β”€ app
β”‚   β”œβ”€β”€ public
β”‚   β”œβ”€β”€ src
β”‚   β”‚   β”œβ”€β”€ assets
β”‚   β”‚   β”œβ”€β”€ components
β”‚   └── tutorial
β”‚       └── illustrations
β”œβ”€β”€ docs
β”œβ”€β”€ examples
β”œβ”€β”€ schema
β”œβ”€β”€ scripts
β”œβ”€β”€ src
└── tests

Commands & Usage

Secret Contract

After creating your own repository using this template, the following commands are run from the root of the project, from a terminal and apply to the secret contracts:

Command Action
make build Compiles the secret contract
make schema Generates the JSON schema for messages and state files
make test Runs the secret contract unit tests
make localsecret Launches the dockerized localsecret developer instance
make deploy Stores the compiled/optimized contract on localsecret

Integration Tests

The integration tests are located under the tests directory and uses secret.js to interact with the deployed secret contract. These are great examples of interacting with the Secret Network and can be used to bootstrap frontend development.

npx ts-node integration.ts

Frontend App

These commands apply to the frontend of the Secret Box and are run from the app directory:

Command Action
yarn Installs dependencies
yarn dev Starts local Vite dev server at http://localhost:5173
yarn build Build your production site to ./dist/
yarn preview Preview your build locally, before deploying

Connecting from outside Gitpod

To connect, prepend the port number with the gitpod url. e.g. if the workspace is at https://secretunive-secretboxvi-zyc1kppqbvk.ws-us69.gitpod.io then you can connect to the LCD service at https://1317-secretunive-secretboxvi-zyc1kppqbvk.ws-us69.gitpod.io.

Resources

Contributors

About

Secret Box based on the simple counter contract template

License:Apache License 2.0


Languages

Language:Rust 40.1%Language:TypeScript 24.1%Language:Shell 21.5%Language:Makefile 6.6%Language:CSS 4.0%Language:Vue 2.6%Language:HTML 1.1%