Fix MICR font path, date import, PDF button bug; clean up config; add TODO markers
- Hardcode GnuMICR.otf path in pdfService.js; remove MICR_FONT_PATH env var - Fix normalizeDate to handle MM/DD/YY (2-digit year) and return null on no match - Fix generatePdf button DOM bug: update span directly instead of overwriting textContent - Remove .env.example and NTFY_URL from docker-compose (app has no required config) - Remove redundant fonts volume mount from docker-compose (fonts bundled in image) - Mark MVP TODO items complete; add // TODO comments in source for post-MVP features - Update README: correct slot height, remove stale env var docs
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# check-printing
|
||||
|
||||
Self-hosted web app for printing checks on blank check stock. Replaces ezCheckPrinting (Halfpricesoft) — a Windows-only desktop app — with a Dockerized Node.js web app accessible on the local network.
|
||||
Self-hosted web app for printing checks on blank check stock. A Dockerized Node.js web app accessible on the local network.
|
||||
|
||||
## Stack
|
||||
|
||||
@@ -11,42 +11,11 @@ Self-hosted web app for printing checks on blank check stock. Replaces ezCheckPr
|
||||
- **Frontend:** Vanilla JS, no framework
|
||||
- **Container:** Docker Compose pulling from Docker Hub
|
||||
|
||||
## Project structure
|
||||
|
||||
```
|
||||
check-printing/
|
||||
├── src/
|
||||
│ ├── routes/
|
||||
│ │ ├── checks.js # CRUD for check records
|
||||
│ │ └── pdf.js # PDF generation endpoint
|
||||
│ ├── services/
|
||||
│ │ └── pdfService.js # PDFKit rendering, MICR line, amount-to-words
|
||||
│ ├── db/
|
||||
│ │ ├── schema.sql # SQLite schema
|
||||
│ │ └── database.js # DB connection + WAL mode
|
||||
│ └── app.js # Express app, all routes
|
||||
├── migrations/
|
||||
│ └── import-mdb.js # One-time .mdb → SQLite migration script
|
||||
├── public/
|
||||
│ ├── index.html
|
||||
│ ├── css/style.css
|
||||
│ └── js/app.js
|
||||
├── fonts/
|
||||
│ └── GnuMICR.otf
|
||||
├── docker/
|
||||
│ └── Dockerfile
|
||||
├── docker-compose.yml
|
||||
├── package.json
|
||||
└── .env.example
|
||||
```
|
||||
|
||||
## Getting started
|
||||
|
||||
### Production (Docker)
|
||||
|
||||
```bash
|
||||
cp .env.example .env
|
||||
# Edit .env with your NTFY_URL if desired
|
||||
docker compose pull
|
||||
docker compose up -d
|
||||
```
|
||||
@@ -59,7 +28,6 @@ If you have an existing ezCheckPrinting `.mdb` file, click **Import .mdb** inste
|
||||
|
||||
```bash
|
||||
npm install
|
||||
cp .env.example .env
|
||||
npm run dev # nodemon src/app.js
|
||||
```
|
||||
|
||||
@@ -85,7 +53,7 @@ The script imports account config (T100), logo (Settings), check layout (T200),
|
||||
|
||||
1. Select 1–3 checks from the ledger (checkbox column)
|
||||
2. Click **Generate PDF**
|
||||
3. A 3-up 8.5"×11" PDF opens in a new tab — three 3.667" check slots per page
|
||||
3. A 3-up 8.5"×11" PDF opens in a new tab — three 3.5" check slots per page
|
||||
4. Print from the browser; checks are marked as printed in the ledger
|
||||
|
||||
Use the **Reprint** button on printed checks to regenerate without re-marking them.
|
||||
@@ -93,8 +61,8 @@ Use the **Reprint** button on printed checks to regenerate without re-marking th
|
||||
## Check layout
|
||||
|
||||
- Page: 8.5" × 11", zero margins
|
||||
- Three slots of 3.667" each
|
||||
- MICR line at Y = 3.4" from top of slot (0.267" from bottom)
|
||||
- Three check slots of 3.5" each; remaining ~0.5" is tear-off strip
|
||||
- MICR line at 0.267" from bottom of each slot
|
||||
- MICR format: `A{routing}A {account}C {checkNo}A` (GnuMICR E-13B encoding)
|
||||
|
||||
## CI/CD
|
||||
@@ -103,11 +71,9 @@ Push to `main` triggers a GitHub Actions workflow that builds a multi-arch Docke
|
||||
|
||||
## Environment variables
|
||||
|
||||
See `.env.example`. Key variables:
|
||||
The app has no required configuration. These are set in `docker-compose.yml`:
|
||||
|
||||
| Variable | Default | Description |
|
||||
| -------- | ------- | ----------- |
|
||||
| `PORT` | `3000` | HTTP port |
|
||||
| `DB_PATH` | `data/check-printing.db` | SQLite database path |
|
||||
| `MICR_FONT_PATH` | *(see .env.example)* | Path to GnuMICR.otf inside container |
|
||||
| `NTFY_URL` | — | ntfy topic URL for push notifications |
|
||||
| `DB_PATH` | `/app/data/check-printing.db` | SQLite database path |
|
||||
|
||||
Reference in New Issue
Block a user