Skip to content

ChitUI: A local bridge to resin printers

ChitUI places a browser interface in front of SDCP resin printers. A Python process serves the web assets, discovers printers on the local network and translates browser actions into printer communication.

Application and services Fork API Docker Workflow
  • Updated
  • JavaScript · 48.61%
SDCP 3.0DockerBrowser UILocal network Upstream credited
Repository languagesJavaScript 48.61%5

Shares calculated from GitHub Linguist bytes.

Language%Bytes
JavaScript48.61%21,743
HTML24.57%10,991
Python22.86%10,226
CSS3.51%1,572
Dockerfile0.45%200

GitHub · README · Language statistics

Overview

Why it exists

Full-featured web control interface for Chitubox SDCP 3.0 resin printers with LAN UDP discovery.

Best fit

Headless remote management and real-time print monitoring for SLA 3D printers.

Getting started

These commands come from the repository documentation. They were not run during this review.

README.md · Setup
python -mvenv .venv
source .venv/bin/activate
pip install -r requirements.txt
README.md · Usage
python main.py
README.md · Docker
docker build -t chitui:latest .
docker run --rm --name chitui --net=host chitui:latest

Repository references

Excerpts from the repository’s guides, in their original language. Links open the inspected source revision.

Configuration and usage

Usage

README.md

After creating the virtual environment and installing the requirements, you can run ChitUI like this:
Read the full instructions ↗

Configuration

README.md

Configuration is done via environment variables:

  • PORT to set the HTTP port of the web interface (default: 54780)
  • DEBUG to enable debug logging, log colorization and code reloading (default: False)
Read the full instructions ↗
Source documentation

1 documents read from 1 candidates.

Features and components 2

Browser and local server
main.py builds a Flask application with web as its static folder and attaches Flask-SocketIO. Printer and WebSocket registries live in process memory. Discovery uses the local network, which explains the README’s Docker host-network requirement.
File transfer
The upload route validates the extension and saves the incoming file temporarily. The printer upload helper calculates an MD5 checksum and sends one-megabyte parts with offsets. A separate event-stream route reports upload progress.

Architecture

The components and their connections remain available as text. The diagram adds an interactive view.

System context Context
  1. Browser UI
  2. Flask and SocketIO
  3. Printer discovery and session
  4. SDCP printer

Links verified in the repository.

Mermaid Interactive diagram (loads on open)

System overview of the components and connections verified in the repository.

Static architecture view for ChitUI
Static preview. The interactive diagram replaces it after Mermaid loads.
flowchart LR

subgraph group_server["Server and discovery"]
  node_app["HTTP and Socket.IO server<br/>[main.py]"]
  node_discovery["Printer discovery<br/>[main.py]"]
  node_upload["File upload handling<br/>[main.py]"]
  node_transfer["Printer file transfer<br/>[main.py]"]
end

subgraph group_printer["Printer communication"]
  node_commands["SDCP commands<br/>[main.py]"]
  node_connection["Printer WebSocket connection<br/>[main.py]"]
end

subgraph group_webui["Browser interface"]
  node_index["Web page entry<br/>[index.html]"]
  node_ui["Printer dashboard and actions<br/>[chitui.js]"]
  node_protocol["SDCP constants<br/>[sdcp.js]"]
  node_theme["Theme preferences<br/>[color-modes.js]"]
end

node_user(("Operator"))
node_browser(("Web browser"))
node_printer["SDCP printer"]

node_user -->|"uses"| node_browser
node_browser -->|"opens interface"| node_app
node_app -->|"serves"| node_index
node_user -->|"operates"| node_ui
node_ui -->|"sends events"| node_app
node_app -->|"emits updates"| node_ui
node_app -->|"runs discovery"| node_discovery
node_discovery -->|"broadcasts discovery"| node_printer
node_app -->|"connects printers"| node_connection
node_connection -->|"opens WebSocket"| node_printer
node_app -->|"dispatches requests"| node_commands
node_commands -->|"sends SDCP"| node_printer
node_printer -->|"sends messages"| node_connection
node_connection -->|"routes printer events"| node_app
node_browser -->|"posts print file"| node_upload
node_app -->|"handles upload"| node_upload
node_upload -->|"starts transfer"| node_transfer
node_transfer -->|"uploads file"| node_printer
node_ui -->|"uses constants"| node_protocol
node_index -.->|"loads interface code"| node_ui
node_index -.->|"loads theme control"| node_theme


class node_app,node_discovery,node_upload,node_transfer,node_browser toneBlue
class node_commands,node_connection toneAmber
class node_index,node_ui,node_protocol,node_theme toneMint
class node_user,node_printer toneIndigo

A browser control panel for Chitubox SDCP 3.0 resin printers. The server discovers printers, opens WebSocket connections, routes commands and status events, and transfers uploaded print files while the browser presents printer controls.

Components
13
Connections
21
Links supported by code or README
16/21
Text version of the diagram
  • Browser UI → Flask and SocketIO
  • Flask and SocketIO → Printer discovery and session
  • Printer discovery and session → SDCP printer
  • SDCP printer → Printer discovery and session
Follow one path through the code

Follow /upload through the temporary file and the printer transfer helper. Transfer progress is global in this implementation, so simultaneous uploads would need per-job state to avoid mixing their percentages.

Workflow

Step-by-step view of the path inspected in the repository. This is not a live run.

Printer upload API

POST /upload accepts multipart fields file and printer. The printer identifier selects an entry in the discovered-printers dictionary. Supported extensions are ctb, goo and prz. The server stores a temporary file and transfers chunks to the printer’s port 3030 upload endpoint.

Access checks read from the handlers. A README label of admin appears here only when the code checks it.
MethodPathVerified access checkFile
POST/uploadNo authentication check in the inspected handler. Multipart fields file and printer are required.main.py
GET/uploadNo authentication check. The inspected handler returns 405.main.py
GET/progressNo authentication check in the inspected handler. The response is a text/event-stream shared across uploads.main.py
Request example
POST /upload
Content-Type: multipart/form-data

file: [supported print file]
printer: [identifier returned by discovery]

Response and errors

The success body is {“upload”:“success”,“msg”:“File uploaded”}. Missing file or printer fields and unsupported extensions return 400. GET /upload returns 405. GET /progress streams text/event-stream updates.
Verify the file on the printer after a transfer. The helper sets progress to 100 and returns true even after a failed part causes the loop to break. A success response alone therefore does not prove delivery. The calculation also divides by the number of whole 1 MiB chunks, which is zero for files smaller than 1 MiB.
Authentication, limits and pagination

The inspected handlers have no authentication or rate limiter. Keep this interface on a trusted network. Progress is shared globally across uploads, so it cannot identify concurrent jobs. Pagination does not apply to this upload operation.

Deployment and operations

The ports, storage, and startup relationships below come from the repository configuration. depends_on records startup order, not service readiness.

Network. Host network (--net=host), requested in the README so UDP broadcast can reach the LAN.

File structure

The map shows the inspected files and their organization.

Reference

6 / 6 eligible files read (31 in the tree); 0 oversized, 0 failed reads and 0 syntax diagnostics.

What the scan covers

Known dependency/build folders, credential files and binaries are excluded. The scan covers READMEs, recognized manifests and parser-supported source files.

Linguist statistics cover the whole repository and may include other languages.

File map
flowchart TD
  root["ChitUI"]
  f0["main.py"]
  root --> f0
  f1["requirements.txt"]
  root --> f1
  f2["README.md"]
  root --> f2
  f3["web/js/chitui.js"]
  root --> f3
  f4["web/js/color-modes.js"]
  root --> f4
  f5["web/js/sdcp.js"]
  root --> f5

Files to read 3

References