How ssheralievichd/online-printer-bot works
Online Printer Bot accepts WhatsApp document and image orders, calculates pricing, collects a manually verified Dushanbe City transfer, and prints approved jobs through CUPS. The main workflow is coordinated by the message handler, which manages order state and invokes file, payment, and printer services; the bot connects that handler to WhatsApp. The README documents the manual payment and admin-approval stages. The graph reflects sampled source and README evidence; it does not assume an automated payment-provider integration.
Main entry points: message.js Message and commands · printer.js Print and status service · bot.js Bot connection · file.js File validation and storage
Components 14
WhatsApp interaction
- Bot connection
src/bot.js - Message and commands
src/handlers/message.js
Order processing
- Order session state
src/sessions/manager.js - File validation and storage
src/utils/file.js - Order pricing
src/handlers/message.js
Payment and printing
- Payment code and details
src/services/payment.js - Manual card transfer
- Print and status service
src/services/printer.js - CUPS printer
Runtime configuration
- Application settings
src/config.js - Application entry
src/index.js
Other components
- Customer
- Admin
Connections 18
- Customer → WhatsApp: sends messages
README.md - WhatsApp → Bot connection: delivers events
src/bot.js - Application entry → Bot connection: starts
src/index.js - Bot connection → Message and commands: dispatches messages
src/bot.js - Message and commands → WhatsApp: sends replies
src/handlers/message.js - Message and commands → Order session state: reads and updates
src/handlers/message.js - Message and commands → File validation and storage: validates and saves
src/handlers/message.js - Message and commands → Order pricing: calculates totals
src/handlers/message.js - Order pricing → File validation and storage: counts pages
src/handlers/message.js - Message and commands → Payment code and details: gets payment details
src/handlers/message.js - Customer → Manual card transfer: transfers exact amount
README.md - Manual card transfer → Admin: appears in transaction history
README.md - Admin → Message and commands: confirms or rejects
README.md - Message and commands → Print and status service: checks and prints files
src/handlers/message.js - Print and status service → CUPS printer: runs print commands
src/services/printer.js - Payment code and details → Application settings: reads card settings
src/services/payment.js - Print and status service → Application settings: reads printer settings
src/services/printer.js - File validation and storage → Application settings: reads upload settings
src/utils/file.js