2018-02-08 16:52:49 +01:00
# whiteboard
2020-05-09 15:40:26 +02:00
2018-02-09 01:14:44 +01:00
This is a lightweight NodeJS collaborative Whiteboard/Sketchboard witch can easily be customized...
2018-02-09 00:12:29 +01:00
2020-04-20 11:03:07 +02:00
![start ](./doc/start.png )
2018-02-09 00:12:29 +01:00
2020-05-09 15:40:26 +02:00
## Demowhiteboard
2020-03-31 12:06:36 +02:00
[HERE ](https://cloud13.de/testwhiteboard/ ) (Reset every night)
2020-03-19 18:28:22 +01:00
2018-02-09 00:12:29 +01:00
## Some Features
2020-05-09 15:40:26 +02:00
- Shows remote user cursors while drawing
- Undo / Redo function for each user
- Drag+Drop / Copy+Paste Images or PDFs from PC and Browsers
- Resize, Move & Draw Images to Canvas or Background
- Write text
- Save Whiteboard to Image and JSON
- Draw angle lines by pressing "shift" while drawing (with line tool)
- Draw square by pressing "shift" while drawing (with rectangle tool)
- Indicator that shows the smallest screen participating
- Keybindings for ALL the functions
- Working on PC, Tablet & Mobile
2018-02-09 00:12:29 +01:00
2020-05-09 18:19:16 +02:00
## Projects using this Whiteboard
2020-05-09 18:24:09 +02:00
- [meetzi ](https://meetzi.de/ ) - WebRtc Conference tool
- [Accelerator ](https://github.com/cracker0dks/Accelerator ) - WebRtc Conference tool
- Your Project here...
2020-05-09 18:19:16 +02:00
2020-03-31 12:06:36 +02:00
## Install the App
2020-05-09 15:40:26 +02:00
2020-03-31 12:06:36 +02:00
You can run this app with and without docker
2020-05-09 15:40:26 +02:00
2020-03-31 12:06:36 +02:00
### Without Docker
2020-05-09 15:40:26 +02:00
2020-03-31 12:06:36 +02:00
1. install the latest NodeJs
2. Clone the app
2020-04-19 18:14:44 +02:00
3. Run `npm ci` inside the folder
4. Run `npm run start:prod`
2020-03-31 12:06:36 +02:00
5. Surf to http://YOURIP:8080
### With Docker
2020-05-09 15:40:26 +02:00
2020-03-31 12:06:36 +02:00
1. `docker run -d -p 8080:8080 rofl256/whiteboard`
2. Surf to http://YOURIP:8080
2020-04-19 18:14:44 +02:00
## Development
2020-04-20 11:03:07 +02:00
After you have installed the app, run `npm run start:dev` to start the backend and a frontend development server. The website will be accessible on http://locahost:8080.
2020-04-19 18:14:44 +02:00
2020-03-31 05:41:10 +02:00
## Default keyboard shortcuts
2020-05-09 15:40:26 +02:00
2020-03-31 05:41:10 +02:00
Use keyboard shortcuts to become more productive while using Whiteboard.
They are especially useful if you work with interactive displays such as XP-Pen Artist, Huion Kamvas and Wacom Cintiq. These devices have quick buttons (6-8 buttons and scrolling). By default, the buttons on these displays are mapped to standard Photoshop keyboard shortcuts. Keys can be configured to function effectively in other software.
2020-04-20 11:03:07 +02:00
The following are predefined shortcuts that you can override in the file [./src/js/keybinds.js ](./src/js/keybinds.js )
2020-03-31 05:41:10 +02:00
2020-05-09 15:40:26 +02:00
| Result | Windows and Linux | macOS |
| ---------------------------------------------------------------- | -------------------- | ----------------------- |
| Clear the whiteboard | Ctrl + Shift + Z | Command + Shift + Z |
| Undo your last step | Ctrl + Z | Command + Z |
| Redo your last undo | Ctrl + Y | Command + Y |
| Select an area | Ctrl + X | Command + X |
| Take the mouse | Ctrl + M | Command + M |
| Take the pen | Ctrl + P | Command + P |
| Draw a line | Ctrl + L | Command + L |
| Draw a rectangle | Ctrl + R | Command + R |
| Draw a circle | Ctrl + C | Command + C |
| Toggle between line, rectangle and circle | Ctrl + Shift + F | Command + Shift + F |
| Toggle between pen and eraser | Ctrl + Shift + X | Command + Shift + X |
| Toggle between main clolors (black, blue, green, yellow and red) | Ctrl + Shift + R | Command + Shift + R |
| Write text | Ctrl + A | Command + A |
| Take the eraser | Ctrl + E | Command + E |
| Increase thickness | Ctrl + Up Arrow | Command + Up Arrow |
| Decrease thickness | Ctrl + Down Arrow | Command + Down Arrow |
| Colorpicker | Ctrl + Shift + C | Command + Shift + C |
| Set black color | Ctrl + Shift + 1 | Command + Shift + 1 |
| Set blue color | Ctrl + Shift + 2 | Command + Shift + 2 |
| Set green color | Ctrl + Shift + 3 | Command + Shift + 3 |
| Set yellow color | Ctrl + Shift + 4 | Command + Shift + 4 |
| Set red color | Ctrl + Shift + 5 | Command + Shift + 5 |
| Save whiteboard as image | Ctrl + S | Command + S |
| Save whiteboard as JSON | Ctrl + Shift + K | Command + Shift + K |
| Save whiteboard to WebDav | Ctrl + Shift + I (i) | Command + Shift + I (i) |
| Load saved JSON to whiteboard | Ctrl + Shift + J | Command + Shift + J |
| Share whiteboard | Ctrl + Shift + S | Command + Shift + S |
| Hide or show toolbar | Tab | Tab |
| Move selected object up | Up Arrow | Up Arrow |
| Move selected object down | Down Arrow | Down Arrow |
| Move selected object left | Left Arrow | Left Arrow |
| Move selected object right | Right Arrow | Right Arrow |
| Drop object | Ctrl + Enter | Command + Enter |
| Add Image to backgroud | Shift + Enter | Shift + Enter |
| Cancel all actions | Escape | Escape |
| Delete selected object | Delete | Delete |
| Use Line tool when pen is active (Not changeable) | Shift (Hold) | Shift (Hold) |
2020-03-31 05:41:10 +02:00
2019-05-07 08:52:34 +02:00
## URL Parameters
2020-05-09 15:40:26 +02:00
2018-02-09 00:16:52 +01:00
Call your site with GET parameters to change the WhiteboardID or the Username
`http://YOURIP:8080?whiteboardid=MYID&username=MYNAME`
2020-05-09 15:40:26 +02:00
- whiteboardid => All people with the same ID are drawing on the same board
- username => The name witch is showing to others while drawing
- title => Change the name of the Browser Tab
- randomid => if set to true, a random whiteboardId will be generated if not given aswell
2018-02-09 00:16:52 +01:00
2019-02-11 13:11:07 +01:00
## Security - AccessToken (Optional)
2020-05-09 15:40:26 +02:00
2019-02-11 13:16:21 +01:00
To prevent clients who might know or guess the base URL from abusing the server to upload files and stuff..., you can set an accesstoken at server start.
2019-02-11 13:11:07 +01:00
2020-04-20 11:03:07 +02:00
< b > Server (Without docker):</ b > `node scripts/server.js --accesstoken="mySecToken"`
2019-02-11 13:11:07 +01:00
2020-04-20 11:03:07 +02:00
< b > Server (With docker):</ b > `docker run -d -p 8080:8080 rofl256/whiteboard --accesstoken="mySecToken"`
2019-02-11 13:11:07 +01:00
2019-07-01 15:13:15 +02:00
Then set the same token on the client side as well:
2019-02-11 13:16:21 +01:00
2019-02-11 13:11:07 +01:00
< b > Client (With and without docker):</ b > `http://YOURIP:8080?accesstoken=mySecToken&whiteboardid=MYID&username=MYNAME`
2018-02-09 00:16:52 +01:00
2019-02-11 13:16:21 +01:00
Done!
2019-07-01 15:13:15 +02:00
## WebDAV (Optional)
2020-05-09 15:40:26 +02:00
2019-08-19 10:35:05 +02:00
This function allows your users to save the whiteboard directly to a webdav server (Nextcloud) as image without downloading it.
To enable it:
2019-07-01 15:13:15 +02:00
2020-04-20 11:03:07 +02:00
< b > Server (Without docker):</ b > `node scripts/server.js --webdav=true`
2019-07-01 15:13:15 +02:00
2020-04-20 11:03:07 +02:00
< b > Server (With docker):</ b > `docker run -d -p 8080:8080 rofl256/whiteboard --webdav=true`
2019-07-01 15:13:15 +02:00
Then set the same parameter on the client side as well:
< b > Client (With and without docker):</ b > `http://YOURIP:8080?webdav=true&whiteboardid=MYID&username=MYNAME`
2019-07-01 15:18:36 +02:00
Refresh the site and You will notice an extra save button in the top panel. Set your WebDav Parameters, and you are good to go!
2019-08-19 10:38:22 +02:00
Note: For the most owncloud/nextcloud setups you have to set the WebDav-Server URL to: https://YourDomain.tl/remote.php/webdav/
2019-07-01 15:13:15 +02:00
Done!
2018-02-09 00:12:29 +01:00
## Things you may want to know
2020-05-09 15:40:26 +02:00
- Whiteboards are gone if you restart the Server, so keep that in mind (or save your whiteboard)
- You should be able to customize the layout without ever touching the whiteboard.js (take a look at index.html & main.js)
2018-02-09 00:19:44 +01:00
2019-07-01 15:28:11 +02:00
## All server start parameters (also docker)
2020-05-09 15:40:26 +02:00
- accesstoken => take a look at "Security - AccessToken" for a full explanation
- disablesmallestscreen => set this to "true" if you don't want show the "smallest screen" indicator (A dotted gray line) to the users
- webdav => Enable the function to save to a webdav-server (Must also be enabled on the client; Take a look at the webdav section)
2019-05-07 08:36:42 +02:00
2018-02-09 01:00:00 +01:00
## ToDo
2020-05-09 15:40:26 +02:00
- Make undo function more reliable on texts
2018-02-09 01:00:00 +01:00
2018-02-09 01:32:34 +01:00
## Nginx Reverse Proxy configuration
2020-05-09 15:40:26 +02:00
2018-02-09 01:32:34 +01:00
Add this to your server part:
2020-05-09 15:40:26 +02:00
2018-02-09 01:32:34 +01:00
```
location /whiteboard/ {
proxy_set_header HOST $host;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
proxy_pass http://YOURIP:8080/;
}
```
2020-05-09 15:40:26 +02:00
2018-02-09 01:32:34 +01:00
To run it at /whiteboard. Don't forget to change -> YOURIP!
## Nextcloud integration
2020-05-09 15:40:26 +02:00
2018-02-09 01:32:34 +01:00
1. Install this app on your server
2019-05-07 08:57:20 +02:00
2. Enable and go to "external sites" (app) on your Nextcloud
2020-05-09 15:40:26 +02:00
3. Add a link to your server: `https://YOURIP/whiteboard/?whiteboardid=WHITEBOARDNAME&username={uid}`
You can give each group its own whiteboard by changeing the WHITEBOARDNAME in the URL if you want.
2018-02-09 01:32:34 +01:00
2018-02-09 02:08:07 +01:00
Note: You might have to serve the app with https (If your nextcloud server runs https). To do so, its recommend to run this app behind a reverse proxy. (as shown above)
2018-02-09 01:32:34 +01:00
2019-02-04 19:42:07 +01:00
#### (Optional) Set whiteboard icon in nextcloud
2020-05-09 15:40:26 +02:00
2019-02-04 19:42:07 +01:00
![start ](https://raw.githubusercontent.com/cracker0dks/whiteboard/master/doc/iconPrev.jpg )
Upload both icons present at /doc/nextcloud_icons/ to your nextcloud at the "external sites" admin section. Then set it as symbol on your link.
2018-02-09 01:32:34 +01:00
2020-05-09 15:40:26 +02:00
**_ MIT License _**