Skip to content

Commit 58fecf5

Browse files
authored
Update README.md
1 parent e7bfc5a commit 58fecf5

1 file changed

Lines changed: 6 additions & 26 deletions

File tree

README.md

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,12 @@ The key feature of ResCanvas is defined by having all drawings stored persistent
2323
* No sharing of data to third parties, advertisers, government entities, .etc with decentralized storage, all user account information and data is stored in ResilientDB
2424
* Responsive, intuitive UI inspired by Google's Material design theme used throughout the app, without the tracking and privacy issues of existing web applications
2525
* 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
40-
- `backend/routes/submit_room_line.py` — detailed stroke handling, encryption for private/secure rooms, signature verification
41-
- `backend/services/` — DB, GraphQL commit helper, Socket.IO helpers, crypto utilities
42-
- `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
4329

4430
## 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.
4732

4833
### JWT-Based Authentication
4934
- **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:
8267
For secure rooms (type `secure`) strokes must be signed client-side; the backend validates signatures in `submit_room_line.py`.
8368

8469
## API for External Applications
85-
8670
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.
8771

8872
### Canvas API Features
@@ -106,7 +90,6 @@ ResCanvas provides a versioned REST API (`/api/v1/*`) for external applications
10690
- PATCH for updates, DELETE for removals
10791

10892
### Versioned API Endpoints
109-
11093
All API v1 endpoints are prefixed with `/api/v1` as shown below.
11194

11295
**Authentication** (`/api/v1/auth/*`):
@@ -153,7 +136,6 @@ All API v1 endpoints are prefixed with `/api/v1` as shown below.
153136
- `GET /api/v1/users/suggest` — Get user suggestions
154137

155138
### Testing the API
156-
157139
Comprehensive test suites are available as well:
158140

159141
```bash
@@ -166,7 +148,6 @@ pytest tests/test_api_v1*.py -v
166148
```
167149

168150
### Quick Example: Canvas API
169-
170151
```bash
171152
# Login
172153
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`.
229210
---
230211

231212
# ResCanvas Setup Guide
232-
233213
ResCanvas is a decentralized collaborative drawing platform that integrates **ResilientDB**, **MongoDB**, and **Redis** for data consistency, caching, and persistence.
234214
This guide provides complete instructions to deploy ResCanvas locally, including setup for the cache layer, backend, and frontend.
235215

@@ -453,7 +433,7 @@ ResCanvas aims to improve user privacy and resist centralized censorship, but th
453433
- **Signature forgery**: For secure rooms, the backend verifies cryptographic signatures server-side, ensuring strokes cannot be attributed to users who didn't create them.
454434
455435
- **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.
457437
- **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.
458438
- **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.
459439
@@ -511,7 +491,7 @@ ResCanvas has a comprehensive test suite with tests that are covering both the b
511491
**GitHub Actions workflows** automatically test every push and PR:
512492

513493
- **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
515495

516496
**CI Setup Notes:**
517497

0 commit comments

Comments
 (0)