← Back
Case Study

B2B SaaS Analytics Dashboard

A PRD focusing on data visualization, multi-tenant architecture, and Role-Based Access Control (RBAC) for a B2B application.

Document Status: In ReviewVersion 1.2

1. Metadata

Project Name

Analytics Dashboard V1

Product Manager

Sarah Lee

Target Release

Q4 2024

2. User Personas

Workspace Admin

Can view all organization data, invite users, and manage billing. Needs a high-level summary of active users and revenue.

Analyst (Viewer)

Can only view specific projects assigned to them. Cannot see billing or invite new users.

3. Technical Constraints

  • Multi-Tenancy Security

    All database queries MUST include the tenant_id to prevent cross-workspace data leaks. This is a P0 security requirement.

  • Performance (NFR)

    Dashboard widgets must load within 800ms at the 95th percentile. Aggregation queries should be cached using Redis.

Out-of-Scope (V1)

  • Custom widget builder / drag-and-drop dashboard editing.
  • PDF / CSV Export functionality (Deferred to V2).
  • Real-time websocket updates (Data refreshes on page load only).

4. Functional Requirements

IDRequirementAcceptance Criteria
REQ-01MRR Line Chart
Display Monthly Recurring Revenue over the last 12 months.
- Chart library: Recharts or Chart.js.
- X-axis: Month (e.g., Jan 2024).
- Hover tooltip shows exact MRR value.
REQ-02Role-Based Navigation
Hide restricted features from Viewers.
- "Settings" and "Billing" tabs are hidden for the Analyst role.
- Server-side redirect (403) if an Analyst tries to access /billing directly.

5. Data Architecture Notes

Table: Users
id: uuid (PK)
tenant_id: uuid (FK - Tenants)
email: varchar
role: enum('ADMIN', 'VIEWER')

6. API Contracts (Endpoints)

MethodEndpointDescriptionResponse
GET/api/v1/workspaces/:id/mrrFetches monthly recurring revenue aggregated by month.[{ month: 'Jan', value: 5000 }]
POST/api/v1/workspaces/:id/invitesInvites a new user. Admin only.{ status: 'success' }

7. System Architecture

Next.js FrontendDashboard UI
Node.js API GatewayAuth & Rate Limiting
PostgreSQL (Primary)
Redis (Cache)

8. Success Metrics (KPIs)

  • <500

    Query Latency (ms)

    The 95th percentile (P95) load time for the dashboard must be under 500 milliseconds.

  • 80%

    Daily Active Users (DAU) Engagement

    80% of active admins should interact with the new MRR chart at least once a week.