post CLAUDE updates

had CLAUDE AI made suggestions and edits to code.
added all route and moves some requirements around.
This commit is contained in:
2025-06-17 06:13:59 -04:00
parent 80276d4b74
commit 99d3fbc2b3
13 changed files with 12893 additions and 86 deletions

View File

@@ -1,34 +1,34 @@
{
"name": "velo-threat-hunter-ui",
"version": "0.1.0",
"name": "velo-threat-hunter",
"private": true,
"version": "1.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"test": "vitest"
},
"dependencies": {
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.0",
"@mui/icons-material": "^6.4.8",
"@mui/material": "^6.4.8",
"@tailwindcss/vite": "^4.1.7",
"axios": "^1.10.0",
"csv-parser": "^3.2.0",
"express": "^5.1.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^6.26.1",
"lucide-react": "^0.515.0",
"multer": "^2.0.1",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-dropzone": "^14.3.8",
"react-router": "^7.6.0"
"axios": "^1.7.2"
},
"devDependencies": {
"@types/react-router": "^5.1.20",
"@vitejs/plugin-react": "^4.4.1",
"autoprefixer": "^10.4.21",
"postcss": "^8.5.5",
"tailwindcss": "^4.1.10",
"vite": "^6.3.5"
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.1",
"eslint": "^8.57.0",
"eslint-plugin-react": "^7.34.3",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.7",
"vite": "^5.3.4",
"vitest": "^1.6.0",
"tailwindcss": "^3.4.4",
"autoprefixer": "^10.4.19",
"postcss": "^8.4.39"
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,14 +1,19 @@
import React, { Suspense, useMemo, lazy } from "react";
import { createTheme, ThemeProvider } from "@mui/material/styles";
import { CssBaseline } from "@mui/material";
import { BrowserRouter, Routes, Route } from "react-router";
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
import Sidebar from "./components/Sidebar";
const HomePage = lazy(() => import("./components/HomePage"));
const Baseline = lazy(() => import("./components/Baseline"));
const Networking = lazy(() => import("./components/Networking"));
const Applications = lazy(() => import("./components/Applications"));
const SecurityTools = lazy(() => import("./components/securitytools"));
const CSVProcessing = lazy(() => import("./components/CSVProcessing"));
const SettingsConfig = lazy(() => import("./components/SettingsConfig"));
const VirusTotal = lazy(() => import("./components/VirusTotal"));
function App() {
const theme = useMemo(
() =>
createTheme({
@@ -22,20 +27,27 @@ function App() {
return (
<ThemeProvider theme={theme}>
<CssBaseline />
<div className="flex h-screen text-white">
<Sidebar />
<div className="flex-1 p-6 overflow-auto">
<BrowserRouter>
<div className="flex h-screen bg-zinc-900 text-white">
<Router>
<Sidebar />
<main className="flex-1 p-6 overflow-auto">
<Suspense fallback={<div>Loading...</div>}>
<Routes>
<Route path="/" element={<HomePage />} />
<Route path="/baseline" element={<Baseline />} />
<Route path="/securitytools" element={<SecurityTools />} />
<Route path="/networking" element={<Networking />} />
<Route path="/applications" element={<Applications />} />
<Route path="/csv-processing" element={<CSVProcessing />} />
<Route path="/settings" element={<SettingsConfig />} />
<Route path="/virus-total" element={<VirusTotal />} />
<Route path="/security-tools" element={<SecurityTools />} />
</Routes>
</Suspense>
</BrowserRouter>
</div>
</main>
</Router>
</div>
</ThemeProvider>
);
}
export default App;

View File

@@ -1,7 +1,95 @@
import React from 'react';
import React, { useState, useEffect } from 'react';
import { Activity, Upload, FileText, Shield } from 'lucide-react';
const HomePage = () => {
return <div>Home Page Placeholder</div>;
const [stats, setStats] = useState({
filesUploaded: 0,
analysesCompleted: 0,
threatsDetected: 0
});
useEffect(() => {
// Fetch dashboard stats
fetch('/api/stats')
.then(res => res.json())
.then(data => setStats(data))
.catch(err => console.error('Failed to fetch stats:', err));
}, []);
return (
<div className="space-y-6">
<div>
<h1 className="text-3xl font-bold mb-2">Velo Threat Hunter</h1>
<p className="text-zinc-400">
Advanced threat hunting and security analysis platform
</p>
</div>
<div className="grid grid-cols-1 md:grid-cols-3 gap-6">
<div className="card">
<div className="flex items-center">
<Upload className="w-8 h-8 text-cyan-400 mr-4" />
<div>
<h3 className="text-lg font-semibold">Files Uploaded</h3>
<p className="text-2xl font-bold text-cyan-400">{stats.filesUploaded}</p>
</div>
</div>
</div>
<div className="card">
<div className="flex items-center">
<Activity className="w-8 h-8 text-green-400 mr-4" />
<div>
<h3 className="text-lg font-semibold">Analyses Completed</h3>
<p className="text-2xl font-bold text-green-400">{stats.analysesCompleted}</p>
</div>
</div>
</div>
<div className="card">
<div className="flex items-center">
<Shield className="w-8 h-8 text-red-400 mr-4" />
<div>
<h3 className="text-lg font-semibold">Threats Detected</h3>
<p className="text-2xl font-bold text-red-400">{stats.threatsDetected}</p>
</div>
</div>
</div>
</div>
<div className="card">
<h2 className="text-xl font-bold mb-4">Quick Actions</h2>
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
<button className="btn-primary flex items-center justify-center">
<Upload className="w-5 h-5 mr-2" />
Upload File for Analysis
</button>
<button className="btn-secondary flex items-center justify-center">
<FileText className="w-5 h-5 mr-2" />
View Recent Reports
</button>
</div>
</div>
<div className="card">
<h2 className="text-xl font-bold mb-4">System Health</h2>
<div className="space-y-2">
<div className="flex justify-between">
<span>Backend Status</span>
<span className="text-green-400"> Healthy</span>
</div>
<div className="flex justify-between">
<span>Database Connection</span>
<span className="text-green-400"> Connected</span>
</div>
<div className="flex justify-between">
<span>Storage Available</span>
<span className="text-yellow-400"> 75% Used</span>
</div>
</div>
</div>
</div>
);
};
export default HomePage;

View File

@@ -1,32 +1,50 @@
import React, { useState } from 'react';
import { Link, useLocation } from 'react-router-dom';
import {
ShieldCheck, Server, Bug, Lock, Globe, Settings,
ChevronDown, ChevronRight, Folder
ShieldCheck,
Server,
Bug,
Folder,
Globe,
Settings,
ChevronDown,
ChevronRight,
} from 'lucide-react';
import AddIcon from '@mui/icons-material/Add';
import BugReportIcon from '@mui/icons-material/BugReport';
import EngineeringIcon from '@mui/icons-material/Engineering';
const SidebarItem = ({ icon: Icon, label, children }) => {
const [open, setOpen] = useState(false);
const SidebarItem = ({ icon: Icon, label, to, children }) => {
const [isOpen, setIsOpen] = useState(false);
const location = useLocation();
const hasChildren = !!children;
const isActive = location.pathname === to;
const handleClick = () => {
if (hasChildren) {
setIsOpen(!isOpen);
}
};
const itemContent = (
<div
className={`sidebar-item ${isActive ? 'bg-zinc-800' : ''}`}
onClick={handleClick}
>
<Icon className="sidebar-icon" />
<span className="flex-grow">{label}</span>
{hasChildren && (isOpen ? <ChevronDown className="w-4 h-4" /> : <ChevronRight className="w-4 h-4" />)}
</div>
);
return (
<div className="text-sm w-full">
<div
className="flex items-center justify-between px-4 py-2 cursor-pointer rounded hover:bg-zinc-800 text-white transition-all"
onClick={() => hasChildren && setOpen(!open)}
>
<div className="flex items-center space-x-3">
<Icon className="w-5 h-5 text-cyan-400" />
<span>{label}</span>
{hasChildren &&
(open ? <AddIcon className="w-4 h-4" /> : <ChevronRight className="w-4 h-4" />)}
</div>
</div>
{hasChildren && open && (
<div className="text-sm">
{to && !hasChildren ? (
<Link to={to}>{itemContent}</Link>
) : (
itemContent
)}
{hasChildren && isOpen && (
<div className="ml-8 mt-1 space-y-1 text-zinc-400">
{children}
</div>
@@ -36,20 +54,24 @@ const SidebarItem = ({ icon: Icon, label, children }) => {
};
const Sidebar = () => (
<div className="h-screen w-64 shadow-lg p-4 flex flex-col space-y-2">
<div className="w-56 h-full bg-zinc-950 p-4 flex flex-col space-y-2 rounded-r-xl shadow-md">
<h2 className="text-xl font-bold text-white mb-4">Threat Hunt Dashboard</h2>
<SidebarItem icon={ShieldCheck} label="HomePage" />
<SidebarItem icon={Server} label="Baseline" />
<SidebarItem icon={Bug} label="Networking" />
<SidebarItem icon={Folder} label="Applications" />
<SidebarItem icon={Globe} label="CSV Processing" />
<SidebarItem icon={Settings} label="Security Tools">
<div>Anti Virus</div>
<div>Endpoint Detection & Response</div>
<div>Virtual Private Networks</div>
</SidebarItem>
<SidebarItem icon={BugReportIcon} label="Virus Totals" />
<SidebarItem icon={EngineeringIcon} label="Settings & Config" />
<SidebarItem icon={ShieldCheck} label="HomePage" to="/" />
<SidebarItem icon={Server} label="Baseline" to="/baseline" />
<SidebarItem icon={Bug} label="Networking" to="/networking" />
<SidebarItem icon={Folder} label="Applications" to="/applications" />
<SidebarItem icon={Globe} label="CSV Processing" to="/csv-processing" />
<SidebarItem
icon={Settings}
label="Tools / Configs"
children={
<>
<Link to="/security-tools" className="block hover:text-white">Security Tools</Link>
<Link to="/settings" className="block hover:text-white">Configuration</Link>
</>
}
/>
<SidebarItem icon={Globe} label="Virus Total" to="/virus-total" />
</div>
);

View File

@@ -61,4 +61,4 @@ const SecurityTools = () => {
);
};
export default SecurityTools;
export default SecurityTools;

View File

@@ -1 +1,33 @@
@import "tailwindcss";
@import "tailwindcss";
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer base {
body {
@apply bg-zinc-900 text-white font-sans;
}
}
@layer components {
.sidebar-item {
@apply flex items-center cursor-pointer px-4 py-2 rounded-xl hover:bg-zinc-800 transition-all;
}
.sidebar-icon {
@apply w-5 h-5 mr-3 text-cyan-400;
}
.card {
@apply bg-zinc-800 rounded-lg p-6 shadow-lg;
}
.btn-primary {
@apply bg-cyan-600 hover:bg-cyan-700 text-white px-4 py-2 rounded-lg transition-colors;
}
.btn-secondary {
@apply bg-zinc-700 hover:bg-zinc-600 text-white px-4 py-2 rounded-lg transition-colors;
}
}

View File

@@ -1,10 +1,10 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App';
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import App from './App.jsx';
import './index.css';
ReactDOM.createRoot(document.getElementById('root')).render(
<React.StrictMode>
createRoot(document.getElementById('root')).render(
<StrictMode>
<App />
</React.StrictMode>
</StrictMode>,
);

View File

@@ -7,4 +7,19 @@ export default defineConfig({
react(),
tailwindcss(),
],
server: {
port: 3000,
proxy: {
'/api': {
target: 'http://localhost:5000',
changeOrigin: true,
secure: false
}
}
},
build: {
outDir: 'dist',
assetsDir: 'assets',
sourcemap: true
}
});