Telegram bot + Mini App (WebApp)
Go to file
BuhApp Dev 149f31d25d Add user onboarding flow (3-slide welcome) for new signups
- New OnboardingView module (public/js/views/onboarding.js):
  • Reads /onboarding/slides.json (designer schema with inline SVG icons,
    per-slide cta_primary/cta_skip labels) — falls back to 3 emoji slides
    if the JSON is unavailable.
  • Renders a Telegram-style dark overlay inside #mobile-frame with a
    220px floating SVG icon, title, body, dot indicator (expandable
    active dot), primary CTA, and a ghost Skip button.
  • Prev/Next via primary CTA; dot click jumps to slide; arrow keys and
    horizontal swipe also navigate.
  • Haptic feedback via TG_APP on slide change + finish.
  • markDone() writes buhapp.onboarded='1' to localStorage so the flow
    never repeats. isDone()/reset() exposed for QA.

- App integration (public/js/app.js):
  • New App.maybeOnboard() helper — awaited after every successful auth
    path: Telegram login, restored session, email login, email register,
    and consent accept. Skips silently if already onboarded.

- UI assets (public/onboarding/):
  • slides.json with 3 designer slides (Map / Chat / Review).
  • Inline-SVG icons for map, chat, and review (icon-*.svg kept for
    designer reference, preview.html too).

- Styles (public/css/app.css): new .onboarding-* dark-theme rules.
- Index (public/index.html): loads onboarding.js before app.js.
2026-08-20 20:20:54 +00:00
public Add user onboarding flow (3-slide welcome) for new signups 2026-08-20 20:20:54 +00:00
README.md Telegram WebApp: Mini App with map, chats, profile, reviews 2026-08-20 17:43:16 +00:00

BuhApp Telegram WebApp

Mini App (WebApp) для Telegram, открывается по кнопке в боте @BuhAppBot.

Запуск

Статика (HTML/JS) раздаётся с https://app.buhapp.mygoodservice.ru/.

Структура

buhapp-telegram/
├── public/
│   ├── index.html        — главная страница (карта/чаты/профиль/настройки)
│   ├── login.html        — онбординг (если запустили без Telegram)
│   ├── css/
│   │   └── app.css       — стили
│   └── js/
│       ├── api.js        — HTTP клиент + TG SDK
│       ├── tg.js         — обёртки Telegram WebApp SDK
│       ├── app.js        — главный контроллер
│       └── views/
│           ├── map.js
│           ├── chats.js
│           ├── chat.js
│           ├── profile.js
│           ├── review.js
│           └── settings.js
└── README.md

Telegram Bot

  • Создай бота через @BotFather/newbot
  • Установи WebApp URL: /setdomainapp.buhapp.mygoodservice.ru
  • Скопируй токен → TELEGRAM_BOT_TOKEN в .env бэкенда

Деплой

Все файлы из public/ монтируются в nginx (location /). Бэкенд читает initData от Telegram и авторизует через POST /api/v1/auth/telegram.