Cloud-native backend for TAK Lite. Purpose-built to bridge disconnected meshes and provide online visibility for teams using the TAK Lite app. Includes first‑run setup, authentication, real‑time sync, and a lightweight admin dashboard.
TAK-Lite Server provides an internet-enabled synchronization backbone for all TAK-Lite clients, and provides command and control capabilities to a desktop-based operator interacting with the server-side dashboard. Clients still benefit from the mesh network synchronization in the field, but get additional situational awareness from a remote operator monitoring the operating area.
Recommended: The "Deploy to DO" button provides the fastest setup with a Dev Database including SSL certificates. For production databases with monitoring alerts, use Option 3 below.
# Clone the repository
git clone https://github.com/medentem/tak-lite-server.git
cd tak-lite-server
# Start the application
docker compose up -d
# Complete setup
open http://localhost:3000/setup# Install dependencies
npm install
# Set up environment
cp .env.example .env
# Edit .env with your database URL
# Run migrations
npm run db:migrate
# Start development server
npm run dev- Admin Dashboard:
http://localhost:3000/admin- Complete admin interface - Setup Wizard:
http://localhost:3000/setup- First-run configuration - Real-time Sync: WebSocket-based location, annotation, and message sync
- REST API: Full API for authentication, sync, and admin operations
- Health Monitoring:
GET /healthandGET /metricsendpoints
# Login
POST /api/auth/login
{ "email": "user@example.com", "password": "password" }
# Get user info
GET /api/auth/whoami
Authorization: Bearer <token># Send location update
POST /api/sync/location
{
"teamId": "uuid",
"latitude": 37.7749,
"longitude": -122.4194,
"timestamp": 1640995200000
}// Connect and authenticate
const socket = io('http://localhost:3000', {
auth: { token: 'your-jwt-token' }
});
// Join a team room for real-time updates
socket.emit('team:join', 'team-uuid');
// Send location update (broadcasts to team room)
socket.emit('location:update', {
teamId: 'uuid',
latitude: 37.7749,
longitude: -122.4194,
timestamp: Date.now()
});
// Listen for real-time updates from team members
socket.on('location:update', (data) => {
console.log('Team member location:', data);
});
// Listen for admin events (admin users only)
socket.on('admin:stats_update', (stats) => {
console.log('Live server stats:', stats);
});Here's how the REST API and WebSocket service work together:
// 1. Initial app startup - use REST API for data sync
const response = await fetch('/api/sync/locations/last?teamId=uuid', {
headers: { 'Authorization': `Bearer ${token}` }
});
const lastLocations = await response.json();
// 2. Connect to WebSocket for real-time updates
const socket = io('http://localhost:3000', { auth: { token } });
socket.emit('team:join', 'uuid');
// 3. Send updates via WebSocket (preferred for real-time)
socket.emit('location:update', { teamId: 'uuid', latitude: 37.7749, longitude: -122.4194 });
// 4. Fallback to REST API if WebSocket fails
socket.on('disconnect', async () => {
// Queue updates and sync via REST when reconnected
await fetch('/api/sync/location', {
method: 'POST',
headers: { 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json' },
body: JSON.stringify({ teamId: 'uuid', latitude: 37.7749, longitude: -122.4194 })
});
});TAK Lite Server provides both REST API and WebSocket services that work together to support different client needs:
- Purpose: Initial sync, offline support, and traditional API operations
- Authentication: JWT tokens in
Authorization: Bearer <token>header - Rate Limiting: 120 requests/minute per IP
- Use Cases:
- App startup and initial data sync
- Offline operation with batch sync
- Admin operations and configuration
- Health checks and monitoring
- Purpose: Real-time updates and live collaboration
- Authentication: JWT tokens in connection auth or headers
- Team Rooms: Dynamic team-based communication channels
- Use Cases:
- Live location tracking
- Real-time annotation updates
- Instant messaging
- Admin dashboard live monitoring
Both APIs use the same SyncService for core operations:
- Location updates → Database storage + team broadcasting
- Annotation management → Validation + real-time sync
- Message handling → Team-based communication
- Team operations → Membership validation
- Team Rooms: Clients join
team:${teamId}rooms for team-specific updates - Admin Monitoring: Live statistics and connection tracking
- Broadcast Updates: Changes are instantly pushed to all team members
- Connection Management: Automatic reconnection and authentication
- HTTP API: Express.js with JWT authentication
- Real-time Sync: Socket.IO for live location/annotation updates
- Database: PostgreSQL with automatic migrations
- Admin Interface: Modular ES6-based dashboard with component architecture
- Page modules: Dashboard, Settings, Management, Threats, Messages
- Shared utilities and services for code reuse
- Modular CSS structure for maintainability
- Security: Rate limiting, CORS, and admin-only routes
Perfect for: Most users who want the fastest setup
- Click the "Deploy to DO" button above (or use this link: Deploy to DigitalOcean)
- Follow the setup wizard in DigitalOcean
- Complete setup at
https://your-app-url.ondigitalocean.app/setup
Cost: $20/month | Time: 2 minutes | Features: Dev Database with SSL certificates
Perfect for: Users who want more control over the deployment
- Go to DigitalOcean App Platform
- Click "Create App" → Connect GitHub → Select your repository
- Configure Service: Dockerfile, Port 3000, Basic plan ($5/month)
- Add Database: PostgreSQL, Basic plan ($15/month)
- Set Environment Variables:
NODE_ENV=productionJWT_SECRET=your-secret-key-hereCORS_ORIGIN=*
- Deploy and wait 5-10 minutes
- Complete Setup: Visit
https://your-app-url.ondigitalocean.app/setup
Cost: $27/month | Time: 10 minutes | Features: All essential features included
Perfect for: Technical users who need monitoring alerts and custom configurations
# Install doctl CLI
brew install doctl # macOS
# or: snap install doctl # Linux
# Authenticate
doctl auth init
# Deploy with full features (monitoring alerts, custom ingress)
./deploy-with-doctl.shCost: $27/month | Time: 5 minutes | Features: All features including monitoring alerts
Perfect for: Users who want full control and lower costs
# Create a DigitalOcean Droplet (Ubuntu 22.04, 2GB RAM minimum)
# SSH into your droplet
ssh root@your-droplet-ip
# Install Docker
curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh
# Clone and deploy
git clone https://github.com/medentem/tak-lite-server.git
cd tak-lite-server
docker compose up -d
# Complete setup at http://your-droplet-ip:3000/setupCost: $12/month | Time: 30 minutes | Features: Full control, manual SSL setup needed
| Variable | Required | Default | Description |
|---|---|---|---|
NODE_ENV |
Yes | development |
Environment mode |
DATABASE_URL |
Yes | - | PostgreSQL connection string |
JWT_SECRET |
Yes | - | Secret for JWT token signing |
JWT_EXPIRES_IN |
No | 7d |
JWT token expiration |
CORS_ORIGIN |
No | * |
Allowed CORS origins |
LOG_LEVEL |
No | info |
Logging level |
PORT |
No | 3000 |
Server port |
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
This project is licensed under the GPL‑3.0 License — see the LICENSE file for details.
- Issues: GitHub Issues
