Go to file
Aswin Biju 3640b2d785 feat(whatsapp): read slip photos and add them to the order
Shops can now send handwritten slips as WhatsApp photos. srs-api reads them
through OpenRouter in the background. The model only proposes text: the parser
decides what is an entry, and nothing is saved without the user's Save.
2026-11-04 13:46:50 +05:30
data feat: SRS backend: orders intake, results pipeline, user management 2026-11-03 10:09:46 +05:30
hermes-plugin/srs-gate feat(whatsapp): read slip photos and add them to the order 2026-11-04 13:46:50 +05:30
scripts feat(shops): added a CLI to create and list shops 2026-11-04 11:44:40 +05:30
src feat(whatsapp): read slip photos and add them to the order 2026-11-04 13:46:50 +05:30
test/fixtures feat(whatsapp): read slip photos and add them to the order 2026-11-04 13:46:50 +05:30
.env.example feat(whatsapp): read slip photos and add them to the order 2026-11-04 13:46:50 +05:30
.gitignore feat: SRS backend: orders intake, results pipeline, user management 2026-11-03 10:09:46 +05:30
ecosystem.config.cjs feat: SRS backend: orders intake, results pipeline, user management 2026-11-03 10:09:46 +05:30
package-lock.json feat: SRS backend: orders intake, results pipeline, user management 2026-11-03 10:09:46 +05:30
package.json feat(shops): added a CLI to create and list shops 2026-11-04 11:44:40 +05:30
README.md feat(shops): added a CLI to create and list shops 2026-11-04 11:44:40 +05:30
tsconfig.build.json feat: SRS backend: orders intake, results pipeline, user management 2026-11-03 10:09:46 +05:30
tsconfig.json feat: SRS backend: orders intake, results pipeline, user management 2026-11-03 10:09:46 +05:30
vitest.config.ts feat: SRS backend: orders intake, results pipeline, user management 2026-11-03 10:09:46 +05:30

srs-api

Backend for SRS: the order parser, the WhatsApp conversation flow, and the API for the Flutter PWA. One Node/TypeScript service (Fastify) with a SQLite database. It runs on the server under pm2, behind Caddy.

Flutter PWA ──HTTPS──▶ Caddy ──/api/*──▶ ┐
                                          ├─▶ srs-api (127.0.0.1:8080) ──▶ SQLite file
Hermes plugin ──localhost + secret──────▶ ┘        │
                                                   └─▶ WhatsApp bridge (127.0.0.1:3000): replies, 3 PM summary

Run it on your computer

Needs Node 22 or newer.

npm install
cp .env.example .env       
npm run migrate             # creates ./data/srs.db
npm run user create         # a short wizard: choose Admin or User 
npm run user list           # show every account
npm run shop create         # add a shop (name + unique code)
npm run shop list           # show every shop
npm run dev                 # http://127.0.0.1:8080
npm test
npm run typecheck