|
| 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