How libbygpt/printflow works
Printflow pairs a Windows desktop client with a socket-backed HTTP server. A user signs in, explicitly enables monitoring, the client observes Windows spooler metadata and syncs print jobs; optional virtual-printer capture uploads a document into the same server document flow. The server stores users, jobs and documents, extracts approved text, and can answer AI chat from document text or print activity; admin views also expose live client status. The README documents these capabilities, while several server routes and client core calls were not excerpted, so their links are cited to the README rather than implying source inspection.
Main entry points: server.py HTTP API and routes · client_window.py Client dashboard · document_processing.py Document processing · app.py App bootstrap
Components 26
Desktop client
- App bootstrap
client/printflow_client/app.py - Sign-in UI
client/printflow_client/ui/login_window.py - Client dashboard
client/printflow_client/ui/client_window.py - Admin dashboard
client/printflow_client/ui/main_window.py - API, auth, sync
client/printflow_client/core.py - Spooler monitor
client/printflow_client/services/print_monitor_service.py - Local printing
client/printflow_client/services/local_print_service.py - Virtual printer capture
client/printflow_client/services/virtual_printer_service.py
HTTP backend
- HTTP API and routes
server/server.py - Print relay
server/app/services/print_relay.py - Audit and print tasks
server/app/services/support.py
Documents and AI
- Document processing
server/app/services/document_processing.py - Text extraction
server/app/services/text_extraction.py - Document content
server/app/services/document_content.py - AI context
server/app/services/ai_context.py - AI chat
server/app/services/llm.py
Live status
- Heartbeat client
client/printflow_client/services/socket_status_client.py - Heartbeat server
server/app/services/socket_status_server.py - Length-prefixed protocol
server/app/services/socket_protocol.py
Persistence and security
- Settings and auth helpers
server/app/core/__init__.py - SQLite and ORM
server/app/db/__init__.py - Domain records
server/app/models/__init__.py - TLS configuration
server/app/services/tls.py
Other components
- Desktop user
- Windows printers
- LLM provider
Connections 31
- Desktop user → Sign-in UI: signs in
README.md - App bootstrap → Sign-in UI: shows
client/printflow_client/app.py - App bootstrap → Client dashboard: opens
client/printflow_client/app.py - App bootstrap → Admin dashboard: opens
client/printflow_client/app.py - Client dashboard → API, auth, sync: calls API
client/printflow_client/ui/client_window.py - Client dashboard → Spooler monitor: polls
client/printflow_client/ui/client_window.py - Client dashboard → Virtual printer capture: handles captures
client/printflow_client/ui/client_window.py - Spooler monitor → Windows printers: reads spooler
README.md - Spooler monitor → Client dashboard: reports jobs
client/printflow_client/services/print_monitor_service.py - API, auth, sync → HTTP API and routes: syncs metadata
README.md - Virtual printer capture → Client dashboard: delivers file
client/printflow_client/services/virtual_printer_service.py - Client dashboard → HTTP API and routes: uploads document
README.md - HTTP API and routes → Print relay: dispatches print
server/server.py - Print relay → Windows printers: prints document
- HTTP API and routes → Document processing: processes upload
server/server.py - Document processing → Text extraction: extracts text
server/app/services/document_processing.py - Text extraction → Document content: uses content rules
server/app/services/text_extraction.py - HTTP API and routes → AI context: builds chat context
server/server.py - AI context → Document processing: hydrates documents
server/app/services/ai_context.py - AI context → Document content: reads approved text
server/app/services/ai_context.py - HTTP API and routes → AI chat: requests answer
server/server.py - AI chat → LLM provider: queries model
- HTTP API and routes → Audit and print tasks: records activity
server/server.py - Client dashboard → Local printing: prints locally
client/printflow_client/ui/client_window.py - Client dashboard → Heartbeat client: starts status
client/printflow_client/app.py - Heartbeat client → Heartbeat server: sends heartbeat
README.md - Heartbeat server → Length-prefixed protocol: decodes messages
server/app/services/socket_status_server.py - HTTP API and routes → SQLite and ORM: reads and writes
server/server.py - Document processing → SQLite and ORM: stores documents
server/app/services/document_processing.py - SQLite and ORM → Domain records: maps records
server/app/db/__init__.py - HTTP API and routes → TLS configuration: configures transport
README.md