Browse documentation

Specifications

RankFlow AI — User Dashboard UI Specifications

│ Dashboard Shell (src/app/(client)/layout.tsx) │

docs/specs/user-dashboard-ui.md
On this page

Version: 1.0.0
Route Prefix: /dashboard
Auth Required: CLIENT, EDITOR, or VIEWER role
Layout: Dashboard shell with sidebar navigation


1. Layout Architecture#

┌─────────────────────────────────────────────────────────────┐
│  Dashboard Shell (src/app/(client)/layout.tsx)               │
│  ┌──────────┐  ┌─────────────────────────────────────────┐  │
│  │ Sidebar  │  │  Header Bar                             │  │
│  │          │  │  ─────────────────────────────────────  │  │
│  │ • Home   │  │                                       │  │
│  │ • GBP    │  │  Main Content Area                    │  │
│  │ • Social │  │  (page-specific)                      │  │
│  │ • Citations│ │                                       │  │
│  │ • Site   │  │                                       │  │
│  │ • Reports│  │                                       │  │
│  │ • Leads  │  │                                       │  │
│  │ • Content│  │                                       │  │
│  │ • Settings│ │                                       │  │
│  │ • Billing│  │                                       │  │
│  └──────────┘  └─────────────────────────────────────────┘  │
└─────────────────────────────────────────────────────────────┘

Shell Components#

Component Path Purpose
ClientLayout src/app/(client)/layout.tsx Route group layout, practice resolution
DashboardSidebar src/components/dashboard/Sidebar.tsx Navigation, practice switcher
DashboardHeader src/components/dashboard/Header.tsx Breadcrumbs, notifications, user menu
DashboardShell src/components/dashboard/Shell.tsx Sidebar + Header wrapper

2. Route Map#

Route Page Component Primary Data Skill
/dashboard DashboardHomePage Overview KPIs 39-admin-kpi (client view)
/dashboard/gbp GbpOverviewPage GBP status, posts, reviews 04, 06, 07, 08, 09
/dashboard/gbp/posts GbpPostsPage Post history, scheduler 04, 05
/dashboard/gbp/reviews GbpReviewsPage Review inbox, replies 06, 07
/dashboard/gbp/insights GbpInsightsPage Maps views, clicks, calls 08
/dashboard/social SocialOverviewPage Accounts, scheduled posts 10, 11, 12
/dashboard/citations CitationsPage 30 citation URLs, NAP 13, 14, 15
/dashboard/site SitePreviewPage Live preview, traffic 19, 20, 21
/dashboard/reports ReportsPage Monthly reports, PDFs 32, 33
/dashboard/leads LeadsPage Lead inbox, contacts 34, 35
/dashboard/content ContentApprovalPage AI content queue 29, 30
/dashboard/settings SettingsPage Business info, team 01
/dashboard/billing BillingPage Plan, invoices, payment 36, 37, 38

3. Page Specifications#

3.1 /dashboard — Home Overview#

Purpose: At-a-glance view of the practice's SEO health

Layout: Grid of stat cards + recent activity

Stat Cards (top row):

Card Metric Source
Maps Position Avg rank for target keywords RankTracking
Citation Count Live / Total Citation
Review Score Avg rating + count Review
Social Activity Posts this month SocialPost
Site Traffic Monthly visitors (Analytics)
SEO Score Overall 0-100 Report

Sections Below:

Section Content
Recent GBP Posts Last 3 posts with status
Latest Reviews Last 5 reviews, reply status
Upcoming Social Next 5 scheduled posts
Citation Health NAP consistency %
Quick Actions "Create Post", "Add Location", "View Report"

3.2 /dashboard/gbp — GBP Overview#

Purpose: Central hub for Google Business Profile management

Layout: Tabbed sub-navigation + cards

Sub-Routes:

  • /dashboard/gbp — Overview
  • /dashboard/gbp/posts — Posts
  • /dashboard/gbp/reviews — Reviews
  • /dashboard/gbp/insights — Insights

Overview Tab:

┌────────────────────────────────────────┐
│  GBP Status Card                       │
│  [Connected] account@email.com          │
│  Locations: 2 | Last sync: 2 min ago   │
│  [Sync Now] [Reconnect]                │
└────────────────────────────────────────┘

┌─────────────────┐ ┌─────────────────┐
│  Posts This Week │ │  Reviews         │
│  3 published     │ │  12 new (2 unr.) │
│  [View all]      │ │  [Reply]         │
└─────────────────┘ └─────────────────┘

Posts Tab:

Feature Description
Calendar View Visual post schedule
List View All posts with status
Create Post Modal with AI assist
Edit Post For scheduled posts
Delete Post Confirmation required

Reviews Tab:

Feature Description
Review List Star rating, comment, date
Reply Inline Text area + AI generate button
Filter All / Unreplied / Negative / Positive
Bulk Reply Select multiple, batch reply

Insights Tab:

Chart Metric
Views Over Time Search + Maps views
Actions Breakdown Website, Phone, Directions, Booking
Search Queries Top queries table
Photo Views Photo engagement
Post Engagement Views, clicks on posts

3.3 /dashboard/social — Social Media#

Purpose: Manage connected social accounts and posts

Layout: Account cards + post scheduler

Account Cards:

┌────────────────────────────────────────┐
│  [FB Logo]  Facebook                   │
│  @practice_name                       │
│  ✅ Connected | 1.2k followers         │
│  [Post] [Schedule] [Disconnect]      │
└────────────────────────────────────────┘

Post Scheduler:

Feature Description
Compose Text area, media upload, hashtag suggest
Platform Select Toggle which accounts to post to
Schedule Date/time picker, timezone aware
Preview How it looks on each platform
Queue Upcoming scheduled posts list
History Past published posts

3.4 /dashboard/citations — Citation Network#

Purpose: Monitor and manage business directory listings

Layout: Progress card + directory table

Progress Card:

Citation Health: 87%
┌────────────────────────────────────┐
│███████████████████░░░░░│ 26/30 live
└────────────────────────────────────┘
Verified: 26 | Pending: 2 | Failed: 2

Directory Table:

Column Description
Directory Logo + name (Justdial, Practo, etc.)
Status Live / Pending / Failed / Needs Update
NAP Match ✅ All match / ❌ Mismatch details
URL Link to listing
Last Checked Date
Screenshot Thumbnail, click to enlarge

Actions:

  • Submit to new directory
  • Re-verify NAP
  • View mismatch details
  • Download citation report

3.5 /dashboard/site — Landing Page#

Purpose: Preview and manage the practice's public website

Layout: Split view — preview left, editor right

Preview Panel:

  • Live iframe of the site
  • Device toggle: Desktop / Tablet / Mobile
  • URL display: https://practice.rankflow.ai

Editor Panel:

Section Editable Fields
Hero Title, subtitle, CTA text, background image
About Content, doctor photo
Services Service list, descriptions
Testimonials Patient quotes, names
FAQ Questions, answers
Contact Phone, email, hours, map embed
CTA Button text, link

Settings:

  • Template selector (Medical Modern, Dental Clean, etc.)
  • Primary color picker
  • Font family selector
  • Custom domain input
  • Publish / Unpublish toggle
  • Auto-update toggle

3.6 /dashboard/reports — Reports#

Purpose: View and download monthly SEO reports

Layout: Report cards + PDF viewer

Report Card:

┌────────────────────────────────────────┐
│  Monthly Report — January 2025       │
│  Overall Score: 78/100                 │
│  ┌────┐ ┌────┐ ┌────┐ ┌────┐         │
│  │GBP │ │CIT │ │REV │ │RNK │         │
│  │ 82 │ │ 75 │ │ 90 │ │ 65 │         │
│  └────┘ └────┘ └────┘ └────┘         │
│  [View PDF] [Email] [Download]       │
└────────────────────────────────────────┘

Score Breakdown:

Category Weight Metrics
GBP 25% Views, posts, reviews, photos
Citations 25% Live count, NAP consistency
Reviews 20% Avg rating, reply rate, count
Rankings 20% Keyword positions, top 10 count
SEO 10% Site health, schema, speed

3.7 /dashboard/leads — Lead Inbox#

Purpose: Manage contact form submissions and enquiries

Layout: Inbox-style list + detail panel

Lead List:

Column Description
Name Lead name
Phone Click to call
Source Site / GBP / Social / Direct
Status NEW / CONTACTED / CONVERTED / LOST
Date Received date
Actions Mark contacted, Convert, Archive

Lead Detail:

  • Full message
  • Source page URL
  • UTM parameters (if any)
  • Action buttons

3.8 /dashboard/content — Content Approval#

Purpose: Review AI-generated content before publishing

Layout: Card list of pending content

Content Card:

┌────────────────────────────────────────┐
│  GBP Post — AI-generated               │
│  Auto-publishes in 18 hours            │
│                                        │
│  [Content preview...]                  │
│                                        │
│  [Approve] [Reject] [Edit]            │
└────────────────────────────────────────┘

Auto-publish Timer:

  • Content queued for 24 hours after generation
  • Countdown displayed
  • Approve → publishes immediately
  • Reject → archived, not published
  • Edit → opens inline editor

Content Types in Queue:

Type Approval Required
GBP Post Always (medical compliance)
Social Post Always
Review Reply For negative reviews
Landing Page Article Always
FAQ Optional

3.9 /dashboard/settings — Practice Settings#

Purpose: Manage business information and team

Tabs:

Tab Content
Business Info Name, type, logo, colors
Locations Location cards, add/edit/delete
Team Members Invite, remove, change roles
Notifications Email preferences
Integrations GBP reconnect, social reconnect

Team Roles:

Role Permissions
CLIENT (Owner) Full access
EDITOR Can edit content, approve posts
VIEWER Read-only dashboard

3.10 /dashboard/billing — Billing#

Purpose: Manage subscription and payment

Layout: Plan card + invoice table

Current Plan Card:

┌────────────────────────────────────────┐
│  Premium Plan — Rs 12,000/mo           │
│  Next billing: Feb 15, 2025            │
│                                        │
│  Included:                             │
│  ✓ 30 Citations                        │
│  ✓ 12 Social Posts/mo                  │
│  ✓ Custom Domain                       │
│  ✓ 12 GBP Posts/mo                     │
│  ✓ Priority Support                    │
│                                        │
│  [Upgrade] [Cancel]                    │
└────────────────────────────────────────┘

Plan Comparison:

Plan Price Citations Social GBP Custom Domain
Starter Rs 4,000 15 4/mo 4/mo
Standard Rs 8,000 25 8/mo 8/mo
Premium Rs 12,000 30 12/mo 12/mo
Enterprise Rs 20,000 30+ 20/mo 20/mo ✅ + White-label

4. Component Hierarchy#

ClientLayout
├── DashboardShell
│   ├── DashboardSidebar
│   │   ├── PracticeSwitcher (if multiple practices)
│   │   ├── NavGroup "Marketing"
│   │   │   ├── NavItem "GBP" → /dashboard/gbp
│   │   │   ├── NavItem "Social" → /dashboard/social
│   │   │   └── NavItem "Citations" → /dashboard/citations
│   │   ├── NavGroup "Website"
│   │   │   └── NavItem "Landing Page" → /dashboard/site
│   │   ├── NavGroup "Analytics"
│   │   │   ├── NavItem "Reports" → /dashboard/reports
│   │   │   └── NavItem "Leads" → /dashboard/leads
│   │   ├── NavGroup "Content"
│   │   │   └── NavItem "Approval Queue" → /dashboard/content
│   │   └── NavGroup "Account"
│   │       ├── NavItem "Settings" → /dashboard/settings
│   │       └── NavItem "Billing" → /dashboard/billing
│   ├── DashboardHeader
│   │   ├── Breadcrumbs
│   │   ├── NotificationBell (review alerts, citation issues)
│   │   └── UserMenu
│   └── PageContent
│       ├── (page-specific components)
│       └── Cards / Tables / Forms / Charts

Reusable Dashboard Components#

Component Path Used In
StatCard src/components/dashboard/StatCard.tsx Home, GBP, Reports
StatusBadge src/components/dashboard/StatusBadge.tsx Tables
DataTable src/components/dashboard/DataTable.tsx Posts, Reviews, Leads
EmptyState src/components/dashboard/EmptyState.tsx All list pages
LoadingSkeleton src/components/dashboard/LoadingSkeleton.tsx All pages
ConfirmDialog src/components/dashboard/ConfirmDialog.tsx Delete, cancel
DatePicker src/components/dashboard/DatePicker.tsx Scheduler
ImageUploader src/components/dashboard/ImageUploader.tsx Posts, Site
RichTextEditor src/components/dashboard/RichTextEditor.tsx Content, Site
AIAssistButton src/components/dashboard/AIAssistButton.tsx Posts, Replies

5. Data Requirements#

tRPC Queries per Page#

Page Queries Mutations
/dashboard practice.get, gbp.listPosts, review.list, social.listPosts, citation.list, report.list
/dashboard/gbp gbp.listAccounts, gbp.listLocations gbp.getAuthUrl
/dashboard/gbp/posts gbp.listPosts gbp.createPost, gbp.deletePost
/dashboard/gbp/reviews gbp.listReviews gbp.replyToReview
/dashboard/gbp/insights gbp.getInsights
/dashboard/social social.listAccounts, social.listPosts social.createPost, social.schedulePosts
/dashboard/citations citation.list, citation.listDirectories citation.submit, citation.verifyNap
/dashboard/site site.get site.updateSection, site.setTemplate, site.publish
/dashboard/reports report.list, report.get report.generate, report.email
/dashboard/leads lead.list lead.updateStatus
/dashboard/content content.list content.approve, content.reject, content.update
/dashboard/settings practice.get, location.list practice.update, location.create, location.update
/dashboard/billing billing.getPlan, billing.listInvoices billing.createSubscription, billing.cancel

6. Role-Based Access#

Permission Matrix#

Feature CLIENT EDITOR VIEWER
View Dashboard
View GBP
Create GBP Post
Reply to Review
View Social
Create Social Post
View Citations
Request Citation
View Site
Edit Site
View Reports
View Leads
Update Lead Status
Approve Content
View Settings
Edit Settings
View Billing
Manage Team

UI Enforcement#

  • Buttons hidden for unauthorized actions
  • Forms disabled in read-only mode
  • API returns 403 for unauthorized mutations

7. Content Approval Workflow#

Flow Diagram#

AI Generates Content
        ↓
   Status: DRAFT
        ↓
   Auto-queue (24h timer)
        ↓
   Status: PENDING_REVIEW
        ↓
┌─────────────────┐
│  Client sees in │
│  /dashboard/content
└─────────────────┘
        ↓
   ┌────────┐
   │ Approve │ → Status: APPROVED → Auto-publish
   └────────┘
        ↓
   ┌────────┐
   │ Reject  │ → Status: REJECTED → Archive
   └────────┘
        ↓
   ┌────────┐
   │  Edit   │ → Status: PENDING_REVIEW (reset timer)
   └────────┘
        ↓
   Timer expires (24h)
        ↓
   Status: APPROVED → Auto-publish

Approval UI States#

State Badge Color Actions Timer
DRAFT Gray
PENDING_REVIEW Yellow Approve, Reject, Edit Countdown
APPROVED Green
PUBLISHED Blue View live
REJECTED Red Regenerate

8. Responsive Behavior#

Breakpoint Sidebar Content
Desktop (>1024px) Fixed, 240px Full layout
Tablet (768-1024px) Collapsible Adjusted grids
Mobile (<768px) Hidden, hamburger Stacked cards

Mobile Adaptations#

  • Sidebar becomes bottom nav or drawer
  • Data tables become card lists
  • Charts simplified
  • Site preview opens in modal
  • Content approval uses swipe gestures

End of User Dashboard UI Specifications