A terminal-based peer-to-peer whiteboard collaboration platform built with OCaml, featuring real-time synchronization.
This project creates a collaborative whiteboard that allows multiple users to connect over a network and draw together in real-time. The application runs entirely in the terminal using text-based graphics.
Before running the application, ensure you have the following installed:
- OCaml (version 4.13 or later)
- OPAM (OCaml package manager)
- Dune (build system)
The following packages are automatically installed when you build the project:
notty- Terminal graphics librarynottui- Terminal UI frameworklwd- Lightweight widgetsluv- Async I/O libraryyojson- JSON handlinglwt- Asynchronous programmingcohttp-lwt-unix- HTTP client/serveruri- URI handlingcmdliner- Command-line parsingsqlite3- Database support
-
Clone or navigate to the project directory:
cd /path/to/peerboard -
Install dependencies:
opam install --deps-only . eval $(opam env)
-
Build the project:
dune build
Run the application with default settings:
_build/default/bin/main.exeThis starts the whiteboard with:
- Port: 8080
- Canvas size: 80x30 characters
- Multicast group: 239.0.0.1
View all available options:
_build/default/bin/main.exe --help-
-p PORT, --port=PORT(default: 8080)
Network port for P2P communication -
-w WIDTH, --width=WIDTH(default: 80)
Canvas width in characters -
--height=HEIGHT(default: 30)
Canvas height in characters -
--bridge-mode
Enable bridge mode for external communication -
-c FILE, --config=FILE
Specify a configuration file path
# Custom port and canvas size
_build/default/bin/main.exe --port 9000 --width 100 --height 40
# Large canvas for detailed drawings
_build/default/bin/main.exe --width 120 --height 50
# Different network port
_build/default/bin/main.exe --port 8081Once the application is running, you can use these controls:
- Arrow Keys - Move cursor around the canvas
- Tab/Shift+Tab - Switch between panels (Canvas/Chat/Menu)
- Space/Enter - Draw with current tool at cursor position
- 1-5 - Select drawing tools:
- 1: Pen
- 2: Line
- 3: Rectangle
- 4: Circle
- 5: Text
- F1-F8 - Select colors:
- F1: Black
- F2: Red
- F3: Green
- F4: Yellow
- F5: Blue
- F6: Magenta
- F7: Cyan
- F8: White
- h - Toggle help display
- Ctrl+L - Clear canvas
- Ctrl+Q - Quit application
/help- Show help information
The application automatically:
- Broadcasts your presence to other peers on the network
- Synchronizes drawing actions in real-time
- Maintains a list of connected peers
- Uses multicast for peer discovery
-
"Nested calls to Lwt_main.run are not allowed"
- This is a known issue that has been addressed in the latest version
- The application should still start and function properly
-
Network connectivity issues:
- Ensure the port (default 8080) is not blocked by firewall
- Check that multicast is enabled on your network
- Try using a different port with
--port
-
Build errors:
- Make sure all dependencies are installed:
opam install --deps-only . - Update your environment:
eval $(opam env) - Clean and rebuild:
dune clean && dune build
- Make sure all dependencies are installed:
-
Terminal display issues:
- Ensure your terminal supports UTF-8 encoding
- Use a terminal with good Unicode support for best results
- Press
hin the application to see built-in help - Use
--helpflag to see command-line options - Check the terminal output for status messages
peerboard/
├── bin/ # Main executable
├── lib/ # Core library modules
├── lib/ui_module/ # User interface components
├── docs/ # Documentation
└── _build/ # Build artifacts (ignored in git)
# Clean build
dune clean
# Build with verbose output
dune build --verbose
# Build and run tests
dune runtest- LLM/Ollama integration has been disabled in this version for simplicity
- Storage features are currently simplified
- The application is designed for terminal use - no graphical interface needed
- Supports multiple simultaneous users on the same network
Current version: 0.1.0
For more information or issues, check the project documentation or source code.