Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

94 Commits

Folders and files

Repository files navigation

Netlify Status

Rotaract South Asia Analytics Dashboard (Insights)

Get it on ChatGPT Connect on Claude

An executive analytics and intelligence dashboard for Rotaract South Asia MDIO, providing comprehensive membership, compliance, youth service (Interact), and TRF contribution metrics across Zones 4, 5, 6 & 7 and worldwide.


🚀 Key Features

  • Executive Dashboard (/): Multi-select Zone & District filtering, interactive KPI cards, demographic distributions, top leaderboards, and deep data drilldown tables.
  • Zone Drilldown (/zone/[zoneId]): Granular zone-level analytics, district comparison directories, and demographic breakdowns.
  • District Deep Dive (/district/[districtId]): District officer directories, compliance alerts (arrears, missing officers), TRF impact, and club rosters.
  • Universal Club Report (/club/[clubId]): Dedicated profiles for Rotaract clubs across South Asia featuring membership standing, sponsorship details, TRF contributions, and compliance status.
  • Worldwide Statistics (/worldwide): Global Rotaract & Interact club and membership leaderboards with quarter-over-quarter and baseline growth analysis.
  • Youth Service & Interact Ecosystem: Tracking Rotary clubs without Rotaract/Interact sponsorship, Interact club growth, and expansion opportunity metrics.
  • Model Context Protocol (MCP) Server: 15 analytical AI tools (including list_baseline_outcomes), 9 resources, and 4 prompts over local stdio (npm run mcp) and remote HTTP (POST /api/mcp). HTTP is dual-era: default 2025-11-25 (OpenAI-compatible legacy), full 2026-07-28 when requested (Claude modern connectors). Stdio stays on the MCP SDK 2025-11-25 path until upstream ships 2026-07-28.
  • MCP Documentation (/docs): Human-friendly setup guide for Claude, ChatGPT, Cursor, and other MCP clients, plus tool, resource, and workflow reference.
  • Public REST API (/api/v1/): Internal/compatibility JSON endpoints (summary, leaderboards, districts, clubs, compliance, opportunities, TRF, interact, worldwide). Prefer MCP for AI assistants.
  • Production Host Routing: Canonical production routing at https://insights.rsamdio.org/ with 301 edge redirects for Netlify subdomains and legacy addresses.
  • SEO / GEO / AIO: /llms.txt (llmstxt.org v2), /llms-full.txt, /ai-overview.md, enriched JSON-LD (Organization, WebSite, Dataset, SoftwareApplication), AI-crawler-aware robots.txt, and sitemap entries for discovery files.

🛠️ Tech Stack

  • Framework: Next.js 16 (App Router) with React 19
  • Visual Analytics: Chart.js & react-chartjs-2 with datalabels
  • Data Tables: TanStack Table (@tanstack/react-table) with client-side sorting, pagination, and multi-field search
  • AI & Integrations: Model Context Protocol (MCP) SDK (@modelcontextprotocol/sdk), OpenAPI 3.1.0
  • Styling: Vanilla CSS (app/globals.css) with glassmorphism, responsive grid layouts, and mobile-first media queries
  • Typography: Self-hosted next/font/google (Inter) with zero render-blocking requests
  • Analytics: Google Analytics (gtag.js) with automatic client-side App Router route tracking

📁 Project Structure

├── app/                      # Next.js App Router routes
│   ├── layout.js             # Root layout with header badge & footer
│   ├── page.js               # Executive dashboard
│   ├── zone/[zoneId]/        # Zone drilldown pages
│   ├── district/[districtId]/# District deep dive pages
│   ├── club/[clubId]/        # Universal club report pages
│   ├── worldwide/            # Worldwide statistics page
│   ├── docs/                 # MCP setup & tool documentation
│   ├── .well-known/          # Domain verification challenge
│   └── api/                  # API endpoints
│       ├── v1/               # 20 Public REST endpoints
│       ├── mcp/              # Remote MCP JSON-RPC 2.0 endpoint
│       └── filters/          # UI filter options endpoint
├── components/               # Reusable React components
│   ├── charts/               # Chart.js visualizations (Bar, Doughnut)
│   ├── sections/             # TopCharts, KPI leaderboards
│   ├── tables/               # TanStack DataTables & GlobalTables
│   └── ui/                   # MetricCards, HeaderFilters, Analytics, Tabs
├── data/                     # Pre-aggregated JSON & CSV data payloads
├── fulldata/                 # Raw master Excel workbooks
├── basedata/                 # Historical baseline CSV files
├── lib/                      # Core business logic & API services
│   ├── api.js                # Data access layer & cache
│   ├── services/             # Analytics & query services
│   └── mcp/                  # MCP tool definitions & schemas
├── openai-skills/            # Packaged OpenAI agent skills
├── public/                   # Static assets, redirects & openapi.json
│   ├── _redirects            # Netlify CDN edge redirects
│   └── openapi.json          # OpenAPI 3.1.0 specification
├── scripts/                  # Data processing & verification pipeline
│   ├── generate_dashboard_data.js
│   ├── mcp_server.js         # Stdio MCP server
│   ├── validate_harness.js   # Integrity validator
│   └── verify_production.mjs # Integration test suite
├── netlify.toml              # Netlify configuration & redirects
├── proxy.js                  # Next.js 16 host proxy middleware
└── .agents/                  # AI agent rules & architecture documentation

⚡ Quick Start

1. Prerequisites

  • Node.js 18.17+ or 20+
  • npm or yarn

2. Installation

npm install

3. Running Locally

npm run dev

Open http://localhost:3000 in your browser.

4. Building for Production

npm run build
npm run start

5. AI Assistant & Model Context Protocol (MCP)

Run the local MCP stdio server for Cursor, Claude Desktop, or Antigravity (MCP SDK protocol 2025-11-25):

npm run mcp

Or connect remotely via SSE at https://insights.rsamdio.org/sse or HTTP JSON-RPC 2.0 at POST https://insights.rsamdio.org/api/mcp (dual-era: default 2025-11-25, full 2026-07-28 when negotiated).

6. Automated Testing & Verification

# Validate documentation links, data schemas, and typography invariants
npm run validate-harness

# Run automated integration smoke tests against production or localhost
node scripts/verify_production.mjs https://insights.rsamdio.org

📊 Data Pipeline & Updates

The dashboard relies on pre-aggregated data generated from master Excel files (fulldata/MasterData.xlsx) and baseline files (basedata/).

Updating Master Data:

  1. Place the new master workbook in fulldata/MasterData.xlsx.
  2. Update the DATA_AS_OF_DATE constant at the top of scripts/generate_dashboard_data.js (e.g. '13 Aug 2026').
  3. Run the data generator:
    npm run generate-data
  4. The script parses the raw club sheets, calculates deltas, and updates all JSON/CSV files in data/. The UI automatically detects updated files without requiring a server restart.

📈 Telemetry & Observability (Axiom)

The REST API endpoints and Model Context Protocol (MCP) server include structured, non-blocking telemetry powered by Axiom ($0/month on Axiom Cloud Free tier up to 500 GB/month).

Environment Variables:

Variable Description Default
AXIOM_TOKEN Axiom API Token with Ingest permission (AXIOM_API_TOKEN alias also accepted) (Disabled if omitted)
AXIOM_DATASET Target dataset name rotaract-analytics
AXIOM_ORG_ID Optional organization ID None
AXIOM_URL Axiom API base URL https://api.axiom.co
DEBUG_TELEMETRY Set to 1 or true to print telemetry payloads to console false

Ingested Event Types:

  • api_request: Path, normalized route, HTTP method, status code, latency (ms), query parameters, caller IP, user agent, referer.
  • mcp_tool: MCP tool name, sanitized arguments, execution latency (ms), outcome (success/failure), error details, caller source (http, sse, stdio, http-direct), returned slice item count (resultCount), total matching database records (totalMatches), caller IP, user agent, session ID, JSON-RPC request ID, optional protocolVersion / protocolEra / resultType.
  • mcp_request: Protocol methods (initialize, server/discover, tools/list, tools/call, manifest/get, sse/connect), status code, latency, user agent, caller IP, session ID, negotiated protocolVersion, optional requestedProtocolVersion, protocolEra (legacy|modern), negotiationOutcome, errorCode, bounded clientName/clientVersion, and resultType when present.

Reliability & Delivery Guarantees:

  • Serverless Anti-Freeze: Route handlers coordinate with flushTelemetry(800) to ensure pending ingestion tasks complete before AWS Lambda / Netlify execution freezes on response completion.
  • Auto-Loaded Stdio Environment: scripts/mcp_server.js automatically loads .env.local or .env at startup for zero-configuration tracing during Cursor, Claude Desktop, or CLI sessions.
  • Safe Fallback: When AXIOM_TOKEN is not configured, telemetry is safely disabled with zero overhead, network requests, or crashes.

🔒 License & Disclaimer

The information in this dashboard is sourced from Rotary International / RISAO for informational purposes by Rotaract South Asia MDIO. Official notices of dues and termination are issued exclusively by Rotary International.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages