Offline-first emergency communications platform for text chat, voice/PTT, file sharing, and location tracking.
- π¬ Real-time Chat: Multiple chat rooms with persistent message history
- π€ Voice/PTT: WebRTC-based Push-to-Talk voice channels (Ham radio compliant - no encryption)
- π Location Sharing: Share GPS coordinates with offline maps
- πΌοΈ Image Sharing: Upload and share images inline in chat
- π File Sharing: Upload and download files with web-based file browser
- π₯ User Management: Nickname-based identification with blocking capabilities
- π Admin Controls: Create/delete rooms, kick users, delete messages
- ποΈ Auto-Cleanup: Configurable message retention (1-7 days)
- π« Content Filtering: Built-in profanity filter
- πΊοΈ Offline Maps: Support for locally-hosted map tiles
- π₯οΈ Desktop Apps: Native Windows and Linux applications with built-in voice support
β
Push-to-Talk - Hold to transmit, release to listen
β
Active Speaker Indicators - See who's talking with visual feedback
β
Channel Collision Detection - PTT disabled when channel is busy
β
Participant Lists - Real-time list of users in voice channel
β
Ham Radio Compliant - No encryption, plain WebRTC audio
β
Desktop & Browser Support - Works on both platforms
- Node.js 14+ (18+ recommended)
- 2GB RAM minimum
- 32GB storage (recommended for map tiles and uploads)
- Linux-based SBC (Raspberry Pi 4/5, Orange Pi, etc.) or any computer
- π Offline Maps: Support for locally-hosted map tiles
Simple login screen lets users pick a name or enter a call sign
Simple Chat interface with image support, Admin created rooms basic file sharing, and direct messaging.
Easy to use with core functions of modern messaging included.
Locations are shareable from device or manualy and can used predownloaded map tiles for 100% offline location services.
Users can choose to share their location if they need help or help people locate eachother.
# Install Node.js if not already installed (on Debian/Ubuntu)
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs
# Clone/download the project
cd EmcommChat
# Install dependencies
npm installEdit config.js to customize your deployment:
module.exports = {
server: {
port: 3000,
host: '0.0.0.0' // Listen on all interfaces
},
admin: {
username: 'admin',
password: 'CHANGE_THIS_PASSWORD' // β οΈ CHANGE IMMEDIATELY
},
retention: {
messageHistoryDays: 7, // Keep messages for 7 days
},
// ... other settings
};IMPORTANT: Change the default admin password before deployment!
# Start the server
npm start
# Or use a process manager (recommended for production)
npm install -g pm2
pm2 start server.js --name emcomm-chat
pm2 saveThe server will start on http://localhost:3000 (or your configured port).
Open a web browser and navigate to:
- Local:
http://localhost:3000 - Network:
http://YOUR_SERVER_IP:3000
Users can connect from any device on your network.
Desktop applications have built-in microphone access and don't require additional setup.
Download and install:
- Navigate to
http://YOUR_SERVER_IP:3000/downloads.html - Download for your platform:
- Windows:
.exeinstaller - Linux:
.AppImage(make executable withchmod +x)
- Windows:
- Run the application - it auto-connects to your server
Building desktop apps yourself:
cd desktop-app
# Install dependencies
npm install
# Build for your platform
npx electron-builder --win # Windows
npx electron-builder --linux # Linux AppImage
npx electron-builder --mac # macOS
# Outputs will be in dist/ folderFor voice/PTT in Chrome or Edge browsers:
- Open Chrome or Edge
- Navigate to:
chrome://flags/#unsafely-treat-insecure-origin-as-secure - Add your server URL:
http://YOUR_SERVER_IP:3000 - Set to "Enabled"
- Click "Relaunch" to restart browser
- Navigate to your EmComm Chat server
- Voice/PTT should now work!
Note: This setting only affects the specific URL you enter. Your browser remains secure for all other websites.
See /public/downloads.html for detailed step-by-step instructions with screenshots.
To enable offline maps, you need to download map tiles for your operating area.
- Install QGIS: https://qgis.org/
- Install QMetaTiles plugin
- Select your area of interest
- Export tiles (zoom levels 1-15 recommended)
- Copy tiles to
./map-tiles/directory
- Download MOBAC: https://mobac.sourceforge.io/
- Select "OSM Mapnik" as source
- Select your region
- Choose zoom levels 1-15
- Export in "PNG tiles" format
- Copy to
./map-tiles/{z}/{x}/{y}.pngstructure
We've included a simple tile downloader (requires Python):
# Install dependencies
pip3 install requests pillow
# Download tiles for a bounding box
# Format: python3 download-tiles.py MIN_LAT MIN_LON MAX_LAT MAX_LON MIN_ZOOM MAX_ZOOM
python3 download-tiles.py 41.8 -87.7 41.9 -87.6 10 15
# Example: Chicago area
python3 download-tiles.py 41.6 -88.0 42.0 -87.5 1 14Storage Requirements:
- Zoom 1-10: ~50MB
- Zoom 1-12: ~200MB
- Zoom 1-14: ~1GB
- Zoom 1-15: ~3-5GB (recommended for detailed local coverage)
Create a systemd service for automatic startup:
# Create service file
sudo nano /etc/systemd/system/emcomm-chat.serviceAdd the following content:
[Unit]
Description=EmComm Chat Emergency Communications Platform
After=network.target
[Service]
Type=simple
User=YOUR_USERNAME
WorkingDirectory=/home/YOUR_USERNAME/EmcommChat
ExecStart=/usr/bin/node server.js
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.targetEnable and start the service:
sudo systemctl enable emcomm-chat
sudo systemctl start emcomm-chat
sudo systemctl status emcomm-chat# Install PM2 globally
npm install -g pm2
# Start application
pm2 start server.js --name emcomm-chat
# Setup PM2 to start on boot
pm2 startup
pm2 save
# Monitor
pm2 monit
# View logs
pm2 logs emcomm-chatFor emergency communications deployment:
# Install hostapd and dnsmasq
sudo apt-get install hostapd dnsmasq
# Configure WiFi access point
# Edit /etc/hostapd/hostapd.conf
# Configure DHCP
# Edit /etc/dnsmasq.conf# Edit network configuration
sudo nano /etc/dhcpcd.conf
# Add:
interface wlan0
static ip_address=192.168.10.1/24
static routers=192.168.10.1# Allow incoming connections on port 3000
sudo ufw allow 3000/tcp
sudo ufw enable- Join Network: Enter a nickname (8-16 characters)
- Select Room: Click on a room in the Rooms tab
- Send Messages: Type and press Enter or click Send
- Share Images: Click the image icon (πΌοΈ)
- Share Location: Click the location icon (π)
- Upload Files: Go to Files tab, click Upload File
- Join Voice Channel: Click "π€ Push to Talk" in the sidebar
- Transmit: Press and hold the PTT button while speaking
- Release: Let go of the button to listen
- View Participants: See who's in the voice channel below the PTT button
- Active Speakers: Users currently talking show in green with π icon
- Leave Voice: Click "Leave Voice" button when done
PTT Tips:
- π’ Green button = Ready to transmit
- π΄ Red button = You're transmitting
- π΄ Red disabled = Channel busy (someone else talking)
- Wait for green before transmitting!
- Access Admin Panel: Click the settings icon (βοΈ)
- Login: Use configured admin credentials
- Create Rooms: Enter room name and click Create
- Kick Users: Select user from dropdown and confirm
- Delete Messages: (Currently done via database access)
EmcommChat/
βββ server.js # Main server application
βββ database.js # SQLite database layer
βββ config.js # Configuration file
βββ package.json # Node.js dependencies
βββ public/ # Frontend files
β βββ index.html # Main HTML interface
β βββ style.css # Stylesheet
β βββ app.js # Client-side JavaScript
β βββ voice.js # Voice/PTT WebRTC handler
β βββ downloads.html # Download page with setup instructions
βββ desktop-app/ # Desktop application source
β βββ main.js # Electron main process
β βββ package.json # Desktop app dependencies
βββ data/ # SQLite database (created automatically)
βββ uploads/ # File uploads (created automatically)
β βββ images/ # Image uploads
βββ map-tiles/ # Offline map tiles (you provide)
βββ README.md # This file
# If using PM2
pm2 logs emcomm-chat
# If using systemd
sudo journalctl -u emcomm-chat -f# Backup database
cp data/emcomm.db data/emcomm-backup-$(date +%Y%m%d).db
# Backup uploads
tar -czf uploads-backup-$(date +%Y%m%d).tar.gz uploads/# Clean old messages (older than 7 days)
sqlite3 data/emcomm.db "DELETE FROM messages WHERE created_at < datetime('now', '-7 days');"
# Clean old files
find uploads/ -type f -mtime +7 -delete# Check disk usage
df -h
# Check upload directory size
du -sh uploads/
# Check database size
du -sh data/- Check if server is running:
sudo systemctl status emcomm-chat - Check firewall:
sudo ufw status - Verify port is not in use:
sudo netstat -tulpn | grep 3000 - Check logs for errors
In Browser:
- Verify Chrome flags are set correctly (see Voice/PTT Setup above)
- Check microphone permissions in browser
- Open browser console (F12) and look for errors
- Verify server is accessible over HTTP (not HTTPS)
In Desktop App:
- Check system microphone permissions
- Verify app can connect to server
- Try closing and reopening the app
- Check Task Manager - ensure only one instance is running
Common Issues:
- "Unknown" on PTT button: Participant list not loading - refresh page
- Red disabled button: Someone else is talking - wait for them to finish
- Can hear myself: Should not happen - report as bug if it does
- No participant list: Check browser console for errors
Windows:
- Open Task Manager (Ctrl+Shift+Esc)
- Find "EmComm Chat" process
- Right-click β End Task
Linux:
pkill -f emcomm-chatThis issue is fixed in v2.0.0+ of the desktop apps.
- Verify tiles exist in
./map-tiles/directory - Check tile structure:
{z}/{x}/{y}.png - Verify file permissions:
chmod -R 755 map-tiles/ - Check browser console for tile load errors
- Check disk space:
df -h - Verify upload directory permissions:
chmod -R 755 uploads/ - Check file size limits in
config.js - Review server logs for errors
- Reduce message retention days in
config.js - Run manual cleanup
- Limit max concurrent connections
- Increase SBC swap space
- User authentication (beyond nicknames)
- Message encryption
- HTTPS/TLS (add nginx reverse proxy if needed)
- Protection against malicious users on the network
Voice/PTT Security:
- Audio is transmitted in plain WebRTC (no encryption)
- Compliant with Ham radio regulations (no encryption allowed)
- Anyone on the network can join voice channels
- No user verification before transmitting
For deployment scenarios where security is critical:
- Change admin password immediately
- Use behind a firewall - only allow trusted network access
- Consider adding nginx reverse proxy with basic auth
- Regularly backup the database
- Monitor for abuse using admin controls
- Restrict physical network access - trusted users only
For better performance on resource-constrained SBCs:
// In config.js
retention: {
messageHistoryDays: 1, // Reduce to 24 hours
cleanupIntervalHours: 3 // More frequent cleanup
},
uploads: {
maxFileSize: 5 * 1024 * 1024, // Reduce max file size
}Consider using:
- SQLite write-ahead logging (WAL mode)
- Nginx as reverse proxy for static file serving
- PM2 for process management and auto-restart
- β Fixed critical voiceRooms scope bug (was recreated per connection)
- β Participant lists now working correctly
- β PTT shows real usernames instead of "Unknown"
- β Active speaker indicators with green pulsing animation
- β Channel collision detection prevents talking over others
- β No audio loopback (you won't hear yourself)
- β Desktop apps with proper exit handling (no lingering processes)
- β Professional downloads page with Chrome setup instructions
- β Removed unused "Messages" tab from sidebar
- β Cleaner interface focused on essential features
- β Responsive voice panel for desktop and mobile
- β Windows and Linux builds available
- β Built-in HTTP microphone access (no Chrome flags needed)
- β Proper process cleanup on exit
- β Single instance lock prevents multiple processes
- β Auto-connects to configured server
- Mobile WebView: Voice/PTT does not work in mobile app WebView (Android/iOS)
- macOS Desktop App: Must be built on a Mac (cross-compilation not supported)
- Firefox/Safari: Limited voice support - Chrome/Edge recommended
- HTTPS Required for Mobile: Mobile browsers require HTTPS for microphone access (desktop apps bypass this)
This is a purpose-built emergency communications tool. Contributions welcome for:
- Bug fixes
- Performance improvements
- Additional offline features
- Better map tile management
- Enhanced admin controls
- Voice system improvements
MIT License - Use freely for emergency communications
For issues or questions:
- Check the troubleshooting section
- Review server logs
- Check
/public/downloads.htmlfor voice setup - Open an issue on GitHub
Built for emergency communications scenarios where traditional infrastructure may be unavailable.
Uses:
- Socket.io for real-time communication
- WebRTC for voice/PTT channels
- Leaflet.js for mapping
- SQLite for data storage
- Express.js for web server
- Electron for desktop applications