Smena — portfolio

shipped

Smena

Telegram Mini App and bot for a single barber: the day board, clients, free windows, and read-only YCLIENTS sync without storing a password.

Role
Product & backend
Year
2026
Stack
Node.js 24 · SQLite · Telegram WebApp · zero npm deps
Status
shipped

Problem

A solo barber needs the working day inside Telegram: visits, breaks, clients, and free windows — without a separate CRM and without writing back into YCLIENTS. Admin bookings sync read-only; the master keeps personal visits and notes in Smena.

Decisions

  • Mini App + bot. Day / week / month, client cards, status buttons, shareable free-window text. The bot answers /today, /free, /add, /find and deep-links into the app.
  • YCLIENTS read-only. Google Calendar iCal or the official API — no YCLIENTS password stored. The iCal URL lives in SQLite meta, not in exports.
  • HMAC initData. Telegram signature, expiry, allow-listed ids. Eight-hour session: in-memory Bearer + HttpOnly cookie, never localStorage.
  • SSRF hardening on the calendar feed. Address pinning, IP allow-list, shared timeout, socket re-check after connect.
  • revision concurrency. Forms carry a data version; a stale save from another device is rejected.
  • Snapshots and restore. Daily DB copies; restore keeps a recovery copy first.
  • Zero npm dependencies. Node 24 stdlib + SQLite.
Master day board with visits in the phone-width demo
Day board — fictional demo data.
Client card with visit history
Client card: history, contact actions, notes.
Overview screen with revenue and load for 7 days
7-day overview: revenue, load, win-back list.

Architecture

Telegram WebApp / bot → server.mjs → SQLite; optional Google Calendar iCal or YCLIENTS API. Shared day math in shared.mjs for UI and chat.

Access: owner plus one second user (admin or assistant) via a one-time invite.

Попробовать

Демо на тестовых данных

Загружаем демо…

Code

Telegram initData HMAC check, calendar fetch SSRF guards, and freeGaps from shared.mjs — same fragments as the Russian case.

What was verified

Verified: npm test (44), local /demo, iCal against a real Google Calendar, widths 320–1060 px.

Not verified here: full Telegram Web iframe on 0.5, a live YCLIENTS branch / API tokens, VPS deploy in this environment.