A powerful open-source web application for visualizing ClickHouse table relationships using Mermaid.js diagrams. Browse databases and tables with an intuitive interface, explore table metadata with optional row counts and size information, and export interactive schema diagrams.
- π Browse ClickHouse databases and tables with an intuitive interface
- π Visualize table relationships with Mermaid.js diagrams
- π¨ Color-coded icons matching table types for better visualization
βοΈ View direction of data flow between tables- π Collapsible table types legend for a cleaner interface
- π Toggle metadata visibility (table rows and size information)
- πΎ Export diagrams as standalone HTML files
- π Secure connection to ClickHouse with TLS support
- π± Responsive web interface for all devices
- Backend: Golang with Gin framework
- Frontend: HTML, CSS, and JavaScript with Mermaid.js
- Database: ClickHouse
- Docker and Docker Compose
- ClickHouse server
-
Pull the container from GitHub Container Registry:
docker pull ghcr.io/fulgerx2007/clickhouse-schemaflow-visualizer:latest
-
Create a
.envfile with your ClickHouse connection details (see configuration example below) -
Run the container:
docker run -p 8080:8080 --env-file .env ghcr.io/fulgerx2007/clickhouse-schemaflow-visualizer:latest
-
Access the web interface at http://localhost:8080
-
Clone the repository:
git clone https://github.com/fulgerX2007/clickhouse-schemaflow-visualizer.git cd clickhouse-schemaflow-visualizer -
Start the application:
docker-compose up -d
-
Access the web interface at http://localhost:8080
-
Clone the repository:
git clone https://github.com/fulgerX2007/clickhouse-schemaflow-visualizer.git cd clickhouse-schemaflow-visualizer -
Configure the
.envfile with your ClickHouse connection details:# ClickHouse Connection Settings CLICKHOUSE_HOST=localhost CLICKHOUSE_PORT=9000 CLICKHOUSE_USER=default CLICKHOUSE_PASSWORD= CLICKHOUSE_DATABASE=default # ClickHouse TLS Settings CLICKHOUSE_SECURE=false CLICKHOUSE_SKIP_VERIFY=false # CLICKHOUSE_CERT_PATH=/path/to/cert.pem # CLICKHOUSE_KEY_PATH=/path/to/key.pem # CLICKHOUSE_CA_PATH=/path/to/ca.pem # CLICKHOUSE_SERVER_NAME=clickhouse.example.com # Web Interface Settings SERVER_ADDR=:8080 GIN_MODE=debug -
Install Go dependencies:
cd backend go mod download -
Run the application:
go run main.go
-
Access the web interface at http://localhost:8080
- The left panel displays all available databases and tables
- Click on a database to expand/collapse its tables
- Click on a table to view its schema
- Use the "Show Metadata" toggle switch below the Table Types section
- When enabled, displays table statistics (row count and size) under each table name
- Metadata is hidden by default for a cleaner interface
- Your preference is automatically saved and restored
- Select a table to see its relationships with other tables
- The diagram shows the table structure and relationships
- Click "Export HTML" to save the current diagram as an HTML file
The application analyzes ClickHouse table structures by querying system tables:
system.tablesto get tables in each database and determine their types
Relationships between tables are determined based on column names:
- Direction of data flow is determined automatically for:
- distributed tables
- materialized views
- replicated tables
- regular tables
- dictionaries
clickhouse-schemaflow-visualizer/
βββ api/ # API handlers
β βββ handlers.go # API endpoint implementations
βββ assets/ # Project assets
β βββ screenshots/ # Screenshots for documentation
βββ config/ # Configuration handling
β βββ config.go # Environment configuration loader
βββ models/ # Data models and ClickHouse client
β βββ clickhouse.go # ClickHouse connection and schema handling
βββ static/ # Frontend static files
β βββ css/ # CSS styles
β β βββ styles.css # Main stylesheet
β βββ html/ # HTML templates
β β βββ index.html # Main application page
β βββ img/ # Images and icons
β βββ js/ # JavaScript code
β βββ app.js # Main application logic
βββ .env.example # Example environment configuration
βββ docker-compose.yml # Docker Compose configuration
βββ Dockerfile # Docker build instructions
βββ go.mod # Go module dependencies
βββ go.sum # Go module checksums
βββ main.go # Application entry point
βββ README.md # Documentation
-
Build the Docker image:
docker build -t clickhouse-schemaflow-visualizer . -
Run the container:
docker run -p 8080:8080 --env-file .env clickhouse-schemaflow-visualizer
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.


