Skip to content

Commit 5d3c024

Browse files
committed
Add initial files for Excalidraw Tauri desktop application, including README, configuration files, and core components. Implemented server connection dialog and collaboration features with WebSocket support. Added .gitignore for build artifacts and IDE settings.
1 parent a77b665 commit 5d3c024

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+6906
-6
lines changed

.gitignore

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Server
2+
excalidraw-server/excalidraw-server
3+
excalidraw-server/*.db
4+
excalidraw-server/data/
5+
excalidraw-server/.env
6+
7+
# App
8+
excalidraw-app/node_modules/
9+
excalidraw-app/dist/
10+
excalidraw-app/dist-ssr/
11+
excalidraw-app/src-tauri/target/
12+
excalidraw-app/src-tauri/Cargo.lock
13+
14+
# Logs
15+
*.log
16+
npm-debug.log*
17+
yarn-debug.log*
18+
yarn-error.log*
19+
20+
# OS
21+
.DS_Store
22+
Thumbs.db
23+
24+
# IDE
25+
.vscode/
26+
.idea/
27+
*.swp
28+
*.swo
29+
*~
30+
31+
# Build artifacts
32+
*.exe
33+
*.dmg
34+
*.app
35+
*.deb
36+
*.rpm
37+
*.AppImage
38+
39+
# Databases
40+
*.db
41+
*.sqlite
42+
*.sqlite3
43+
44+
# Temporary files
45+
.cursor/
46+
tmp/
47+
temp/
48+

QUICKSTART.md

Lines changed: 233 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,233 @@
1+
# Quick Start Guide
2+
3+
## What's Been Built
4+
5+
**Clean Server** (`excalidraw-server/`)
6+
7+
- Removed all Firebase dependencies
8+
- Removed AWS storage
9+
- Removed frontend embedding
10+
- Simplified to just WebSocket collaboration + document API
11+
- Organized handlers into separate modules
12+
13+
**Tauri Desktop App** (`excalidraw-app/`)
14+
15+
- React + TypeScript frontend with Excalidraw
16+
- Rust backend with SQLite for local storage
17+
- Connection dialog for server configuration
18+
- Auto-save functionality
19+
- Real-time collaboration support
20+
21+
**Startup Scripts**
22+
23+
- `start-server.sh` - Launches Go server with dependency checks
24+
- `start-app.sh` - Launches Tauri app with dependency checks
25+
26+
**Documentation**
27+
28+
- Root README with overview
29+
- Server README with API docs and deployment guide
30+
- App README with architecture and troubleshooting
31+
32+
## Quick Test
33+
34+
### 1. Test Server Only
35+
36+
```bash
37+
./start-server.sh
38+
```
39+
40+
Expected output:
41+
42+
```
43+
🚀 Starting Excalidraw Server...
44+
✓ Go found: go version go1.21...
45+
📝 Configuration:
46+
Storage Type: sqlite
47+
Data Source: ./excalidraw.db
48+
Log Level: info
49+
50+
🔨 Building server...
51+
▶️ Starting server on :3002...
52+
```
53+
54+
Test it works:
55+
56+
```bash
57+
curl http://localhost:3002/socket.io/
58+
# Should return Socket.IO handshake response
59+
```
60+
61+
### 2. Test App (Offline Mode)
62+
63+
In a new terminal:
64+
65+
```bash
66+
./start-app.sh
67+
```
68+
69+
When the app opens:
70+
71+
1. Click "Work Offline"
72+
2. Start drawing
73+
3. Close and reopen the app
74+
4. Your drawing should be saved!
75+
76+
### 3. Test Collaboration
77+
78+
**Terminal 1** - Start server:
79+
80+
```bash
81+
./start-server.sh
82+
```
83+
84+
**Terminal 2** - Start first app instance:
85+
86+
```bash
87+
./start-app.sh
88+
```
89+
90+
- Click "Connect to Server"
91+
- Enter URL: `http://localhost:3002`
92+
- Enter room ID: `test-room`
93+
- Start drawing
94+
95+
**Terminal 3** - Start second app instance:
96+
97+
```bash
98+
cd excalidraw-app
99+
npm run tauri dev
100+
```
101+
102+
- Click "Connect to Server"
103+
- Enter URL: `http://localhost:3002`
104+
- Enter room ID: `test-room`
105+
- You should see the other user's drawings!
106+
107+
## Repository Structure
108+
109+
```
110+
/excalidraw-app/ (root)
111+
112+
├── excalidraw-app/ # Tauri desktop application
113+
│ ├── src/
114+
│ │ ├── components/
115+
│ │ │ ├── ConnectionDialog.tsx
116+
│ │ │ ├── ConnectionDialog.css
117+
│ │ │ └── ExcalidrawWrapper.tsx
118+
│ │ ├── lib/
119+
│ │ │ ├── api.ts
120+
│ │ │ ├── storage.ts
121+
│ │ │ └── websocket.ts
122+
│ │ ├── App.tsx
123+
│ │ └── main.tsx
124+
│ ├── src-tauri/
125+
│ │ ├── src/
126+
│ │ │ ├── commands.rs
127+
│ │ │ ├── db.rs
128+
│ │ │ └── lib.rs
129+
│ │ └── Cargo.toml
130+
│ └── package.json
131+
132+
├── excalidraw-server/ # Go collaboration server
133+
│ ├── handlers/
134+
│ │ ├── api/
135+
│ │ │ └── documents/
136+
│ │ │ └── documents.go
137+
│ │ └── websocket/
138+
│ │ └── collab.go
139+
│ ├── stores/
140+
│ │ ├── storage.go
141+
│ │ ├── memory/
142+
│ │ ├── filesystem/
143+
│ │ └── sqlite/
144+
│ ├── core/
145+
│ │ └── entity.go
146+
│ ├── main.go
147+
│ ├── go.mod
148+
│ └── .env.example
149+
150+
├── start-server.sh
151+
├── start-app.sh
152+
├── README.md
153+
└── .gitignore
154+
```
155+
156+
## Key Features Implemented
157+
158+
### Desktop App
159+
160+
- ✅ Connection dialog on startup
161+
- ✅ Local SQLite storage
162+
- ✅ Auto-save (1 second debounce)
163+
- ✅ Server connection support
164+
- ✅ Real-time collaboration
165+
- ✅ Offline mode
166+
167+
### Server
168+
169+
- ✅ WebSocket collaboration via Socket.IO
170+
- ✅ Room-based collaboration
171+
- ✅ User presence tracking
172+
- ✅ Document save/load API
173+
- ✅ Configurable storage backends
174+
- ✅ Clean, minimal codebase
175+
176+
## Next Steps
177+
178+
1. **Test the basics**: Follow the test steps above
179+
2. **Customize**: Modify server config in `.env`
180+
3. **Deploy**: Follow deployment guides in READMEs
181+
4. **Develop**: Add your own features!
182+
183+
## Troubleshooting
184+
185+
### Server won't start
186+
187+
- Check Go is installed: `go version`
188+
- Check port 3002 is free: `lsof -i :3002`
189+
190+
### App won't start
191+
192+
- Check Node.js is installed: `node --version`
193+
- Check Rust is installed: `cargo --version`
194+
- Try: `cd excalidraw-app && npm install`
195+
196+
### Build errors in Rust
197+
198+
- Install/update Rust: `rustup update`
199+
- On Linux, install webkit: `sudo apt install libwebkit2gtk-4.1-dev`
200+
201+
### Can't connect to server
202+
203+
- Verify server is running
204+
- Check URL is correct: `http://localhost:3002`
205+
- Check firewall isn't blocking port 3002
206+
207+
## What Changed From Original Code
208+
209+
### Removed
210+
211+
- ❌ All Firebase code and dependencies
212+
- ❌ Firebase-compatible API endpoints
213+
- ❌ AWS S3 storage backend
214+
- ❌ Frontend embedding in server
215+
- ❌ Firestore URL patching
216+
217+
### Added
218+
219+
- ✅ Clean WebSocket-only collaboration
220+
- ✅ Tauri desktop app
221+
- ✅ Local SQLite storage
222+
- ✅ Connection dialog
223+
- ✅ Auto-save functionality
224+
- ✅ Comprehensive documentation
225+
226+
### Reorganized
227+
228+
- ✅ Moved Socket.IO to `handlers/websocket/collab.go`
229+
- ✅ Cleaned up `main.go`
230+
- ✅ Updated module name to `excalidraw-server`
231+
- ✅ Simplified CORS for localhost only
232+
233+
Enjoy your clean, self-hosted Excalidraw setup! 🎨

0 commit comments

Comments
 (0)