feat: RefBoard v0.4.0 — collaborative reference board with layers, groups & polished UI

Full-featured PureRef-style collaborative canvas for game dev teams:
- Layer panel with visibility, lock, drag reorder, group/ungroup (Ctrl+G/Shift+G)
- Arrangement tools (grid, row, column) via right-click context menu
- Copy to system clipboard (Ctrl+C writes PNG for external paste in Paint etc.)
- Number shortcuts (1-5) for tool selection with visible shortcut badges
- Premium dark UI across all pages (Login, Collections, Boards, Editor)
- Socket.IO rooms for cursors, transforms, and presence notifications
- MinIO image storage with backend proxy, drag/drop and paste upload
This commit is contained in:
Hiren
2026-03-09 13:57:49 +05:30
commit e47777d237
43 changed files with 10276 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
import { io, Socket } from 'socket.io-client';
import { getToken } from './auth';
let socket: Socket | null = null;
export function getSocket(): Socket | null {
return socket;
}
export function connectSocket(): Socket {
if (socket?.connected) {
return socket;
}
const token = getToken();
socket = io(window.location.origin, {
auth: { token },
transports: ['websocket', 'polling'],
reconnection: true,
reconnectionAttempts: 10,
reconnectionDelay: 1000,
});
socket.on('connect', () => {
console.log('[socket] connected:', socket?.id);
});
socket.on('disconnect', (reason) => {
console.log('[socket] disconnected:', reason);
});
socket.on('connect_error', (err) => {
console.error('[socket] connection error:', err.message);
});
return socket;
}
export function disconnectSocket(): void {
if (socket) {
socket.disconnect();
socket = null;
}
}
export { Socket };