WellNuo/wellnuoSheme/06_Sales_And_User_Flow.json
Sergei 3c8a9fc336 Add Node.js backend with Stripe integration and admin panel
Backend features:
- Express.js API server
- Supabase database integration
- Stripe Checkout for payments ($249 kit + $9.99/mo premium)
- Stripe webhooks for payment events
- Admin panel with order management
- Auth middleware with JWT
- Email service via Brevo

API endpoints:
- /api/stripe/* - Payment processing
- /api/webhook/stripe - Stripe webhooks
- /api/admin/* - Admin operations
- /function/well-api/api - Legacy API proxy

Database migrations:
- orders, subscriptions, push_tokens tables

Schemes updated:
- Removed updatedAt from all schemes
- Updated credentials section with live values
- Added Stripe configuration details

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-19 09:49:24 -08:00

221 lines
11 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"_meta": {
"name": "Sales and User Flow",
},
"elements": [
{
"id": "header",
"type": "card",
"title": "WellNuo: User Journey",
"borderColor": "purple",
"tags": ["overview"],
"description": "**Полный путь пользователя**\n\nОт скачивания до ежедневного использования.\n\n**Ключевые понятия:**\n- Caretaker = ты (следишь за родственниками)\n- Beneficiary = бабушка/дедушка (за кем следят)\n\n**Простой принцип:**\nОдин beneficiary = одна покупка = одна оплата.\n\nХочешь добавить второго? [+ Add] → тот же flow.",
"x": 140,
"y": 300
},
{
"id": "flow-download",
"type": "card",
"title": "1. Скачал приложение",
"borderColor": "blue",
"tags": ["onboarding"],
"description": "App Store / Google Play\n\nПервый запуск → Splash screen",
"x": 500,
"y": 100
},
{
"id": "flow-register",
"type": "card",
"title": "2. Регистрация",
"borderColor": "blue",
"tags": ["onboarding", "auth"],
"description": "**Экран регистрации**\n\nПоля:\n- Имя\n- Email\n- Пароль\n- Телефон (опционально)\n\nИли: Sign in with Apple\n\n→ Email подтверждение (код 6 цифр)",
"x": 500,
"y": 250
},
{
"id": "flow-onboarding-question",
"type": "condition",
"title": "3. У вас есть датчики?",
"borderColor": "yellow",
"tags": ["onboarding"],
"description": "**Онбординг вопрос**\n\n\"У вас уже есть датчики WellNuo или код приглашения?\"\n\n[Да, есть код] → Ввести код\n[Нет, хочу купить] → Каталог",
"x": 500,
"y": 420
},
{
"id": "flow-enter-code",
"type": "card",
"title": "3a. Ввести код приглашения",
"borderColor": "green",
"tags": ["onboarding"],
"description": "**Код от родственника или установщика**\n\nФормат: ABC-123-XYZ\n\nПосле ввода:\n- Добавляется deployment в аккаунт\n- Сразу видишь dashboard\n\n*Используется когда кто-то уже купил и настроил датчики*",
"x": 800,
"y": 350
},
{
"id": "flow-add-beneficiary",
"type": "card",
"title": "4. Add Beneficiary",
"borderColor": "blue",
"tags": ["purchase"],
"description": "**\"Let's add your loved one\"**\n\nFields:\n- Name (\"Grandma Mary\")\n- Photo (optional)\n- Address (where sensors go)\n- Phone\n- Notes (\"lives alone, has a cat\")\n\n[Continue] →",
"x": 500,
"y": 550
},
{
"id": "flow-select-plan",
"type": "card",
"title": "5. Select Plan",
"borderColor": "orange",
"tags": ["purchase"],
"description": "**\"Sensors are required for monitoring\"**\n\n**Starter Kit — $249**\n• 2× Motion sensor\n• 1× Door sensor\n• 1× Hub\n\n---\n\n**Choose subscription:**\n\n○ **Free** — basic monitoring\n● **Premium $9.99/mo** — AI Julia, 90-day history\n\n[Continue] →",
"x": 500,
"y": 700
},
{
"id": "flow-checkout",
"type": "card",
"title": "6. Checkout",
"borderColor": "orange",
"tags": ["purchase", "payment"],
"description": "**Order Summary:**\n\n┌─────────────────────────┐\n│ Grandma Mary │\n│ Starter Kit $249 │\n│ Premium $9.99/mo │\n├─────────────────────────┤\n│ Shipping address: │\n│ [Your address] │\n│ Standard (5-7 days) Free│\n├─────────────────────────┤\n│ TODAY: $258.99 │\n└─────────────────────────┘\n\n**Payment:** Stripe\n• Card / Apple Pay / Google Pay\n\n[Pay $258.99] →",
"x": 500,
"y": 870
},
{
"id": "flow-order-confirmed",
"type": "card",
"title": "7. Order Confirmed",
"borderColor": "green",
"tags": ["purchase"],
"description": "**Order #WN-2025-0042**\n\n✓ Payment successful!\n\nStatus: Preparing to ship\nDelivery: Dec 20-22\n\nConfirmation email sent.\n\n[Go to App] →",
"x": 500,
"y": 1020
},
{
"id": "flow-waiting",
"type": "card",
"title": "8. Waiting for Delivery",
"borderColor": "gray",
"tags": ["waiting"],
"description": "**Home Screen (no sensors yet)**\n\n┌─────────────────────────┐\n│ 📦 Grandma Mary │\n│ Status: Awaiting sensors│\n│ Delivery: Dec 20 │\n│ [Track Package] │\n└─────────────────────────┘\n\n*Tracking via FedEx/UPS API*",
"x": 500,
"y": 1170
},
{
"id": "flow-delivery",
"type": "card",
"title": "9. Sensors Delivered",
"borderColor": "green",
"tags": ["install"],
"description": "**Push notification:**\n\"Your order was delivered! Time to set up sensors.\"\n\n**In app:**\nStatus changes to \"Ready to Install\"\n\n[Start Setup] →",
"x": 500,
"y": 1320
},
{
"id": "flow-install",
"type": "card",
"title": "10. Setup Wizard",
"borderColor": "teal",
"tags": ["install"],
"description": "**Step-by-step in-app guide:**\n\n**Step 1: Hub**\nPlug Hub into outlet → wait for blue light\n⏳ Searching... ✓ Found!\n\n**Step 2: Motion Sensors**\nPlug into bedroom → ✓ Found!\nPlug into kitchen → ✓ Found!\n\n**Step 3: Door Sensor**\nStick on door frame → ✓ Works!\n\n---\n\n**All done!**\n✓ Hub — online\n✓ Bedroom — online\n✓ Kitchen — online\n✓ Front door — online\n\n[Go to Dashboard] →",
"x": 500,
"y": 1470
},
{
"id": "flow-dashboard",
"type": "card",
"title": "11. Dashboard",
"borderColor": "blue",
"tags": ["daily"],
"description": "**Home Screen**\n\n┌─────────────────────────┐\n│ 👵 Grandma Mary [●] │\n│ Last activity: │\n│ Kitchen, 5 min ago │\n│ All good ✓ │\n└─────────────────────────┘\n\n[+ Add Beneficiary]\n\n---\n\n**Tap for details:**\n• Today's activity\n• Sensor status\n• [Ask Julia] (Premium)\n• [Weekly report]",
"x": 900,
"y": 1470
},
{
"id": "flow-add-another",
"type": "card",
"title": "12. Add Another Beneficiary",
"borderColor": "orange",
"tags": ["purchase"],
"description": "**Dashboard → [+ Add Beneficiary]**\n\nSame flow:\n1. Add Beneficiary info\n2. Select Plan ($249 + subscription)\n3. Checkout & Pay\n4. Wait for delivery\n5. Setup sensors\n\n**Each beneficiary = separate order**\n\n*Add as many as you need!*",
"x": 900,
"y": 1620
},
{
"id": "flow-alerts",
"type": "card",
"title": "Push Notifications",
"borderColor": "red",
"tags": ["daily"],
"description": "**Alerts:**\n\n🔴 **Urgent:**\n\"Grandma Mary: no activity 6+ hours\"\n\"Sensor offline\"\n\n🟡 **Important:**\n\"Unusual late wake-up (10:30)\"\n\"Hasn't left home in 3 days\"\n\n🟢 **Info:**\n\"Weekly report ready\"",
"x": 1200,
"y": 1470
},
{
"id": "flow-profile",
"type": "card",
"title": "Profile & Settings",
"borderColor": "gray",
"tags": ["settings"],
"description": "**Profile:**\n• Name, email, phone\n• Change password\n• Push notifications on/off\n• Quiet hours (10pm-7am)\n\n**My Beneficiaries:**\n• Grandma Mary [Premium]\n\n**Orders:**\n• Order history\n\n**Subscription:**\n• Manage subscription",
"x": 1200,
"y": 1620
},
{
"id": "info-products",
"type": "card",
"title": "Products & Pricing",
"borderColor": "orange",
"tags": ["reference"],
"description": "**Starter Kit — $249**\n• 2× Motion sensor\n• 1× Door sensor\n• 1× Hub\n\n---\n\n**Subscriptions (per beneficiary):**\n\n**Free** — basic\n• Monitoring\n• Push alerts\n• 7-day history\n\n**Premium — $9.99/mo**\n• AI Julia chat\n• 90-day history\n• Invite family (5 max)",
"x": 140,
"y": 550
},
{
"id": "info-api",
"type": "card",
"title": "API Endpoints",
"borderColor": "green",
"tags": ["reference"],
"description": "**Orders:**\n`POST /orders` — create\n`GET /orders` — my orders\n`GET /orders/:id` — details\n\n**Beneficiaries:**\n`POST /beneficiaries` — add\n`GET /beneficiaries` — list\n\n**Subscriptions:**\n`POST /subscriptions` — create\n`PATCH /subscriptions/:id` — update\n\n**Stripe:**\n`POST /stripe/webhook`",
"x": 140,
"y": 750
}
],
"connections": [
{"from": "header", "to": "flow-download"},
{"from": "header", "to": "info-products"},
{"from": "info-products", "to": "info-api"},
{"from": "flow-download", "to": "flow-register"},
{"from": "flow-register", "to": "flow-onboarding-question"},
{"from": "flow-onboarding-question", "to": "flow-enter-code", "label": "Has code"},
{"from": "flow-onboarding-question", "to": "flow-add-beneficiary", "label": "Buy sensors"},
{"from": "flow-enter-code", "to": "flow-dashboard"},
{"from": "flow-add-beneficiary", "to": "flow-select-plan"},
{"from": "flow-select-plan", "to": "flow-checkout"},
{"from": "flow-checkout", "to": "flow-order-confirmed"},
{"from": "flow-order-confirmed", "to": "flow-waiting"},
{"from": "flow-waiting", "to": "flow-delivery"},
{"from": "flow-delivery", "to": "flow-install"},
{"from": "flow-install", "to": "flow-dashboard"},
{"from": "flow-dashboard", "to": "flow-add-another", "label": "+ Add"},
{"from": "flow-dashboard", "to": "flow-alerts"},
{"from": "flow-dashboard", "to": "flow-profile"},
{"from": "flow-add-another", "to": "flow-add-beneficiary", "label": "Same flow"}
],
"tagsDictionary": [
{"name": "overview", "color": "purple"},
{"name": "onboarding", "color": "blue"},
{"name": "purchase", "color": "orange"},
{"name": "payment", "color": "orange"},
{"name": "waiting", "color": "gray"},
{"name": "install", "color": "teal"},
{"name": "daily", "color": "blue"},
{"name": "settings", "color": "gray"},
{"name": "reference", "color": "cyan"}
]
}