Web3 Framework, 0% Backend, 10000% Frontend

Overview
██████ ██  ████  █████
██  ██ ██ ██    ██   ██
██████ ██ ██    ██   ██ ██ STACK ██
██     ██ ██    ██   ██ Network Without
██     ██  ████  █████       Super Node

Pico stack is a WEB3.0 framework

It allows you to build Progressive Web Apps that work completely without a server/backend/REST-API and without a central database.

If you stash your entire Backend inside Frontend you get "Blockend".

core components

  • picofeed Ultra-portable secure feed/chain-of-blocks
  • picostore Redux-like state machine.
  • piconet Internet Protocol redesigned for P2P, provides a stateless and easy to use alternative to network streams.
  • Modem56 hyperswarm to pico-net converter.
  • nuro A pure functional approach to reactive store pattern, design your own reactive neural pathways, completely framework agnostic.
  • HyperSimulator Run dat/hyper-apps in an in-memory swarm and watch the chaos unfold.
  • picorepo Lightweight persistent block store ontop of leveldb/leveljs.

usage

I want to document and consolidate these components into a single easy to use module.

But for now (if you have the guts), refer to PicoChat source, it serves as reference for this technology.

Here's the gist of an app that has a single decentralized variable called DecentTime:

// blockend.js
import { Feed, Modem56, PicoStore, Hub } from 'picostack'
import levelup from 'levelup'
import leveljs from 'level-js'

// Set up user identity
const { sk } = Feed.signPair()
const userFeed = new Feed()

// Set up the app state handler / store
const DB = levelup(leveljs('myapp')) // Open IndexedDB
const store = new PicoStore(DB)
store.register(TimeReducer())
await store.load() // Restores previously saved state

// Setup a minimal network-controller
const hub = new Hub(async (node, message, reply) => {
  if (message === 'Hello') {
    // Send local blocks
    await reply(userFeed.pickle())
  } else {
    // Accept remote blocks
    const blocks = Feed.from(message)
    await store.dispatch(blocks)
  }
})

// Connect to swarm
const modem = new Modem56()
modem.join('A topic', peer => hub.createWire(wire => {
  console.info('Peer connected', peer)
  wire.postMessage('Hello')
    .catch(console.error)
}))

async function mutate (payload) {
  userFeed.append(JSON.stringify(payload), sk)
  const accepted = await store.dispatch(userFeed, true)
  // TODO: hub.broadcast(accepted)
}

// PicoStore is a virtual-computer that runs blocks as
// if they are lines of code.
// Accepted blocks modify the computer's internal state.
// The reducers acts as the 'brains'
// deciding which instructions to run.
// A.k.a. 'The Consensus'.
// Please don't PoW or I'll get really upset.
function TimeReducer () {
  return {
    name: 'DecentTime',
    filter ({ block, state }) {
      const v = JSON.parse(block.body)
      // Reject invalid blocks
      if (v > Date.now()) return 'Invalid block from the future'
      if (v < state) return 'Outdated block'

      // Accept valid blocks
      return false
    },
    reducer ({ block }) => {
      // Mutate state
      return JSON.parse(block.body)
    }
  }
}
export { store, mutate }

And frontend:

<!doctype html>
<body>
  <h1 id="the-value">Unknown</h1>
  <button id="the-button">Mutate</button>

  <script>
    import { store, mutate } from './blockend.js'

    // Subscribe to state of 'DecentTime' in store
    // and continiously update on change.
    store.on('DecentTime', value => {
      document.getElementById('the-value').text = value
    })

    // Button mutates 'DecentTime' to Date.now() when clicked
    // and broadcasts the new block across the network.
    document
      .getElementById('the-button')
      .on('click', async () => {
        await mutate(Date.now())
      })
  </script>
</body>
</html>

Ad

|  __ \   Help Wanted!     | | | |         | |
| |  | | ___  ___ ___ _ __ | |_| |     __ _| |__  ___   ___  ___
| |  | |/ _ \/ __/ _ \ '_ \| __| |    / _` | '_ \/ __| / __|/ _ \
| |__| |  __/ (_|  __/ | | | |_| |___| (_| | |_) \__ \_\__ \  __/
|_____/ \___|\___\___|_| |_|\__|______\__,_|_.__/|___(_)___/\___|

If you're reading this it means that the docs are missing or in a bad state.

Writing and maintaining friendly and useful documentation takes
effort and time.


  __How_to_Help____________________________________.
 |                                                 |
 |  - Open an issue if you have questions!         |
 |  - Star this repo if you found it interesting   |
 |  - Fork off & help document <3                  |
 |  - Say Hi! :) https://discord.gg/K5XjmZx        |
 |.________________________________________________|

License

AGPL-3.0-or-later

2022 © Tony Ivanov

You might also like...

Repositorio común Backend-Frontend del equipo DevPanda

Instalaciones importantes: Nodejs Nodejs creará el entorno en el cuál React y Express van a ejecutarse. Se recomienda la version estable. Es una insta

May 11, 2022

Aprendendo os fundamentos do GraphQL do Backend ao Frontend!

📃 Projeto O GraphQL é totalmente independente da tecnologia que é utilizada no backend ou do frontend, do banco de dados, ou seja, para o GraphQL não

Jun 16, 2022

Learn how to set up Supabase auth for both the frontend and backend of your application using a JWT - JSON web token.

Learn how to set up Supabase auth for both the frontend and backend of your application using a JWT - JSON web token.

Supabase auth, frontend + backend - example with Next.js Learn how to set up Supabase auth for both the frontend and backend of your application using

Nov 20, 2022

sistema de bate ponto para os aprendizes da brisa, usando Angular no frontend, golang no backend e postgresql como banco.

Migule Points Este projeto tem o intuito de automatizar a frequência dos aprendizes da brisanet, usando Angular no front, Golang no backend e postgres

Sep 26, 2022

A transpiler from golang's type to typescript's type for collaboration between frontend & backend.

A transpiler from golang's type to typescript's type for collaboration between frontend & backend.

go2type go2type.vercel.app (backup site) A typescript transpiler that convert golang's type to typescript's type. Help front-end developer to work fas

Sep 26, 2022

O objetivo dessa aplicação era criar um frontend feito totalmente em Javascript, sem nenhum arquivo HTML ou CSS pré-criado. Além disso, esse projeto também é o frontend da minha API 100% NodeJS.

O objetivo dessa aplicação era criar um frontend feito totalmente em Javascript, sem nenhum arquivo HTML ou CSS pré-criado. Além disso, esse projeto também é o frontend da minha API 100% NodeJS.

Projeto HTML 100% Javascript Front-end feito "sem HTML" Conteúdos ➜ Sobre o projeto ➜ O que aprendi ➜ Como usar 🔎 Sobre o projeto Voltar ao topo O ob

Aug 3, 2021

Scalable Backend Framework for Node.Js

Scalable Backend Framework for Node.Js

Promethium A Backend Web Framework for TypeScript/Node.js This project was generated using Nx. 🔎 Smart, Fast and Extensible Build System Adding capab

Nov 4, 2022

A featherweight, functional frontend JS framework

A featherweight, functional frontend JS framework

flub.js With inspiration from React and Flutter, flub is a minimal JS framework (core sits little over 1 kB) for quickly prototyping basic JS frontend

Dec 9, 2022

Simple components showing differences in each major frontend web framework.

Web Frameworks A collection of simple components in each of the leading frontend web frameworks. So far, covering React, Vue, Angular, Svelte and Soli

Nov 27, 2022
Comments
  • pico-philosophy

    pico-philosophy

    First of all, I was surprised by amount of people that showed interest in pico* these past weeks, thank you.

    The Mission

    As a framework developer

    In order to relay what you can do with this tool.

    I want to ask the community for help to design and build a fully functional pico-app, that is fun.

    Something useful without registration forms or servers.

    The Problem

    Picostack was built to be flexible in block-scheme design. Designing a block scheme is the heart of a good blockend.

    It's similar to tabletop boardgames.

    Each block contains a peer's turn/actions.

    If the block follows the rules then the network will store it, mutating the state for everybody.

    Historical blocks can be erased when their value decreases.

    Allowing the network-state to stay small, replicate fast and run on 📱.

    If you create fair and fun rules, the network will be seeded with your version of the contract.

    On the other hand, if you create rules that attract cheating/fire then you will get fire.

    💰 attracts 🔥

    Rule no. 1: Have fun!

    The Proposal

    Decentrello: stuck

    I started writing MMO-trello. But then realized that while useful, it's more work than I can handle alone.

    If you can frontend, say "hi" on discord :pray:

    Release

    Svelte: pico-template#production | (demo)

    Tonic: pico-template#tonic | (demo)

    Research Reverse Release Repeat

    Search (re-)

    I want to focus on blockend code.

    • Turn & Time based.
    • Zero-Install browser app or game.
    • Project Scope: 1 month alpha

    Maybe:

    • Artificial Life sim
    • Farming/Conquest sim
    • Card-game
    • Lowres image-board (moderation nightmare)

    I asked the robots what they wanted to see, they gave me this... image

    Anyway, thanks, input and ideas welcome =)

    help wanted question 
    opened by telamon 1
Owner
Tony Ivanov
I hack things and improve their function.
Tony Ivanov
A web3 starter project using Typescript, Hardhat, ethers.js and @web3-react

Starter React Typescript Ethers.js Hardhat Project This repo contains a Hardhat and React Dapp starter project. The React Dapp in the frontend dir of

ChainShot 39 Dec 31, 2022
(🔗, 🌲) Web3 Link Tree is a free & open-source alternative to Linktree built with React.js, Next.js, Tailwind and Web3-React

Getting Started Read the detailed guide here Customize Add your name, wallet address, social media links and more in config.ts Images Save images to t

Naut 35 Sep 20, 2022
🛠 Solana Web3 Tools - A set of tools to improve the user experience on Web3 Solana Frontends.

?? Solana Web3 Tools - A set of tools to improve the user experience on Web3 Solana Frontends.

Holaplex 30 May 21, 2022
NFT stacking frontend completion using web3 on solana for client Nelson project.

NFT stacking frontend completion using web3 on solana for client Nelson project.

Kapollo 12 Dec 16, 2022
The fastest way to get started with a fully-fledged web3 frontend

create-web3-frontend The fastest way to get started with a fully-fledged web3 frontend setup consisting of Next.js, wagmi and Tailwind CSS. npx create

Dhaiwat Pandya 153 Dec 28, 2022
A wrapper around IPFS for speeding up the loading of web3 frontend applications.

ipfs-wrapper A wrapper around ipfs-core for speeding up the loading of web3 frontend applications. Used on Blogchain. Requirements NodeJS v14.5.0 or h

Capsule Social 15 Sep 14, 2022
Gatsby-Formik-contact-form-with-backend-panel - Full working contact form with backend GUI panel.

Gatsby minimal starter ?? Quick start Create a Gatsby site. Use the Gatsby CLI to create a new site, specifying the minimal starter. # create a new Ga

Bart 1 Jan 2, 2022
Venni backend - The backend of the Venni client apps implementing the credit card payments, matching algorithms, bank transfers, trip rating system, and more.

Cloud Functions Description This repository contains the cloud functions used in the Firebase backend of the Venni apps. Local Development Setup For t

Abrantes 1 Jan 3, 2022
Web based application that uses playerctl in it backend to control remotely your audio using the frontend as remote control.

Linux Remote This is a web based application that uses playerctl in it backend to control remotely your audio using the frontend as remote control. Do

Gabriel Guerra 4 Jul 6, 2022