Git Product home page Git Product logo

allotize's Introduction



Automatic Infrastructure from Code

Recent developments have made Infrastructure as Code very popular, as it's declarative and expressive. However, typical Infrastructure as Code still defines your infrastructure in a separate system, which requires you to still set up integrations. Allotize insteads attempts to let your application define the infrastrucutre through dependency inference. This allows you to quickly implement complex applications with dynamic content without having to think about infrastructure - only client side code.

Web Page | Demo | Book

Built with ๐Ÿฆ€๐Ÿ•ธ by the Allotize Team

import { useAllotize } from "allotize-js"

export function Counter() {
    const [state, setState] = useAllotize({
        route: `store#counter`,
        data: {
            count: 0,
        },
    });

    const increment = () => {
        setState({
            count: state.count + 1,
        });
    };

    return (
        <button onClick={increment} />
    );
}

About

Allotize is a system for creating collaborative and dynamic web apps without traditional server infrastructure. The project is composed of two major modules, a database and a P2P networking solution.

The database is optimized to run in edge environments and replicates freely between nodes using conflict-free strategies.

To make development as frictionless as possible, the system handles JS-values directly and establishes proxies to them. This enables you do to things such as: votes += 1, but where mutations propagates to all connected users instead of just locally via the proxy. i.e. you write regular JavaScript, but operations can replicate remotely if you connect your variables/objects/items to Allotize

๐Ÿ“š Read the tutorial! ๐Ÿ“š

This tutorial is designed for kickstarting your first Allotize app.

Demo

Here is an example of Allotize in action! As users can act as hosts, you could serve this as a static file, yet allow your app to show real-time changes. You don't need complex frameworks either, here is an example with regular JavaScript:

const upvotes = document.getElementById("upvotes");
const downvote = document.getElementById("downvote");
const upvote = document.getElementById("upvote");

const votes = Allotize.Data({
    route: "cube/votes",

    data: {
        upvotes: 0,
    },

    onChange: (old, new) => {
        upvotes.innerHTML = new.upvotes;
    },
});

upvote.onclick = () => {
    votes.data.upvotes += 1;
};

downvote.onclick = () => {
    votes.data.upvotes -= 1;
};

allotize's People

Contributors

rasviitanen avatar

Watchers

James Cloos avatar Oliver Wangler avatar  avatar

Forkers

wngr

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.