Giter Site home page Giter Site logo

drawchat's Introduction

DrawChat API

Generate a pair of ECDSA .private.key and public.key to receive a namespace for creating your own boards. Using the private key, you can change the board settings and grant permissions to selected users.

What do you need?

  • Base Key of the Board - a unique string of characters that uniquely identifies the board. For example, sha256(course + date + group), or you can generate a completely random string of characters and save it in your database.
  • User is identified by a unique alphanumeric string. For example, “Teacher1”, “Student123”, “…”
  • Permissions define whether the user is an administrator (e.g., a teacher) or whether they have the ability to draw or participate in chat.
  • Configuration - the board configuration is an object containing selected options: enabling/disabling extensions, the appearance of the board pages, available tools on the toolbar. The signed configuration will be applied if any user provides it to the room during their login.

Let's say you want to create a board for the course “Group403Course027” - this will be the base key of the board.

Link for moderator/teacher:

const link = get_drawchat_link(
	$privateKey,
	$publicKey,
	“Group403Course027”, // board
	“Moderator”, // username
	"RDC___", // user permissions
	$config, // board configuration (optional)
);

Link for participant/student:

const link = get_drawchat_link(
	$privateKey,
	$publicKey,
	“Group403Course027”,
	“User001”,
	"ADC___",
	$config,
);

You can configure the board to your needs by passing the appropriate options along with the link:

$config = {
  pages: {
    1: {
      backgroundColor: '#F9FEE7',
      backgroundImage: 'https://imagehost.pro/templates/grid_2000.svg',
    },
    2: {
      backgroundColor: 'black',
    },
  },
};

Examples of generating boards using a pair of keys can be found for languages:

  • PHP,
  • Python,
  • and NodeJS.

Web API

You can communicate with the board using the Web API. For example, you can send a specific request to an IFRAME, and in response, you will receive a screenshot of the board, which you can save on your own server.

Draw.Chat Draw.Chat - Virtual Paper.

drawchat's People

Contributors

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