React + TypeScript dashboard for the GenAI-Powered Cloud Security Copilot Built for the Elasticsearch Agent Builder Hackathon & Amazon Nova AI Hackathon — 2026
- Overview
- Tech Stack
- Project Structure
- Pages
- Components
- API Integration
- Setup & Installation
- Available Scripts
- Environment & Configuration
- Backend Connection
CloudGuard Frontend is a real-time security operations dashboard that connects to a FastAPI + Elasticsearch backend. It provides:
- Live security posture scoring — fetched from backend on every page load
- Interactive findings explorer — filter, sort, expand 200+ security findings
- Cost waste analysis — identify and quantify underutilized AWS resources
- AI Security Copilot — conversational interface powered by Amazon Nova 2 Lite
- Scan history & trends — track security posture improvement over time
- Run Scan button — triggers a live re-scan of all cloud resources
All data is fetched in real time from the backend API. There is no mock data.
| Technology | Version | Purpose |
|---|---|---|
| Vite | 5.x | Build tool and dev server |
| React | 18 | UI framework |
| TypeScript | 5.x | Type safety |
| Tailwind CSS | 3.x | Utility-first styling |
| shadcn/ui | latest | Pre-built accessible components |
| Recharts | 2.x | Charts (line, pie, bar) |
| React Router | 6.x | Client-side routing |
| Framer Motion | latest | Page transition animations |
| Lucide React | latest | Icon library |
| TanStack Query | 5.x | Server state management |
glow-app-architect/
├── src/
│ ├── data/
│ │ └── api.ts # All backend API calls + TypeScript types
│ │
│ ├── pages/
│ │ ├── ProductOverview.tsx # Landing/home page (route: /)
│ │ ├── Index.tsx # Main dashboard (route: /dashboard)
│ │ ├── Findings.tsx # Security findings table (route: /findings)
│ │ ├── CostAnalysis.tsx # Cost waste analysis (route: /cost)
│ │ ├── Copilot.tsx # AI chat interface (route: /copilot)
│ │ ├── Logs.tsx # System logs viewer (route: /logs)
│ │ ├── SettingsPage.tsx # Settings (route: /settings)
│ │ └── NotFound.tsx # 404 page (route: *)
│ │
│ ├── components/
│ │ ├── AppLayout.tsx # Root layout — header + sidebar + page transitions
│ │ ├── AppHeader.tsx # Top navigation bar (unused — logic in AppLayout)
│ │ ├── AppSidebar.tsx # Slide-in navigation sidebar
│ │ ├── MetricCard.tsx # KPI card (score, count, dollar amount)
│ │ ├── SeverityChart.tsx # Donut chart — findings by severity
│ │ ├── TrendChart.tsx # Line chart — security score over time
│ │ ├── SeverityBadge.tsx # Colored badge (CRITICAL/HIGH/MEDIUM/LOW)
│ │ ├── NavLink.tsx # Sidebar navigation link
│ │ └── ui/ # shadcn/ui base components
│ │
│ ├── App.tsx # Router setup — all routes defined here
│ ├── main.tsx # React entry point
│ └── index.css # Global styles + Tailwind directives
│
├── public/
├── index.html
├── vite.config.ts
├── tailwind.config.ts
├── tsconfig.json
└── package.json
Landing page introducing CloudGuard. No backend calls.
Main dashboard. Fetches and displays:
- 4 metric cards: Security Score, Critical Findings, Monthly Waste, Resources Scanned
- Security Score Trend line chart (7-day history)
- Findings by Severity donut chart
- Top 5 risk findings table
- Recent events log (static)
API calls: GET /api/score/ + GET /api/findings/top?limit=5
Full findings explorer with:
- Filter by severity (ALL / CRITICAL / HIGH / MEDIUM / LOW)
- Sort by risk score (ascending/descending)
- Click to expand — shows Description, Remediation, Business Impact
- Shows count per severity in filter buttons
API calls: GET /api/findings/top?limit=200
Cost waste dashboard showing:
- Total monthly waste, annual projection, idle resource count, savings rate
- Bar chart: Monthly Cost vs Estimated Waste per resource
- Detailed table: Resource ID, Type, Region, CPU Avg, Monthly Cost, Waste
API calls: GET /api/findings/cost-waste
Conversational AI interface:
- Powered by Amazon Nova 2 Lite via the backend agent
- Shows which Elasticsearch tools were called per response
- Suggested question buttons for quick queries
- Typing indicator while agent is reasoning
- Falls back to informative message if backend is offline
API calls: POST /api/chat/ with {"message": "..."}
Terminal-style log viewer showing scan history and rule engine output. Static entries styled as real-time logs.
Settings interface (UI only).
Root layout component wrapping every page. Contains:
- Run Scan button — calls
POST /api/score/scan, shows spinner during scan, displays result message, auto-reloads page after completion - Last scan timestamp — updates after each successful scan
- Slide-in sidebar — toggled by hamburger menu
- Page transition animations via Framer Motion
Displays a single KPI with label, value, trend, and color-coded status.
Props:
{
label: string // e.g. "Security Score"
value: string // e.g. "32/100"
trend: string // e.g. "↓ At Risk"
status: "normal" | "warning" | "critical"
}Recharts PieChart with donut style. Fetches live counts from /api/findings/summary on mount. Shows Critical/High/Medium/Low with percentages.
Recharts LineChart. Fetches 7-day scan history from /api/score/trend. Shows Security and Cost Health score lines. Displays empty state message if fewer than 2 data points exist.
Colored pill badge for severity levels:
- 🔴 CRITICAL — red
- 🟠 HIGH — orange
- 🟡 MEDIUM — yellow
- 🟢 LOW — green
Animated slide-in sidebar with navigation links to all pages. Shows system status indicator at bottom.
All backend communication is centralized in src/data/api.ts.
const BASE = "http://localhost:8000/api";getScore() // GET /score/ → ScoreData
getScoreTrend(days?) // GET /score/trend → TrendPoint[]
getFindingsSummary() // GET /findings/summary → FindingsSummary
getCriticalFindings() // GET /findings/critical → Finding[]
getTopFindings(limit?) // GET /findings/top → Finding[]
getCostWaste() // GET /findings/cost-waste → CostWasteResponse
sendChat(message) // POST /chat/ → ChatResponse
runScan() // POST /score/scan → ScanResult
buildMetrics(score) // Helper — converts ScoreData to MetricData[]interface Finding {
finding_id: string;
resource_id: string;
resource_type: string;
rule_id: string;
title: string;
description: string;
severity: "CRITICAL" | "HIGH" | "MEDIUM" | "LOW";
risk_score: number;
remediation: string;
business_impact: string;
detected_at: string;
}
interface ScoreData {
security_score: number;
cost_health_score: number;
monthly_waste: number;
total_findings: number;
critical_count: number;
high_count: number;
last_scan: string;
}
interface CostItem {
resource_id: string;
instance_type: string;
region: string;
cpu_avg: number;
monthly_cost: number;
estimated_waste: number;
}- Node.js 18+
- Backend running on
http://localhost:8000
cd glow-app-architect
npm installnpm run devFrontend runs at: http://localhost:8080
npm run build| Script | Command | Description |
|---|---|---|
| Dev server | npm run dev |
Start Vite dev server on :8080 |
| Build | npm run build |
Production build to dist/ |
| Preview | npm run preview |
Preview production build |
| Lint | npm run lint |
Run ESLint |
| Test | npm run test |
Run Vitest tests |
No .env file needed for the frontend. The backend URL is configured directly in src/data/api.ts:
const BASE = "http://localhost:8000/api";To change the backend URL (e.g. for production deployment), update this line.
The frontend expects the CloudGuard backend to be running at http://localhost:8000.
| Requirement | Value |
|---|---|
| Backend URL | http://localhost:8000 |
| CORS | Backend must allow http://localhost:8080 |
| Required endpoints | /api/score/, /api/findings/*, /api/chat/, /api/score/scan |
cd cloud-security-copilot/backend
source venv/bin/activate
uvicorn main:app --reload# Terminal 1 — Backend
cd cloud-security-copilot/backend && source venv/bin/activate && uvicorn main:app --reload
# Terminal 2 — Frontend
cd glow-app-architect && npm run dev| URL | Page | Component |
|---|---|---|
/ |
Product Overview | ProductOverview.tsx |
/dashboard |
Infrastructure Overview | Index.tsx |
/findings |
Security Findings | Findings.tsx |
/cost |
Cost Analysis | CostAnalysis.tsx |
/copilot |
AI Copilot | Copilot.tsx |
/logs |
System Logs | Logs.tsx |
/settings |
Settings | SettingsPage.tsx |
* |
Not Found | NotFound.tsx |
Part of the CloudGuard — GenAI-Powered Cloud Security Copilot