You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-26Lines changed: 6 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,27 +23,12 @@ The key feature of ResCanvas is defined by having all drawings stored persistent
23
23
* No sharing of data to third parties, advertisers, government entities, .etc with decentralized storage, all user account information and data is stored in ResilientDB
24
24
* Responsive, intuitive UI inspired by Google's Material design theme used throughout the app, without the tracking and privacy issues of existing web applications
25
25
* Clear canvas ensures that data is erased for all users in the same room
26
-
***Server-side JWT authentication and authorization** with robust backend middleware (`backend/middleware/auth.py`) that validates all tokens, enforces access controls, and prevents client-side bypasses
27
-
***Backend-enforced security**: All authentication, verification, and authorization logic runs on the server — clients cannot manipulate or circumvent security checks
28
-
* Real-time collaboration using Socket.IO for low-latency stroke broadcasting, user notifications, and user activity communication with JWT-protected Socket.IO connections
29
-
30
-
## At a glance
31
-
A room-based, JWT-authenticated collaborative drawing application with a React frontend and a Flask backend. This provides real-time collaborative canvases (rooms) with low-latency stroke broadcasting (Socket.IO) and persistent stroke storage.
32
-
- Backend: Flask + Flask-SocketIO. Routes live under `backend/routes/` (notably `auth.py`, `rooms.py`, `submit_room_line.py`).
33
-
- Frontend: React (create-react-app) in `frontend/` — uses `socket.io-client` and stores auth in `localStorage`.
34
-
- Storage & cache: Redis for fast room-scoped caching and undo/redo. MongoDB is used as a mirror/persistent cache collection (`canvasCache.strokes`).
35
-
36
-
## Key files and locations
37
-
-`backend/app.py` — Flask entrypoint and Socket.IO initialization
38
-
-`backend/routes/auth.py` — login/refresh/logout and `@require_auth` middleware usage
39
-
-`backend/routes/rooms.py` — all room CRUD and stroke endpoints
-`frontend/src/` — React app, API clients under `frontend/src/api/`, `frontend/src/services/` contains socket and canvas helpers
26
+
* Server-side JWT authentication and authorization with robust backend middleware (`backend/middleware/auth.py`) that validates all tokens, enforces access controls, and prevents client-side bypasses
27
+
* Backend enforces security with all the authentication, verification, and authorization logic running on the server (clients cannot manipulate or circumvent security checks)
28
+
* Real time collaboration using Socket.IO for low latency stroke broadcasting, user notifications, and user activity communication with JWT-protected Socket.IO connections
43
29
44
30
## Authentication & Security
45
-
46
-
ResCanvas implements **server-side authentication and authorization** to ensure that all security checks are enforced by the backend, preventing client-side manipulation or bypasses. The frontend simply presents credentials; all verification, validation, and access control decisions are made on the server.
31
+
ResCanvas implements server-side authentication and authorization to ensure that all security checks are enforced by the backend, preventing client-side manipulation or bypasses. The frontend simply presents credentials as all verification, validation, and access control decisions are made on the server.
47
32
48
33
### JWT-Based Authentication
49
34
-**Access Tokens**: Short-lived JWTs signed with `JWT_SECRET` (default: 15 minutes). Clients must include the token in the `Authorization: Bearer <token>` header for all protected API calls and Socket.IO connections.
@@ -82,7 +67,6 @@ All protected routes and Socket.IO handlers use the following decorators:
82
67
For secure rooms (type `secure`) strokes must be signed client-side; the backend validates signatures in `submit_room_line.py`.
83
68
84
69
## API for External Applications
85
-
86
70
ResCanvas provides a versioned REST API (`/api/v1/*`) for external applications to integrate collaborative drawing functionality. This generalized API layer allows developers to build third-party apps, mobile clients, integrations, and automation tools on top of ResCanvas.
87
71
88
72
### Canvas API Features
@@ -106,7 +90,6 @@ ResCanvas provides a versioned REST API (`/api/v1/*`) for external applications
106
90
- PATCH for updates, DELETE for removals
107
91
108
92
### Versioned API Endpoints
109
-
110
93
All API v1 endpoints are prefixed with `/api/v1` as shown below.
111
94
112
95
**Authentication** (`/api/v1/auth/*`):
@@ -153,7 +136,6 @@ All API v1 endpoints are prefixed with `/api/v1` as shown below.
153
136
-`GET /api/v1/users/suggest` — Get user suggestions
TOKEN=$(curl -X POST http://localhost:10010/api/v1/auth/login \
@@ -229,7 +210,6 @@ The code loads environment variables via `python-dotenv` in `backend/config.py`.
229
210
---
230
211
231
212
# ResCanvas Setup Guide
232
-
233
213
ResCanvas is a decentralized collaborative drawing platform that integrates **ResilientDB**, **MongoDB**, and **Redis** for data consistency, caching, and persistence.
234
214
This guide provides complete instructions to deploy ResCanvas locally, including setup for the cache layer, backend, and frontend.
235
215
@@ -453,7 +433,7 @@ ResCanvas aims to improve user privacy and resist centralized censorship, but th
453
433
- **Signature forgery**: For secure rooms, the backend verifies cryptographic signatures server-side, ensuring strokes cannot be attributed to users who didn't create them.
454
434
455
435
- **Limitations and assumptions**:
456
-
- **Frontend device compromise**: While the backend enforces all security decisions, if a user's device or browser is compromised, attackers could steal access tokens from `localStorage` or wallet keys before signing. **Note**: Access tokens are short-lived (15 minutes by default) to minimize exposure. Refresh tokens in HttpOnly cookies are protected from JavaScript access.
436
+
- **Frontend device compromise**: While the backend enforces all security decisions, if a user's device or browser is compromised, attackers could steal access tokens from `localStorage` or wallet keys before signing. So access tokens are short-lived (15 minutes by default) to minimize exposure, and refresh tokens in HttpOnly cookies are protected from JavaScript access.
457
437
- **ResilientDB availability**: ResilientDB endpoints and GraphQL commit endpoints used by the backend must remain available and trusted by backend operators. If those services are compromised, ledger inclusion or availability may be affected.
458
438
- **Backend trust**: Users must trust the backend operators to correctly implement and enforce security policies. The backend has access to unencrypted strokes for public rooms and can decrypt private room strokes if it has the room key.
459
439
@@ -511,7 +491,7 @@ ResCanvas has a comprehensive test suite with tests that are covering both the b
511
491
**GitHub Actions workflows** automatically test every push and PR:
512
492
513
493
-**Full Test Suite** (`ci-tests.yml`): Matrix testing across Python 3.10/3.11 and Node 20.x/22.x
514
-
-**Quick Check** (`ci-quick.yml`): Fast feedback loop for PRs (~5-8 min)
494
+
-**Quick Check** (`ci-quick.yml`): Fast feedback loop for PRs
0 commit comments