Coder Social home page Coder Social logo

ctnicholas / liveblocks-live-basket-next-js Goto Github PK

View Code? Open in Web Editor NEW
16.0 2.0 0.0 60.31 MB

Collaborative shopping basket built with Liveblocks in React/Next.js

Home Page: https://livebasket.ctnicholas.dev

License: Apache License 2.0

TypeScript 96.90% JavaScript 1.57% CSS 1.53%
shopping-cart basket liveblocks react nextjs collaboration

liveblocks-live-basket-next-js's Introduction

This repo shows how to build a live shopping basket with Liveblocks and Next.js.

Live piano screenshot

This shopping basket isn't only shared between users, but contains a demo of a driver/passenger relationship. Only one user can hold the basket at a time (the "driver"), and they have control over what is added or removed from the basket. Other users, the "passengers", can only request an item is added, and then wait for a response. If the driver goes offline, the first passenger still online becomes the new driver.

Getting started

Run examples locally

  • Install all dependencies with npm install

  • Create an account on liveblocks.io

  • Copy your secret key from the administration

  • Create a file named .env.local and add your Liveblocks secret as environment variable LIVEBLOCKS_SECRET_KEY=sk_test_yourkey

Run examples on CodeSandbox

  • Open this repository on CodeSandbox with this link

  • Create an account on liveblocks.io

  • Copy your secret key from the administration

  • Create secret named LIVEBLOCKS_SECRET_KEY with the secret key you just copied. You need to create an account on CodeSandbox to add an environment variable.

  • Refresh your browser and you should be good to go!

More

liveblocks-live-basket-next-js's People

Contributors

ctnicholas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.