22
33A modern, real-time web application for visualizing and analyzing network traffic flows within Tailscale networks.
44
5- ## Architecture Overview
6-
7- TSFlow uses a ** Go backend + React frontend** architecture for optimal performance and security:
8-
9- ```
10- ┌─────────────────┐ ┌─────────────────┐ ┌──────────────────┐
11- │ React App │ │ Go Backend │ │ Tailscale API │
12- │ (Frontend) │◄──►│ (Gin Server) │◄──►│ api.tailscale. │
13- │ │ │ │ │ com │
14- └─────────────────┘ └─────────────────┘ └──────────────────┘
15- ```
16-
175## Features
186
197** Network Topology Visualization**
@@ -53,29 +41,11 @@ TSFlow uses a **Go backend + React frontend** architecture for optimal performan
5341
5442### Prerequisites
5543- Tailscale API key with appropriate permissions
56- - Docker (recommended) or Go 1.21+ and Node.js 18+
57-
58- ### Using Docker Compose
59-
60- ``` bash
61- # Create environment file
62- cp env.example .env
63- # Edit .env with your Tailscale credentials
64-
65- # Run with Docker Compose
66- docker-compose up -d
67-
68- # View logs
69- docker-compose logs -f tsflow
70- ```
71-
72- Navigate to ` http://localhost:8080 ` to access the dashboard.
73-
74- ## Deployment Options
44+ - Docker
7545
76- ### Docker Deployment
46+ ### Run with Docker
7747
78- #### Using Pre -built Images
48+ The fastest way to get started using pre -built images:
7949
8050``` bash
8151docker run -d \
@@ -88,12 +58,42 @@ docker run -d \
8858 ghcr.io/rajsinghtech/tsflow:latest
8959```
9060
61+ ## Architecture Overview
62+
63+ TSFlow uses a ** Go backend + React frontend** architecture for optimal performance and security:
64+
65+ ```
66+ ┌─────────────────┐ ┌─────────────────┐ ┌──────────────────┐
67+ │ React App │ │ Go Backend │ │ Tailscale API │
68+ │ (Frontend) │◄──►│ (Gin Server) │◄──►│ api.tailscale. │
69+ │ │ │ │ │ com │
70+ └─────────────────┘ └─────────────────┘ └──────────────────┘
71+ ```
72+
73+ Navigate to ` http://localhost:8080 ` to access the dashboard.
74+
9175** Available image tags:**
9276- ` latest ` - Latest stable release from main branch
9377- ` <version> ` - Tagged releases (e.g., ` v1.0.0 ` )
9478- ` <commit-sha> ` - Specific commit builds
9579
96- #### Using Docker Compose
80+ ## Deployment Options
81+
82+ ### Using Docker Compose
83+
84+ For more complex setups or persistent configuration:
85+
86+ ``` bash
87+ # Create environment file
88+ cp env.example .env
89+ # Edit .env with your Tailscale credentials
90+
91+ # Run with Docker Compose
92+ docker-compose up -d
93+
94+ # View logs
95+ docker-compose logs -f tsflow
96+ ```
9797
9898Create a ` docker-compose.yml ` file:
9999
@@ -252,43 +252,6 @@ For developers who want to build and run TSFlow locally:
252252| ` PORT ` | Backend server port | No | ` 8080 ` |
253253| ` ENVIRONMENT ` | Runtime environment | No | ` development ` |
254254
255- ## Project Structure
256-
257- ```
258- tsflow/
259- ├── backend/ # Go backend server
260- │ ├── main.go # Main server entry point
261- │ ├── go.mod # Go module definition
262- │ ├── internal/ # Internal packages
263- │ │ ├── config/ # Configuration management
264- │ │ ├── handlers/ # HTTP request handlers
265- │ │ └── services/ # Business logic services
266- │ └── README.md # Backend documentation
267- ├── frontend/ # React frontend application
268- │ ├── src/ # Source code
269- │ │ ├── components/ # Reusable UI components
270- │ │ ├── pages/ # Page components
271- │ │ ├── lib/ # Utilities and API client
272- │ │ └── types/ # TypeScript definitions
273- │ ├── package.json # Frontend dependencies
274- │ └── dist/ # Built frontend (after build)
275- ├── docker-compose.yml # Docker Compose configuration
276- ├── Dockerfile # Multi-stage Docker build
277- ├── .env # Environment variables
278- └── README.md # This file
279- ```
280-
281- ## API Endpoints
282-
283- The Go backend exposes the following REST API endpoints:
284-
285- | Endpoint | Method | Description |
286- | ----------| --------| -------------|
287- | ` /health ` | GET | Health check endpoint |
288- | ` /api/devices ` | GET | List all Tailscale devices |
289- | ` /api/network-logs ` | GET | Fetch network logs with time range |
290- | ` /api/network-map ` | GET | Get network topology data |
291-
292255** Example API calls:**
293256``` bash
294257# Health check
@@ -301,41 +264,6 @@ curl http://localhost:8080/api/devices
301264curl " http://localhost:8080/api/network-logs?start=2024-12-19T10:00:00Z&end=2024-12-19T10:10:00Z"
302265```
303266
304- ## Troubleshooting
305-
306- ### No Network Logs Showing
307-
308- 1 . ** Enable logging** : Network logging must be enabled in [ Tailscale admin console] ( https://login.tailscale.com/admin/logs )
309- 2 . ** Check permissions** : API key needs ` logs:read ` permission
310- 3 . ** Recent activity** : Try a shorter time range - logs may only be available for recent activity
311- 4 . ** Backend logs** : Check ` docker-compose logs tsflow ` for error messages
312-
313- ### API Connection Issues
314-
315- 1 . ** Check credentials** : Verify API key and tailnet name in ` .env ` file
316- 2 . ** Test backend directly** :
317- ``` bash
318- curl -H " Authorization: Bearer your-api-key" \
319- " https://api.tailscale.com/api/v2/tailnet/your-tailnet/devices"
320- ```
321- 3 . ** Backend health** : Ensure backend is running: ` curl http://localhost:8080/health `
322- 4 . ** Environment variables** : Verify ` .env ` file is properly loaded
323-
324- ### Docker Issues
325-
326- 1 . ** Environment file** : Ensure ` .env ` file exists and contains correct values
327- 2 . ** Port conflicts** : Make sure port 8080 is available
328- 3 . ** Build cache** : Try ` docker-compose build --no-cache ` for clean rebuild
329- 4 . ** Container logs** : Check ` docker-compose logs tsflow ` for detailed error messages
330-
331- ### Development Issues
332-
333- 1 . ** Go dependencies** : Run ` go mod download ` in backend directory
334- 2 . ** Frontend build** : Run ` npm run build ` in frontend directory
335- 3 . ** Port conflicts** : Backend runs on 8080, ensure it's available
336- 4 . ** API connectivity** : Backend must be able to reach api.tailscale.com
337-
338-
339267---
340268
341269Built with ❤️ for the Tailscale community
0 commit comments