Giter Club home page Giter Club logo

collab.canvas's Introduction

collab.canvas

Screen.Recording.2023-01-29.at.23.15.41.mov

Simple collaborative free-drawing app. Powered by conflict-free replicated data type (CRDT) via yjs and y-websocket. For smooth drawing uses perfect-freehand.

To run locally:

## dev server
yarn dev

## ws server to forward messages
yarn ws

## both
yarn start

## e2e test
yarn e2e

project structure

  • /views - UI components without much logic
  • /containers - wraps some of the common logic, drives basic views
  • /pages - combines containers and views
  • /hooks - some custom logic extracted as a react hook
  • /utils - simple helper functions. mostly pure
  • App.tsx - keeps basic routing
  • state.ts - facade for yjs relatedc stuff. state which gets distributed between participants

what works so far

  • generative unique boards with custom background colors
  • multiple unique users in the same canvas boards
  • setting a name
  • unique line color per user
  • 2 tabs identifies as 2 sessions of the same user
  • displaying all users currently connected to the board
  • zooming
  • clearing a board

what is missing

  • dragging a canvas
  • zooming by mousewheel
  • different sizes of the line
  • predefined shapes
  • seing position of the other participants
  • pinch to zoom on mobile

known issues

  • scaling canvas based on devicePixelRatio have some issues
  • using 2 fingers on mobile creates funny artifacts

collab.canvas's People

Contributors

lzgrzebski avatar

Stargazers

Mikhail Svetkin 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.