Skip to content

vividsystem/pos-todo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pos-todo

Print your ideas, todos, or whatever other text you like to a receipt printer!

Unfortunately I can't give anyone acces to my printer right now, because I need to figure out some networking-security stuff beforehand. So watch this cool demo video to see the website working! cool frontend demo video here

Features

Print via a:

  • (pretty fall-themed) website -> supports customized footer and header
  • slackbot to print slack messages

Hardware Requirements

  • a computer/raspberry pi to run the webserver
  • ESC/POS-compatible printer (connected to the previously mentioned computer)

Software Requirements

Backend

  • python
  • uv (recommended for easy setup and running)
  • cups

Frontend

  • bun

Installation

(for all instances the repo has to be cloned first)

Backend

  1. Setup a MQTT Server (you can use the docker compose for that)
  2. Setup your POS-Printer If you have a USB-Printer make a udev rule for it. For that find out your product id and vendor id using for example lsusb Then create a udev rule in /etc/udev/rules.d/99-pos-todo.rules with this content:
SUBSYSTEM=="usb", ATTRS{idVendor}=="<YOURVENDORID>", ATTRS{idProduct}=="<YOURPRODUCTID>", MODE="0664", GROUP="dialout"

make sure to replace <YOURVENDORID> and <YOURPRODUCTID> (do not use a 0x prefix. just the hex number) with your actual ids. after that do sudo service udev restart or sudo udevadm control --reload to restart udev

Frontend

cd frontend
bun i
  1. Add VITE_MQTT_SERVER="mqtt://YOURMQTTHOST" to frontend/.env

Slack

  1. Modify the manifest.json to have the correct name, etc.
  2. add your slack tockens and auth to slack/.env like so:
SLACK_CLIENT_ID=YOURSLACKCLIENTID
SLACK_CLIENT_SECRET=YOURSLACKCLIENTSECRET
SLACK_SIGNING_SECRET=YOURSLACKSIGNINGSECRET
SLACK_APP_TOKEN=YOURSLACKAPPTOKEN
SLACK_BOT_TOKEN=YOURSLACKBOTTOKEN
MQTT_HOST="mqtt://YOURHOST:YOURPORT"
cd slack
bun i

Deploying

Backend

cd backend
uv run src

Frontend

cd frontend

For testing:

bun run dev

Otherwise:

bun run build
bun run start

Slack

bun run start

Configuration (for the backend)

This file uses a .env in backend/ file for configuration

Field Type Description Required
PRINTER__PROFILE string Printer profile No
PRINTER__CONNECTION "USB" | "NETWORK" Type of connection to the printer Yes
PRINTER__USB__VENDOR_ID hex-string (no 0x prefix) Vendor ID of the USB printer Required if PRINTER__CONNECTION=USB
PRINTER__USB__PRODUCT_ID hex-string (no 0x prefix) Product ID of the USB printer Required if PRINTER__CONNECTION=USB
PRINTER__NETWORK__IP string IP address of the network printer Required if PRINTER__CONNECTION=NETWORK

Usage

  • Go to the website
  • type /pos-todo <xour text>
  • or use the Print to pos-todo shortcut on an already sent slack mesage

Acknowledgments

This project is only possible thanks to python-escpos! Go leave them a star.

License

This project is licensed under the MIT License (see LICENSE or https://opensource.org/licenses/MIT)

About

A simple web app to print your todos and messages directly to a POS Printer

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors