Modern React SPA with cyberpunk aesthetics for Kubernetes and GitOps management.
- Framework: React 19 + TypeScript
- Build Tool: Vite 7.1
- Styling: Tailwind CSS with cyberpunk theme
- State Management: Zustand
- Charts: Recharts
- Icons: Lucide React
- Package Manager: pnpm
- Black background with green/yellow/cyan accents
- Monospace fonts (terminal aesthetic)
- Matrix-style color scheme
- Responsive design
- Pod List: View, restart, delete pods
- Deployments: Scale and manage deployments
- Nodes: Monitor node health and resources
- Logs: Real-time pod log viewing
- Repositories: Connect and sync Git repos
- Applications: Deploy and manage applications
- Sync Status: Track deployment states
- Cluster Overview: Resource usage charts
- Node Metrics: CPU, memory, storage per node
- Historical Trends: Time-series data visualization
- Resource Analytics: Detailed usage breakdowns
- Login/logout with role-based access
- Token-based authentication
- User profile management
src/
├── components/ # React components
│ ├── auth/ # Authentication components
│ ├── gitops/ # GitOps management
│ ├── kubernetes/ # Kubernetes resources
│ ├── metrics/ # Monitoring dashboards
│ └── ui/ # Common UI components
├── stores/ # Zustand state management
├── types/ # TypeScript type definitions
├── utils/ # Utility functions
├── App.tsx # Main application component
└── main.tsx # Application entry point
- Node.js 22+
- pnpm 9+
cd frontend
pnpm installpnpm devRuns on http://localhost:5173
pnpm buildOutputs to dist/ directory
pnpm previewClean import paths using TypeScript path mapping:
import Component from '@components/Component'
import { useStore } from '@stores/store'
import type { User } from '@types/auth'
import { formatDate } from '@utils/date'Available aliases:
@/*→./src/*@components/*→./src/components/*@stores/*→./src/stores/*@types/*→./src/types/*@utils/*→./src/utils/*
Using Zustand for lightweight state management:
// stores/authStore.ts
const useAuthStore = create<AuthState>((set) => ({
user: null,
token: null,
login: (token, user) => set({ token, user }),
logout: () => set({ token: null, user: null }),
}))Custom cyberpunk color palette:
- Primary: Green (#00FF00)
- Secondary: Yellow (#FFFF00)
- Accent: Cyan (#00FFFF)
- Background: Black (#000000)
- Text: White (#FFFFFF)
<div className="bg-black border border-white text-green-400 font-mono">
<h1 className="text-lg font-bold">KUBERNETES CLUSTER</h1>
</div>Using Recharts for data visualization:
- Line charts for metrics trends
- Radial charts for resource usage
- Custom tooltips with cyberpunk styling
- Responsive containers
<ResponsiveContainer width="100%" height={300}>
<LineChart data={metricsData}>
<Line
dataKey="cpu"
stroke="#00FF00"
strokeWidth={2}
name="CPU Usage"
/>
</LineChart>
</ResponsiveContainer>Fetch API for backend communication:
// utils/api.ts
const api = {
get: (url: string) =>
fetch(`/api${url}`, {
headers: { Authorization: `Bearer ${token}` }
}),
post: (url: string, data: any) =>
fetch(`/api${url}`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${token}`
},
body: JSON.stringify(data)
})
}Full TypeScript coverage with strict mode:
// types/kubernetes.ts
export interface Pod {
name: string
namespace: string
status: PodStatus
containers: Container[]
createdAt: string
}
export interface ClusterMetrics {
cpu_usage: ResourceUsage
memory_usage: ResourceUsage
storage_usage: ResourceUsage
node_count: number
pod_count: number
}The frontend is built and embedded into the Go backend:
# Frontend dist/ copied to backend/cmd/server/spa/
# Go embed directive includes all assets
//go:embed all:spa
var frontendAssets embed.FSFor development or separate deployment:
pnpm build
pnpm preview # Serves dist/ on port 4173Configure via .env:
VITE_API_URL=http://localhost:8080/api # Backend API URL
VITE_WS_URL=ws://localhost:8080/ws # WebSocket URL
- Chrome 88+
- Firefox 85+
- Safari 14+
- Edge 88+
Modern features used:
- ES2022 syntax
- CSS Grid & Flexbox
- Web APIs (Fetch, WebSocket)
- TypeScript 5.3