Mockup Implementation Plan

QuranFlow Admin Mockup — Implementation Plan

Approach

Build screen-by-screen in dependency order. Each phase produces working, navigable screens committed to git. Complex screens first (they set patterns), simple screens follow fast.

Execution Loop

Each phase below is one iteration of this loop.

Standard Loop (every phase)

  1. Read spec — Read the spec section(s) listed in the phase. Full paths are provided in each phase header.
  2. Plan components — Before writing code, identify what UI elements the screen needs (tables, cards, modals, tabs, etc.) and search for matching shadcn components:
    • bunx --bun shadcn@latest search -q "..." — find components by keyword
    • bunx --bun shadcn@latest docs <component> — read docs/examples for each component you'll use
    • Use Explore subagents in parallel if the phase uses 3+ new components — one agent per component, each returns docs URLs and API patterns. This avoids serial CLI round-trips.
  3. Install — Run the phase's install block (shadcn components, dependencies). Add any additional components discovered in step 2.
  4. Build — Build the screen(s) listed in the phase. Use TodoWrite to track items when the phase has 4+ build items.
  5. Simplify — Run /simplify on the diff. This launches 3 parallel review agents (reuse, quality, efficiency) and fixes any issues found.
  6. Verify — Run all checks:
    • bun run build — no type errors
    • bun run lint — no lint violations
    • Code review against spec — re-read the spec section referenced in the phase. Confirm every column, filter, action, and state listed in the spec is present in the code.
    • Smoke test (pattern-setting phases only: 0, 1, 3, 4) — run bun run dev, open in browser, confirm the page renders and basic navigation works.
  7. Commit — Use /commit to create a commit for the phase.

Additional steps for pattern-setting phases (0, 1, 3, 4)

These phases establish patterns that every subsequent phase copies. Errors here propagate everywhere.

Additional steps for complex phases (4, 6, 10)

Student Detail (6 tabs), Semester Hub (Close Workflow), and Billing (6 screens with Stripe data) are high-complexity.

Parallel execution for repetitive phases (7, 8, 11, 12)

Content (6 list screens), Scheduling (5 screens), Reporting (5 screens), and Admin (5 screens) are independent screens following established patterns.

Where to use subagents

Situation Agent type Why
Searching shadcn docs for 3+ components Explore (parallel) Avoids serial CLI round-trips. One agent per component, returns docs URLs and API patterns.
Building independent screens in parallel phases General-purpose (parallel) Each screen is self-contained. Agent gets spec + shared imports + data file + pattern reference.
Code quality pass after building /simplify Launches 3 parallel agents (reuse, quality, efficiency) on the diff. Fixes issues directly.

Loop summary

Phase Type Extra steps Status
0 Shell Pattern-setting + extra review of layout patterns COMPLETE
0.5 Data Standard COMPLETE
1 Shared Components Pattern-setting + extra review of shared component APIs COMPLETE
2 Dashboard Standard COMPLETE
3 Students List Pattern-setting + extra review of list/table pattern COMPLETE
4 Student Detail Complex + Pattern-setting + think through layout before, + extra review of entity page pattern COMPLETE
5 Student Mgmt remaining Standard COMPLETE
6 Semester Management Complex + think through Close Workflow before COMPLETE
7 Content Parallel parallel subagents for 6 screens COMPLETE
8 Scheduling Parallel parallel subagents for independent screens COMPLETE
9 Teacher Management Standard COMPLETE
10 Billing Complex + think through billing data flow before COMPLETE
11 Reporting Parallel parallel subagents for 5 screens COMPLETE
12 Admin & System Parallel parallel subagents for 5 screens COMPLETE
13 Polish Standard COMPLETE

Design Reference

Principles extracted from Stripe's admin UI (Product Catalog, Billing Overview, Invoices) as structural reference — not to copy visually, but to inform layout decisions per-screen.


Phase 0: Shell & Routing -- COMPLETE

Goal: App skeleton — sidebar navigation, routing, page header, breadcrumbs. Every future screen slots into this shell.

Spec reference: docs/admin-spec/01-global-patterns.md Sections 1 (Navigation Shell), 2 (Global Search), 3 (Role-Based Access)

Install:

bun add react-router
bunx --bun shadcn@latest add sidebar-07 breadcrumb scroll-area avatar sonner

sidebar-07 provides the "collapses to icons" sidebar pattern. It installs: sidebar, separator, tooltip, input, skeleton, sheet, use-mobile hook. Theme provider already exists (src/components/theme-provider.tsx).

Build:

Routes to define (from docs/admin-spec/00-spec-index.md Section 3 navigation tree):

/                                    → Dashboard
/students                            → Students List
/students/:id                        → Student Detail (tabbed)
/submissions                         → Submissions
/promoted-students                   → Promoted Students
/failed-signups                      → Failed Sign Ups
/semesters                           → Semesters List
/semesters/:id                       → Semester Hub (tabbed)
/welcome-package                     → Welcome Package
/email-management                    → Email Management
/tags                                → Tags
/operations                          → Operations
/content/video-lessons               → Video Lessons
/content/resources                   → Resources
/content/recordings                  → Recordings
/content/tutorials                   → Tutorials
/content/mcq-questions               → MCQ Questions
/content/quizzes                     → Quizzes
/scheduling/calendar                 → Calendar View
/scheduling/live-sessions            → Live Sessions
/scheduling/appointments             → Upcoming Appointments
/scheduling/ta-schedules             → TA Schedules
/scheduling/holidays                 → Holidays
/teachers                            → Teaching Assistants List
/teachers/:id                        → TA Detail (tabbed)
/teacher-criteria                    → Teacher Assignment Criteria
/ta-reports                          → TA Reports
/student-groups                      → Student Groups
/billing/overview                    → Payment Overview
/billing/payments                    → Payments
/billing/plans                       → Payment Plans
/billing/coupons                     → Coupons
/billing/family-plans                → Family Plans
/billing/scholarships                → Scholarships & Deferments
/reporting/student-report            → Student Report
/reporting/referrals                 → Referrals
/reporting/specific-reports          → Specific Reports
/reporting/composition               → Student Composition
/reporting/logs                      → Logs
/admin/admins                        → Admins
/admin/settings                      → Settings
/admin/notifications                 → Notifications
/admin/support-links                 → Support Links
/admin/issue-queue                   → Issue Queue

Verify: Clicking every sidebar item navigates to the correct route. Breadcrumbs render. Sidebar highlights the active section. Collapse to icons works. Dark mode toggle switches theme.


Phase 0.5: Data Model & Mock Data -- COMPLETE

Goal: Complete type definitions and all mock data files. Getting data right before building components prevents rework — every screen consumes this data.

Spec reference: All spec docs in docs/admin-spec/ for column/field definitions. Legacy backend docs at /Users/kamran/Downloads/QuranFlowDocumentationFiles/BackendDocumentation/ for data model reality.

Step A — Update src/data/types.ts (already done):

Step B — Create mock data files (build in dependency order):

File Contents Records
semesters.ts 4 semesters: Spring 2025 (Completed), Fall 2025 (Completed), Spring 2026 (Active, isCurrent), Fall 2026 (Draft) 4
electives.ts Year 2 elective options (Tajweed Advanced, Tafsir, etc.) 4
teachers.ts 6 TAs with gender, timezone, response times 6
ta-schedules.ts Weekly availability slots per TA ~24
students.ts 20 students across levels/semesters, linked to TAs and groups 20
student-groups.ts 8 study groups linked to TAs and semesters 8
assessments.ts Assessment definitions per semester (weeks 1-14, week 14 = EOC) 14
submissions.ts Student submissions, various statuses and grades 40
appointments.ts Upcoming + past 1:1 appointments 35
live-sessions.ts Live sessions with level/gender scoping 15
calendar-events.ts CalendarEvents (derived from sessions + appointments), Holidays 20 events, 5 holidays
billing.ts PaymentRecords, PaymentPlans, Subscriptions ~30 payments, 5 plans, 10 subscriptions
coupons.ts Coupons with redemption counts 4
families.ts FamilyGroups + FamilyMembers with shared stripeCustomerId 3 families, 8 members
scholarships.ts ScholarshipPrograms, StudentScholarships, StudentDeferments 2 programs, 5 scholarships, 3 deferments
email-templates.ts Template names/subjects for Email Management screen 12
issues.ts Issue queue items across types/priorities 10
audit-logs.ts Sample audit log entries for Logs screen 20
dashboard.ts AlertTileData (pre-computed counts matching other data) 6 tiles

Cross-referencing: All mock data must be internally consistent. Student.taId references a real Teacher.id. Submission.studentId references a real Student.id. Dashboard alert counts match the actual data (e.g., students with subscriptionStatus "Failed" = Failed Payments tile count).

Verify: bun run build passes. Every data file exports typed arrays. Import a few in a scratch component to confirm no circular deps.


Phase 1: Shared Components -- COMPLETE

Goal: Reusable building blocks that every screen needs. Create once, use everywhere.

Spec reference: docs/admin-spec/01-global-patterns.md Sections 4 (Component Patterns)

Install:

bun add @tanstack/react-table
bunx --bun shadcn@latest add table badge card dialog alert-dialog select dropdown-menu checkbox tabs collapsible pagination

Build shared components:

Verify: Import shared components into a scratch page. Render a DataTable with student mock data. Render StatusBadges for every status type. Render alert tiles. Confirm visual consistency.


Phase 2: Dashboard -- COMPLETE

Goal: The landing page — operational nerve center with alert tiles, phase prompt, quick actions.

Spec reference: docs/admin-spec/02-dashboard.md (all sections)

Build:

Verify: Dashboard renders with mock alert data. Phase prompt shows "Active" state. Tile clicks navigate to target screens. Quick actions navigate. Skeleton state renders on initial load.


Phase 3: Student Management — Students List -- COMPLETE

Goal: The most-used list screen. Sets the pattern for all other list screens.

Spec reference: docs/admin-spec/03-student-management.md Sections 1-2

Build:

Also completed: Refactored all Card-based shared components (MetricCard, AlertTile, PhasePromptBar, QuickAction) to use proper shadcn Card composition (CardHeader/CardTitle/CardAction/CardContent/CardFooter).

Verify: Table renders 20 students. Sorting works on all sortable columns. Filters narrow results. Row click navigates to /students/:id. "Add Student" opens modal. Pagination shows "1-20 of 20".


Phase 4: Student Management — Student Detail Page -- COMPLETE

Goal: The single most important new screen. 6-tab entity page. Sets the entity page pattern for Semester Hub and TA Detail.

Spec reference: docs/admin-spec/03-student-management.md Sections 3.1-3.11

Build:

Verify: Navigate from Students list → Student Detail. All 6 tabs render with data. Tab URL updates (#profile, #submissions, etc.). Entity header stays fixed across tabs. Action confirmations show correct dialog types.


Phase 5: Student Management — Remaining Screens

Spec reference: docs/admin-spec/03-student-management.md Sections 4-7

Build:

Verify: All three screens render. Student name clicks navigate to Student Detail. Submissions dual-view toggle works.


Phase 6: Semester Management

Goal: Semester Hub with 4 tabs including Setup Checklist and Close Workflow — the two most complex workflow UIs.

Spec reference: docs/admin-spec/04-semester-management.md (all sections)

Install:

bunx --bun shadcn@latest add progress switch accordion

Build:

Verify: Semester list → Semester Hub navigation. Setup Checklist items show completion. Close Workflow shows gated steps (Step 3 locked until Step 2 complete). "Configure →" links navigate with query params.


Phase 7: Content

Spec reference: docs/admin-spec/05-content.md

Build:

Verify: All 6 screens render. Deep links from Setup Checklist pre-filter correctly. Return banner appears and navigates back. Recordings screen has no level filter.


Phase 8: Scheduling

Spec reference: docs/admin-spec/06-scheduling.md

Build:

Verify: Calendar shows mock events in week view. Filters narrow visible events. TA Schedules shows availability grid for selected TA. Live Sessions shows gender/level scoping.


Phase 9: Teacher Management

Spec reference: docs/admin-spec/07-teacher-management.md

Build:

Verify: TA list → TA Detail navigation. Performance tab shows metrics with threshold highlighting (>48h = red). Student names on Students & Groups tab link to Student Detail.


Phase 10: Billing & Payments

Spec reference: docs/admin-spec/08-billing-payments.md

Build:

Verify: Payment Overview alert sections expand/collapse. Student name clicks navigate to Student Detail > Payments tab. Family Plans list → detail navigation works.


Phase 11: Reporting

Spec reference: docs/admin-spec/09-reporting.md

Build:

Verify: Student Composition summary cards render. Level click expands student list. Logs screen shows audit entries.


Phase 12: Admin & System

Spec reference: docs/admin-spec/10-admin-system.md

Build:

Verify: Issue Queue filters work. Status changes via dropdown. All screens accessible from sidebar.


Phase 13: Polish & Cross-Cutting

Goal: Wire up cross-screen navigation, global search, and final consistency pass.

Spec reference: docs/admin-spec/00-spec-index.md Section 6 (Workflows WF1-WF6), docs/admin-spec/01-global-patterns.md Section 2 (Global Search)

Install:

bunx --bun shadcn@latest add command

Build:

Verify: Full walkthrough of all 6 workflows from docs/admin-spec/00-spec-index.md Section 6 (WF1-WF6). Each workflow's screen sequence navigates correctly end to end.


Deferred Items

Spec-defined features deferred for production implementation. Noted here for completeness:

  1. Stripe real-time fetch — Payments tab shows static mock data. No latency simulation, staleness indicators, or customer ID resolution chain. (01-global-patterns.md §5)
  2. Recent search persistence — Global search doesn't persist last 5 searches across session. (01-global-patterns.md §2.4)
  3. Scroll position on checklist return — Return banner navigates back but doesn't restore scroll position. (04-semester-management.md §3.6)
  4. Role-based sidebar — Mockup shows Admin view only. No TA/View-Only/Support Staff toggle. (01-global-patterns.md §3)
  5. Webhook simulation — Billing alerts use static data, no webhook event flow. (08-billing-payments.md §9)
  6. Retention rate computation — Student Composition shows static percentages, not computed from cross-semester enrollment data. (09-reporting.md §5.4)
  7. Support Links drag-reorder — Ordered list with edit modal instead. (10-admin-system.md §5)
  8. Setup Checklist dynamic status — Static completion states, not dynamically computed from content counts. (04-semester-management.md §3.6)
  9. InfusionSoft/CRM sync — Legacy integration not represented in new admin. (Backend docs)
  10. Coupon token system — Individual redeemable tokens. Mockup shows coupon-level data only. (Backend docs)
  11. Performance tags — Auto-computed Low/Mid/High Performer tags shown as static badges. (Backend docs)

Summary

Phase Focus Screens Complexity Status
0 Shell & Routing (sidebar-07) 0 (infrastructure) Medium COMPLETE
0.5 Data Model & Mock Data 0 (types + data files) Medium COMPLETE
1 Shared Components 0 (7 components) Medium COMPLETE
2 Dashboard 1 Medium COMPLETE
3 Students List 1 Medium COMPLETE
4 Student Detail 1 (6 tabs) High COMPLETE
5 Student Mgmt remaining 3 Low COMPLETE
6 Semester Management 6 (incl. Hub 4 tabs) High COMPLETE
7 Content 6 Low (repetitive) COMPLETE
8 Scheduling 5 (Calendar is medium) Medium COMPLETE
9 Teacher Management 5 (incl. Detail 4 tabs) Medium COMPLETE
10 Billing & Payments 6 High COMPLETE
11 Reporting 5 Low COMPLETE
12 Admin & System 5 Low COMPLETE
13 Polish 0 (cross-cutting) Medium COMPLETE
Total ~44 screens/views