Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions socketio-draw-board/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
dist
.DS_Store
.env
40 changes: 40 additions & 0 deletions socketio-draw-board/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Socket.IO Collaborative Draw Board

A Codesphere-ready collaborative drawing board built with Express, Socket.IO, and a browser canvas. Multiple people can join the same room, draw together in real time, clear the board, and export the current canvas as a JPG.

## Features

- Real-time drawing synchronization with Socket.IO
- Shareable room names through the URL
- Brush color and size controls
- Connected-user count
- Clear-board event shared across the room
- Download the canvas as `draw-board.jpg`
- One-workspace Codesphere deployment through `ci.yml`

## Run Locally

```bash
npm install
npm start
```

Open `http://localhost:3000`.

To test collaboration locally, open the same URL in two browser windows. Add a room name with `?room=team-sketch` to isolate a board.

## Deploy On Codesphere

Create a Codesphere workspace from this template and run the included CI pipeline:

1. `prepare` installs dependencies.
2. `test` validates the server entry point.
3. `run` starts the Socket.IO app on port `3000`.

Codesphere exposes the app URL for your workspace automatically.

## Customize

- Edit `public/app.js` to add tools such as rectangles, undo, or saved boards.
- Edit `public/styles.css` to match your brand.
- Add persistence in `server.js` if rooms should survive server restarts.
14 changes: 14 additions & 0 deletions socketio-draw-board/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
prepare:
steps:
- name: "Install dependencies"
command: "npm install"

test:
steps:
- name: "Validate server"
command: "node --check server.js"

run:
steps:
- name: "Run"
command: "npm start"
10 changes: 10 additions & 0 deletions socketio-draw-board/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"Workspace": "free",
"Links": {
"Socket.IO": "https://socket.io/",
"Express": "https://expressjs.com/"
},
"Categories": ["Application", "Framework"],
"Contributors": ["kenproxx"],
"Title": "Socket.IO - Collaborative Draw Board"
}
Loading