/login
Supabase email/password and magic-link sign-in surface
browser_session
Grand Academy
Locations
3
managed by Owner
Families
3
linked payers
Students
4
profile cards
Groups
4
scheduled classes
Supabase Auth shell and read-only live overview API are ready for staff accounts.
/login
Supabase email/password and magic-link sign-in surface
browser_session
/auth/callback
PKCE callback handler for magic links
browser_session
/api/operations/overview
Read-only Supabase operational overview endpoint
read_only_api
| Live table | Metric | API |
|---|---|---|
| locations | Locations | /api/operations/overview |
| coaches | Coaches | /api/operations/overview |
| parents | Parents | /api/operations/overview |
| children | Students | /api/operations/overview |
| class_groups | Groups | /api/operations/overview |
| sessions | Sessions | /api/operations/overview |
| subscriptions | Subscriptions | /api/operations/overview |
| payments | Payments | /api/operations/overview |
Owner can create, edit and archive branches without code changes.
| Branch | Rooms | Groups | Students | Load | Status |
|---|---|---|---|---|---|
Dubai Marina Marina promenade | Studio 1, Studio 2 | 2 | 18 | 78% | Active |
Jumeirah Main hall | Main Hall | 1 | 10 | 64% | Active |
Downtown Studio A | Studio A | 1 | 8 | 52% | Archive review |
Archiving a branch must transfer active work while keeping historical attendance and payment records intact.
Review active groups and students
Select destination location
Transfer future sessions
Preserve attendance and payment history
Coach profiles include assigned branches, load and group count.
Beginner and flexibility
Advanced routines
Assistant coach
Search by child, parent or phone. Family links support several children per payer.
Global search
Sofia / +971551000001 / Petrova / Dubai Marina active
8 years · Dubai Marina · Marina Beginners A
9 years · Dubai Marina · Marina Intermediate
10 years · Jumeirah · Jumeirah Advanced
7 years · Downtown · Trial list
Account handoff map for GitHub, Vercel, Supabase, domain, n8n/OpenRouter, payments and e-mail.
| Variable | Owner | Visibility | Required for | Source |
|---|---|---|---|---|
| NEXT_PUBLIC_SUPABASE_URL | Supabase | public | Browser Supabase client | Supabase project API settings |
| NEXT_PUBLIC_SUPABASE_ANON_KEY | Supabase | public | Browser Supabase client with RLS | Supabase project API settings |
| SUPABASE_SERVICE_ROLE_KEY | Supabase | server | Server-only admin jobs and imports | Supabase service role key |
| DATABASE_URL | Supabase | server | Migrations and database maintenance | Supabase pooled PostgreSQL connection string |
| NEXT_PUBLIC_N8N_WEBHOOK_BASE_URL | n8n | public | Automation endpoint discovery | n8n production webhook base URL |
| N8N_CRM_SECRET | n8n | server | CRM-to-n8n webhook signing | Shared secret generated in n8n credentials |
| ZIINA_API_KEY | Ziina | server | Payment link creation | Ziina merchant dashboard |
| ZIINA_WEBHOOK_SECRET | Ziina | server | Payment webhook verification | Ziina webhook endpoint settings |
| RESEND_API_KEY | server | Transactional e-mail sending | Resend production API key | |
| APP_URL | Vercel | server | Absolute callback and notification URLs | Production CRM URL |
| APP_TIMEZONE | Domain | server | Business date calculations | Asia/Dubai |
Release readiness model for acceptance, testing, backups, monitoring and production deployment.
| Acceptance area | Owner | Evidence | Status |
|---|---|---|---|
| Core CRM flows | Admin | Branches, families, schedule, attendance and subscriptions need customer walkthrough. | needs_review |
| Role access | Engineer | Owner/Admin/Coach matrix and RLS policy tests are present. | ready |
| Finance controls | Owner | Ziina, invoice legal profile and production credentials are not connected. | blocked |
| Notifications | Admin | Real e-mail provider and WhatsApp Business templates are required. | blocked |
pre-release
Build app, render home, health endpoint and core navigation.
pre-release
Seed realistic branch, family, attendance and payment volume before production.
weekly
Requires production Supabase project and storage bucket policy.
daily
Requires Vercel/Supabase project access and alert destination.
Design-token and accessibility scaffolding is ready; final brand decisions wait for the Grand Academy brand book.
font.sans
Geist / Inter-compatible
placeholder
color.background
#f8fafc
placeholder
color.surface
#ffffff
placeholder
color.text
#0f172a
placeholder
color.accent
#0e7490
placeholder
radius.card
8px
placeholder
empty
Create the first record or import existing data.
loading
Keep controls stable while data refreshes.
error
Show the failed area, recovery action and support context.
success
Confirm the action without moving the user away from their workflow.
Owner KPIs, branch comparison, attendance, fill rate and coach load reporting.
Active students
36
+4 this month
Revenue
AED 18.4k
+12% vs last month
Expiring
7
next 3 days
Attendance
88%
-2% vs last week
Fill rate
71%
across groups
New leads
11
trial pipeline
| Branch | Students | Revenue | Attendance | Fill rate |
|---|---|---|---|---|
| Dubai Marina | 18 | AED 9200 | 91% | 78% |
| Jumeirah | 10 | AED 6900 | 86% | 64% |
| Downtown | 8 | AED 2300 | 82% | 52% |
Triggered messages for subscriptions, payments, schedule changes and attendance follow-up.
parent · email
fallback in_app
admin · in_app
fallback email
parent · email
fallback in_app
coach · in_app
fallback email
| Trigger | Locale | Subject | Variables |
|---|---|---|---|
| subscription_expiring | en | Subscription expiring soon | parent_name, child_name, valid_to, payment_link |
| subscription_expiring | ru | Абонемент скоро заканчивается | parent_name, child_name, valid_to, payment_link |
| payment_confirmed | en | Payment received | child_name, invoice_link |
| session_changed | en | Class schedule update | group_name, change_summary |
UAE VAT 5% invoice contract, payment journal filters and accounting exports.
| Invoice | Family | Net | VAT | Total | Status |
|---|---|---|---|---|---|
| GA-2026-0001 | Elena Petrova · Sofia Petrova | AED 809.52 | AED 40.48 | AED 850 | issued |
| GA-2026-0002 | Sarah Johnson · Emma Johnson | AED 1095.24 | AED 54.76 | AED 1150 | sent |
issued invoices and parent receipts
payments, VAT, method, location and plan
invoice number, TRN, net, VAT and gross total
Provider-adapter workflow for Ziina links, manual payments and idempotent webhooks.
Sofia Petrova · AED 850
ready
Layla Hassan · AED 850
manual_review
| Provider ID | Idempotency | Status | Effect |
|---|---|---|---|
| ziina_demo_001 | sub-emma-2026-07-initial | processed | Subscription activated and invoice queued |
| ziina_demo_001 | sub-emma-2026-07-initial | duplicate_ignored | No-op because idempotency key was already processed |
Weekly-cycle plans with exact validity dates, renewal examples and payment follow-up signals.
4 weeks · 2 lessons/week
Dubai Marina · Beginner
4 weeks · 3 lessons/week
Jumeirah · Advanced
12 weeks · unlimited lessons/week
All locations · All levels
| Child | Plan | Valid from | Valid to | Payment | Status |
|---|---|---|---|---|---|
Sofia Petrova Elena Petrova | 4 weeks / 2 lessons | 2026-07-01 | 2026-07-28 | AED 850 · paid | expiring |
Emma Johnson Sarah Johnson | 4 weeks / 3 lessons | 2026-07-08 | 2026-08-04 | AED 1150 · paid | active |
Layla Hassan Amina Hassan | Trial follow-up | 2026-06-20 | 2026-07-18 | AED 0 · overdue | expired |
Mobile-first roster with one-tap status changes and offline sync state.
Today · 17:00-18:30
Dubai Marina · Studio 1 · Anna Coach
Sofia Petrova
8 years · No restrictions
Nora Miller
7 years · No notes
Layla Hassan
7 years · Emergency contact confirmed
Extra visit
Attendance changes are staged locally when the network drops and synced when the coach reconnects.
sofia-petrova · present
synced
nora-miller · late
queued
Manage group capacity, recurring slots and generated sessions with coach and room conflict checks.
Beginner · ages 5-8
9/12 students
Dubai Marina · Anna Coach
Intermediate · ages 7-11
8/10 students
Dubai Marina · Anna Coach
Advanced · ages 8-13
10/10 students
Jumeirah · Mira Coach
Pre-pro · ages 9-14
6/8 students
Downtown · Mira Coach
| Day | Time | Group | Coach | Room | Recurrence |
|---|---|---|---|---|---|
| Tue | 17:00-18:30 | Marina Beginners A | Anna Coach | Studio 1 | Weekly from 2026-07-01 |
| Thu | 17:00-18:30 | Marina Intermediate | Anna Coach | Studio 2 | Weekly from 2026-07-01 |
| Mon | 18:00-19:30 | Jumeirah Advanced | Mira Coach | Main Hall | Weekly from 2026-07-01 |
| Wed | 18:00-20:00 | Downtown Pre-Pro | Mira Coach | Studio A | Weekly from 2026-07-01 |
Owner/Admin can import existing sheets, review validation and export operational data.
| Row | Child | Parent | Phone | Status |
|---|---|---|---|---|
| 2 | Sofia Petrova | Elena Petrova | +971551000001 | duplicate_review |
| 3 | Mia Ivanova | Maria Ivanova | +971551000002 | ready |
| 4 | Missing | Unknown | 551000099 | invalid |
Row 2: parent_phone
Phone already belongs to Elena Petrova. Link as sibling instead of new family.
Row 4: child_full_name
Child full name is required.
Row 4: parent_phone
Phone must use international format, for example +971551000099.
children, parents, parent_child links
Owner / Admin
sessions, attendance status, coach, group
Owner / Admin
payments, VAT, subscriptions, locations
Owner / Admin
Foundation
ready
Next.js app shell, i18n, env map, health endpoint
Data core
ready
Supabase PostgreSQL schema, migrations, demo seed, ER docs
Access
ready
Owner, Admin, Coach RBAC policies, audit log, MFA routing
Locations
ready
Location switcher, branch overview, coach assignments
Families
ready
Child profiles, parent links, search, duplicate warnings
Import
ready
CSV/XLSX template, validation preview, export contract
Schedule
ready
Groups, recurring slots, calendar preview, conflicts
Attendance
ready
Mobile coach roster, one-tap states, offline queue
Subscriptions
ready
Weekly plans, exact dates, renewal and freeze draft
Payments
ready
Provider contract, Ziina link flow, webhook idempotency
Invoices
ready
VAT 5%, invoice draft, journal filters, accounting exports
Notify
ready
Triggers, templates, email contract, WhatsApp copy fallback
Reports
ready
Owner KPIs, branch comparison, coach load, exports
UI
blocked
Brand-ready tokens and states; final polish waits for brand book
Launch
blocked
Stabilization plan ready; production accounts and credentials required
Prod
ready
GitHub, Vercel, Supabase link, env aliases and smoke checks
Auth
ready
Login shell, callback route, role policy and read-only Supabase overview