Git Product home page Git Product logo

zksync-dapp-vue's Introduction

Web 3.0 template

This template should help get you started developing a web3.0 application with Vue.js (v3), TailwindCSS and Typescript. This is a work in progress project and I'll be adding new features.

Requirements

This template requires de following environment variables

  • VITE_BLOCKCHAIN_NETWORK_NAME: Name of the network in which the app runs (or where the smart contracts are deployed)
  • VITE_BLOCKCHAIN_NETWORK_ID: Network Id in format 0xN. Rinkeby is 0x4 for example.

Features

This projects includes multiple features out of the box including:

  • Metamask wallet integration: there is a "Connect Wallet" button that triggers Metamask authorization
  • State management: the metamask wallet account info is kept in a store using Pinia. That way, it can be accessed from multiple views and components.
  • TailwindCSS integration
  • Vue router

Environment variables

Rename the .env.example file to .env and change the variables to the protocol name and id (in 0x format) for your project.

Done

  • Identify if connected blockchain is the correct one.

To-Do:

  • Disconnect wallet button
  • Support for multiple accounts instead of just one
  • Support for other wallets

How I built this project step-by-step

Created new Vite project with npm init vite@latest web3-template-vue

Installed all dependenciess npm install

Installed TailwindCSS following the official guide

Installed Pinia npm i pinia and created a basic wallet store in src/store/wallet.ts

Installed vue-router (v4) and created a couple of views

Created a NavBar component with the buttons to connect Metamask wallet, save wallet info in store and navigate between routes

Installed node types to use process.env with npm install @types/node --save-dev

Fixed @ imports in vite.config.js

zksync-dapp-vue's People

Contributors

uf4no avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.