Your whole team, changing the world one stroke at a time.

Overview

Collanvas — Your whole team, changing the world one stroke at a time 🎨

With an online whiteboard, you can brainstorm 🧠 , draw art 🖌️ , and even play games 🕹️ with your teammates and your friends. No login is required, and each user has access to the chatroom, a real-time messaging platform to have all kinds of discussions. Choose your own username, pick your own color palette, and go draw the next big thing! 🚀

Collanvas Home Page

Collanvas Room Page with a drawing of the text 'Redis' and a smiley face, and 2 chat messages from different people spelling 'Woohoo!'

Overview video

I Built an Online Collaborative Canvas using Redis as my Primary Database

How it works

How the data is stored:

Strokes data model

Data Description Type
Color The color of the stroke String (HEX)
Thickness The thickness of the stroke Number (1 to 10)
Type Whether stroke is pen or eraser String ('Pen' or 'Eraser')
Points The points that make up the stroke {x: Number,y: Number}[]

Keys are generates like canvas:{roomKey}. For each generated key, data is stored by running the ARRAPPEND command like: JSON.ARRAPPEND canvas:{roomKey} {...data}.

Messages data model

Data Description Type
Content Content of the sent message String
Username Name of the user that sent the message String
Color Unique color chosen by the user that sent the message String (HEX)

Keys are generates like messages:{roomKey}. For each generated key, data is stored by running the ARRAPPEND command like: JSON.ARRAPPEND messages:{roomKey} {...data}.

How the data is accessed:

How data is accessed

When the user enters a new room, a PUT request is sent to the server with the room key.

  • If the room exists,
    • We return the existing data to the user by running JSON.GET on the messages and canvas JSON documents.
  • Otherwise,
    • We instantiate a new room by creating those two JSON documents with the command JSON.SET and fill them with two empty arrays, respectively.

For real-time funcionality, Redis Pub/Sub is used to transmit data between existing users without running JSON.GET every time that happens.

How to run it locally?

Prerequisites

  • Node - v12.19.0
  • NPM - v6.14.8

Local installation

Get started by installing Redis on your machine.

Next, go to the project's root directory and run the following commands in order:

  • npm install or yarn
  • npm run dev or yarn dev

Open your browser and navigate to localhost:3000. You're running a local version of Redis, so you won't have access to the production database.

Deployment

To make deploys work, you need to create free account on Redis Cloud

Heroku

Deploy

Vercel

Collanvas is using WebSockets, which are unforunately unsupported by Vercel's Serverless Functions.

More Information about Redis Stack

Here some resources to help you quickly get started using Redis Stack. If you still have questions, feel free to ask them in the Redis Discord or on Twitter.

Getting Started

  1. Sign up for a free Redis Cloud account using this link and use the Redis Stack database in the cloud.
  2. Based on the language/framework you want to use, you will find the following client libraries:

The above videos and guides should be enough to get you started in your desired language/framework. From there you can expand and develop your app. Use the resources below to help guide you further:

  1. Developer Hub - The main developer page for Redis, where you can find information on building using Redis with sample projects, guides, and tutorials.
  2. Redis Stack getting started page - Lists a
You might also like...

A time-based one-time password (TOTP) generator and authenticator for Gun DB

A time-based one-time password (TOTP) generator and authenticator for Gun DB

Entangler A time-based one-time password (TOTP) generator and authenticator for Gun DB Entangler generates a 6 digit passcode every 30 seconds. It gen

Nov 9, 2022

A mod for Mindustry that adds a few items and liquids, and a whole new tier of upgrades, along with arc

A mod that adds a few items and liquids, and a whole new tier of upgrades, along with arc. Made by Chickenloser and Oreo with help from Duvent.

Nov 25, 2022

A website that acts as a guide about the universities to potential students whole throughout the globe.

A website that acts as a guide about the universities to potential students whole throughout the globe.

Apr 15, 2022

Given a list of items, only render what's visible on the screen while allowing scrolling the whole list.

Solid Windowed Given a list of items, only render what's visible on the screen while allowing scrolling the whole list. A Solid component. See https:/

Dec 21, 2022

Open the whole new fancy chapter, in which end-user can interact lively with our quests!

Open the whole new fancy chapter, in which end-user can interact lively with our quests!

Fancy Chapter - Here comes the fancy adventure! Fancy Chapter is the User Interface (UI) of TheNewsQuest app, in which user can freely interact tons o

Aug 5, 2022

we learn the whole concept of JS including Basics like Object, Functions, Array etc. And Advance JS - Understanding DOMs, JQuery, Ajax, Prototypes etc.

JavaScript-for-Complete-Web Development. we learn the whole concept of JS including Basics like Object, Functions, Array etc. And Advance JS - Underst

Jul 22, 2022

On-chain snapshots of the whole blockchain state

📸 Snapshop 📸 Snapshop is a tool for creating on-chain snapshots of the whole blockchain state. It lets your smart contracts read the storage of any

Sep 26, 2022

The world's greatest open source 3D CAM software. (Maybe one day.)

The world's greatest open source 3D CAM software. (Maybe one day.)

Meshmill is open source 3D CAM software for Linux. It turns STL models into G-code for CNC machines. This is beta-quality software. Use it at your own

Dec 21, 2022

Clubhouse is a new type of social network based on voice—where people around the world come together to talk, listen and learn from each other in real-time.

Clubhouse is a new type of social network based on voice—where people around the world come together to talk, listen and learn from each other in real-time.

Awesome Clubhouse The clubhouse is a new type of social network based on voice—where people around the world come together to talk, listen and learn f

Nov 9, 2022
Comments
  • How to host this app on own VPS

    How to host this app on own VPS

    Hi, The project is great, it works fine on Heroku, but here is the question, is there a chance for instructions on how to install it on your own VPS, first of all, what is required, what needs to be changed and how to properly run, and if you have a moment, also how to do it for the application to be available externally (e.g. reverse proxy) And also for this reason:

    Starting November 28th, 2022, free Heroku Dynos, free Heroku Postgres, and free Heroku Data for Redis® will no longer be available.
    If you have apps using any of these resources, you must upgrade to paid plans by this date to ensure your apps continue to run and to retain your data. For students, we will announce a new program by the end of September. Learn more at https://blog.heroku.com/next-chapter
    
    opened by kry008 1
Owner
Eluda
coding is poetry.
Eluda
Application which will allow users to find hotels, hostels and restaurants and feedback about those in whole over of world.

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

Taron Vardanyan 2 Jul 22, 2022
Download all Moodle files with one click. This is a Chrome extension built to save time and effort from downloading files manually one by one!

Moodle Downloader Extension Moodle downloader extension for Chrome. The extension is tested with both the TUM moodle and the official moodle demo. Not

Zhongpin Wang 8 Nov 15, 2022
Write "hello world" in your native language, code "hello world" in your favorite programming language!

Hello World, All languages! ?? ?? Write "hello world" in your native language, code "hello world" in your favorite language! #hacktoberfest2022 How to

Carolina Calixto 6 Dec 13, 2022
A2er - Fun browser extension, changing all words ending with `a` to end with `er`.

a2er Fun browser extension, changing all words ending with a to end with er. This started as a joke between friends and me, pronouncing words ending w

Sebastian Schicho 1 Jan 10, 2022
This is a simple tool to allow you to create WebM files with changing aspect ratios.

WackyWebM WackyWebM is a tool that allows you to create WebM video files with changing aspect ratios. If you're having issues, want to share your cust

OIRNOIR 564 Jan 4, 2023
This is a simple tool to allow you to create WebM files with changing aspect ratios.

WackyWebM WackyWebM is a tool that allows you to create WebM video files with changing aspect ratios. If you're having issues, want to share your cust

OIRNOIR 435 Aug 18, 2022
Team Empire offers an innovative and intuitive game based on puzzles solved by two players working in a team.

Team Empire offers an innovative and intuitive game based on puzzles solved by two players working in a team. The user can create an account to monitor their results and achievements. The whole idea of the product is to make the player think and develop his logical thinking.

Vocational school for computer programming and innovation 14 Aug 8, 2022
🥰 Mini world simulator is a terminal application made in JavaScript to control the world that is being generated.

Mini-world "Simulator" Mini world simulator is a terminal application made in JavaScript to control the world that is being generated. It has no other

Adrián 2 Mar 14, 2022
Get started with GatsbyJS straight away without having to spend a whole day configuring your usual addons.

Gatsby Starter Infinite Get started with GatsbyJS straight away without having to spend a whole day configuring your usual addons. This starter includ

Matt Patterson 3 Jun 27, 2022
A real time Web-App for one to one chatting.

We-Vibe A real time web-app for one to one chatting. The project is broadly divided into two parts - Server and Public (client). The Socket.io module

Sushmita Kumari 6 Dec 15, 2022