Cognizant & Full-Stack

StrataAnalytics

Enterprise Intelligence Platform — A React.js + Python data visualization suite providing real-time revenue analytics, cohort analysis, and interactive filtering.

Role Full-Stack Developer
Stack React, Python, MySQL
Type Enterprise Web App
1

Problem Statement

Enterprise teams were drowning in data but starving for insights. Raw MySQL exports and static Excel reports couldn't keep up with the velocity of business decisions. Stakeholders needed a single dashboard that combined revenue tracking, user cohort analysis, and operational metrics — all updated in near-real-time.

Existing tools were either too expensive (Tableau, PowerBI licenses), too slow (custom Django admin panels), or too rigid (Google Sheets dashboards that broke at scale). The team needed a custom solution that was fast, responsive, and maintainable — built with technologies already in the stack.

Core Challenge: Build an enterprise-grade analytics dashboard that combines real-time data visualization, interactive filtering, and responsive design — using React.js for the frontend and Python for data processing, all backed by an optimized MySQL schema.
3x
Faster Data Access
12
Dashboard Components
85%
Query Performance Gain
<2s
Page Load Time
2

System Architecture & Research

Before writing any UI code, I mapped the full data pipeline: from raw MySQL tables through Python aggregation endpoints to React chart components. This systems-thinking approach ensured the frontend wasn't just pretty — it was architecturally sound.

Architecture Overview

System Architecture — Data Flow

MySQL DB - Indexed queries - Partitioned data - Materialized views - Stored procedures - Optimized schemas REST API Python API - Flask endpoints - Data aggregation - Caching layer - Error handling - Input validation JSON React.js Dashboard - Recharts + D3 - Cross-filtering - Skeleton loading - Responsive grid - A11y (ARIA) - Dark/Light themes Browser / User U
Data Flow Architecture
┌──────────────┐     ┌──────────────┐     ┌──────────────┐
│   MySQL DB   │────▶│  Python API  │────▶│  React.js    │
│  (Optimized  │     │  (Flask/     │     │  Dashboard   │
│   Schemas)   │     │   FastAPI)   │     │  (Vite)      │
└──────────────┘     └──────────────┘     └──────────────┘
       │                    │                    │
  Indexed queries    Aggregated metrics    Interactive charts
  Partitioned data   Caching layer         Real-time filtering
  Stored procedures  Error handling        Responsive layout

Research & Technical Decisions

Decision Chosen Why
Chart Library Recharts + D3 React-native components with D3 for custom tooltips
State Management React Context + useReducer Lightweight — no Redux overhead for this scope
API Layer Python Flask Team expertise + existing Python data pipelines
Database MySQL + Views Materialized views for pre-aggregated metrics
Styling CSS Modules + Variables Scoped styles with design token consistency
Build Tool Vite Fast HMR, optimized builds, ESM-native
3

Dashboard UI Design

The dashboard follows a card-based layout with a fixed sidebar for navigation and a responsive grid that adapts from 4-column desktop to single-column mobile. Each metric card is a self-contained component with its own data fetch, loading state, and error boundary.

Key Design Decisions

Component Hierarchy

React Component Tree
<DashboardLayout>
  ├── <Sidebar />
  ├── <Header search={true} />
  ├── <MetricsGrid>
  │   ├── <MetricCard type="revenue" />
  │   ├── <MetricCard type="users" />
  │   ├── <MetricCard type="conversion" />
  │   └── <MetricCard type="retention" />
  ├── <ChartSection>
  │   ├── <RevenueChart />
  │   ├── <CohortAnalysis />
  │   └── <UserFlowSankey />
  └── <DataTable pagination={true} />
</DashboardLayout>
4

Code Implementation

A highlight of the implementation is the custom hook for data fetching with caching, debounced filtering, and automatic re-fetch on dependency change. This pattern was extracted into a reusable utility across all dashboard components.

useDashboardData.js — Custom Hook
import { useState, useEffect, useCallback } from 'react';

export function useDashboardData(endpoint, filters = {}) {
  const [data, setData] = useState(null);
  const [loading, setLoading] = useState(true);
  const [error, setError] = useState(null);

  const fetchData = useCallback(async () => {
    setLoading(true);
    try {
      const params = new URLSearchParams(filters);
      const res = await fetch(`${endpoint}?${params}`);
      if (!res.ok) throw new Error(`HTTP ${res.status}`);
      const json = await res.json();
      setData(json);
      setError(null);
    } catch (err) {
      setError(err.message);
    } finally {
      setLoading(false);
    }
  }, [endpoint, JSON.stringify(filters)]);

  useEffect(() => { fetchData(); }, [fetchData]);

  return { data, loading, error, refetch: fetchData };
}
SQL — Optimized Revenue Query
-- Materialized view for dashboard revenue metrics
CREATE VIEW v_monthly_revenue AS
SELECT
  DATE_FORMAT(transaction_date, '%Y-%m') AS month,
  SUM(amount) AS total_revenue,
  COUNT(DISTINCT user_id) AS active_users,
  ROUND(SUM(amount) / COUNT(DISTINCT user_id), 2) AS arpu
FROM transactions
WHERE status = 'completed'
GROUP BY DATE_FORMAT(transaction_date, '%Y-%m')
ORDER BY month DESC;
Performance: By combining MySQL materialized views for pre-aggregated data with React's useMemo for client-side computation, the dashboard handles 100K+ rows without frame drops. Page load is under 2 seconds on 3G connections.
5

Responsive Design & Accessibility

The dashboard was designed mobile-first, with a collapsible sidebar and stacked card layout on smaller screens. Charts resize gracefully using SVG viewBox, and touch interactions replace hover states on mobile.

Feature Implementation Standard
Color Contrast All text meets 4.5:1 minimum; critical metrics at 7:1 WCAG 2.1 AA / AAA
Keyboard Navigation Full tab order, arrow key chart navigation, Enter to select WCAG 2.1 2.1.1
Screen Readers ARIA labels on all charts, role="img" with descriptions WCAG 2.1 1.1.1
Focus Management Visible focus rings, logical tab order, skip-to-content link WCAG 2.1 2.4.7
Reduced Motion @media (prefers-reduced-motion) disables all animations WCAG 2.1 2.3.3
6

Outcome & Impact

3x
Faster Data Access
85%
Query Improvement
12
Reusable Components
100%
Mobile Responsive

StrataAnalytics replaced the previous workflow of exporting CSV files and building manual charts in Excel. Stakeholders now have a self-service analytics platform with real-time data, interactive filtering, and shareable dashboard links. The Python data pipeline runs nightly aggregations and caches results, ensuring sub-second load times even for historical data spanning 3+ years.

The component architecture was designed for extensibility — new chart types and data sources can be added by creating a single component file and registering it in the dashboard config. This pattern has been adopted by two subsequent teams at Cognizant.

React.js Python MySQL Data Visualization REST APIs Responsive Design Accessibility

Key Takeaways

← Previous: HYDRA-CORE Next: Meditate UX →