diff --git a/frontend b/frontend
deleted file mode 160000
index 4f0cb0a..0000000
--- a/frontend
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 4f0cb0a6cc1500720cc24916bcffd305170fcf66
diff --git a/frontend/.gitignore b/frontend/.gitignore
new file mode 100644
index 0000000..4d29575
--- /dev/null
+++ b/frontend/.gitignore
@@ -0,0 +1,23 @@
+# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
+
+# dependencies
+/node_modules
+/.pnp
+.pnp.js
+
+# testing
+/coverage
+
+# production
+/build
+
+# misc
+.DS_Store
+.env.local
+.env.development.local
+.env.test.local
+.env.production.local
+
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
diff --git a/frontend/README.md b/frontend/README.md
new file mode 100644
index 0000000..58beeac
--- /dev/null
+++ b/frontend/README.md
@@ -0,0 +1,70 @@
+# Getting Started with Create React App
+
+This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
+
+## Available Scripts
+
+In the project directory, you can run:
+
+### `npm start`
+
+Runs the app in the development mode.\
+Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
+
+The page will reload when you make changes.\
+You may also see any lint errors in the console.
+
+### `npm test`
+
+Launches the test runner in the interactive watch mode.\
+See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
+
+### `npm run build`
+
+Builds the app for production to the `build` folder.\
+It correctly bundles React in production mode and optimizes the build for the best performance.
+
+The build is minified and the filenames include the hashes.\
+Your app is ready to be deployed!
+
+See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
+
+### `npm run eject`
+
+**Note: this is a one-way operation. Once you `eject`, you can't go back!**
+
+If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
+
+Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
+
+You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
+
+## Learn More
+
+You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
+
+To learn React, check out the [React documentation](https://reactjs.org/).
+
+### Code Splitting
+
+This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
+
+### Analyzing the Bundle Size
+
+This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
+
+### Making a Progressive Web App
+
+This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
+
+### Advanced Configuration
+
+This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
+
+### Deployment
+
+This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
+
+### `npm run build` fails to minify
+
+This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
diff --git a/frontend/package.json b/frontend/package.json
new file mode 100644
index 0000000..b96622d
--- /dev/null
+++ b/frontend/package.json
@@ -0,0 +1,40 @@
+{
+ "name": "frontend",
+ "version": "0.1.0",
+ "private": true,
+ "dependencies": {
+ "@testing-library/dom": "^10.4.1",
+ "@testing-library/jest-dom": "^6.9.1",
+ "@testing-library/react": "^16.3.2",
+ "@testing-library/user-event": "^13.5.0",
+ "lucide-react": "^0.563.0",
+ "react": "^19.2.4",
+ "react-dom": "^19.2.4",
+ "react-scripts": "5.0.1",
+ "web-vitals": "^2.1.4"
+ },
+ "scripts": {
+ "start": "react-scripts start",
+ "build": "react-scripts build",
+ "test": "react-scripts test",
+ "eject": "react-scripts eject"
+ },
+ "eslintConfig": {
+ "extends": [
+ "react-app",
+ "react-app/jest"
+ ]
+ },
+ "browserslist": {
+ "production": [
+ ">0.2%",
+ "not dead",
+ "not op_mini all"
+ ],
+ "development": [
+ "last 1 chrome version",
+ "last 1 firefox version",
+ "last 1 safari version"
+ ]
+ }
+}
diff --git a/frontend/public/favicon.ico b/frontend/public/favicon.ico
new file mode 100644
index 0000000..a11777c
Binary files /dev/null and b/frontend/public/favicon.ico differ
diff --git a/frontend/public/index.html b/frontend/public/index.html
new file mode 100644
index 0000000..7ab22d6
--- /dev/null
+++ b/frontend/public/index.html
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ React App
+
+
+
+ You need to enable JavaScript to run this app.
+
+
+
+
diff --git a/frontend/public/logo192.png b/frontend/public/logo192.png
new file mode 100644
index 0000000..fc44b0a
Binary files /dev/null and b/frontend/public/logo192.png differ
diff --git a/frontend/public/logo512.png b/frontend/public/logo512.png
new file mode 100644
index 0000000..a4e47a6
Binary files /dev/null and b/frontend/public/logo512.png differ
diff --git a/frontend/public/manifest.json b/frontend/public/manifest.json
new file mode 100644
index 0000000..080d6c7
--- /dev/null
+++ b/frontend/public/manifest.json
@@ -0,0 +1,25 @@
+{
+ "short_name": "React App",
+ "name": "Create React App Sample",
+ "icons": [
+ {
+ "src": "favicon.ico",
+ "sizes": "64x64 32x32 24x24 16x16",
+ "type": "image/x-icon"
+ },
+ {
+ "src": "logo192.png",
+ "type": "image/png",
+ "sizes": "192x192"
+ },
+ {
+ "src": "logo512.png",
+ "type": "image/png",
+ "sizes": "512x512"
+ }
+ ],
+ "start_url": ".",
+ "display": "standalone",
+ "theme_color": "#000000",
+ "background_color": "#ffffff"
+}
diff --git a/frontend/public/robots.txt b/frontend/public/robots.txt
new file mode 100644
index 0000000..e9e57dc
--- /dev/null
+++ b/frontend/public/robots.txt
@@ -0,0 +1,3 @@
+# https://www.robotstxt.org/robotstxt.html
+User-agent: *
+Disallow:
diff --git a/frontend/src/App.css b/frontend/src/App.css
new file mode 100644
index 0000000..74b5e05
--- /dev/null
+++ b/frontend/src/App.css
@@ -0,0 +1,38 @@
+.App {
+ text-align: center;
+}
+
+.App-logo {
+ height: 40vmin;
+ pointer-events: none;
+}
+
+@media (prefers-reduced-motion: no-preference) {
+ .App-logo {
+ animation: App-logo-spin infinite 20s linear;
+ }
+}
+
+.App-header {
+ background-color: #282c34;
+ min-height: 100vh;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ font-size: calc(10px + 2vmin);
+ color: white;
+}
+
+.App-link {
+ color: #61dafb;
+}
+
+@keyframes App-logo-spin {
+ from {
+ transform: rotate(0deg);
+ }
+ to {
+ transform: rotate(360deg);
+ }
+}
diff --git a/frontend/src/App.js b/frontend/src/App.js
new file mode 100644
index 0000000..41542a6
--- /dev/null
+++ b/frontend/src/App.js
@@ -0,0 +1,628 @@
+import React, { useState, useEffect } from 'react';
+import { Search, FileText, AlertCircle, Download, Upload, Eye, Filter, CheckCircle, XCircle, Loader, Trash2 } from 'lucide-react';
+
+const API_BASE = 'http://192.168.2.117:3001/api';
+
+const severityLevels = ['All Severities', 'Critical', 'High', 'Medium', 'Low'];
+
+export default function App() {
+ const [searchQuery, setSearchQuery] = useState('');
+ const [selectedVendor, setSelectedVendor] = useState('All Vendors');
+ const [selectedSeverity, setSelectedSeverity] = useState('All Severities');
+ const [selectedCVE, setSelectedCVE] = useState(null);
+ const [selectedDocuments, setSelectedDocuments] = useState([]);
+ const [cves, setCves] = useState([]);
+ const [vendors, setVendors] = useState(['All Vendors']);
+ const [loading, setLoading] = useState(true);
+ const [error, setError] = useState(null);
+ const [cveDocuments, setCveDocuments] = useState({});
+ const [quickCheckCVE, setQuickCheckCVE] = useState('');
+ const [quickCheckResult, setQuickCheckResult] = useState(null);
+ const [showAddCVE, setShowAddCVE] = useState(false);
+ const [newCVE, setNewCVE] = useState({
+ cve_id: '',
+ vendor: '',
+ severity: 'Medium',
+ description: '',
+ published_date: new Date().toISOString().split('T')[0]
+ });
+ const [uploadingFile, setUploadingFile] = useState(false);
+
+ // Fetch CVEs from API
+ useEffect(() => {
+ fetchCVEs();
+ fetchVendors();
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, []);
+
+ // Refetch when filters change
+ useEffect(() => {
+ fetchCVEs();
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [searchQuery, selectedVendor, selectedSeverity]);
+
+ const fetchCVEs = async () => {
+ setLoading(true);
+ setError(null);
+ try {
+ const params = new URLSearchParams();
+ if (searchQuery) params.append('search', searchQuery);
+ if (selectedVendor !== 'All Vendors') params.append('vendor', selectedVendor);
+ if (selectedSeverity !== 'All Severities') params.append('severity', selectedSeverity);
+
+ const response = await fetch(`${API_BASE}/cves?${params}`);
+ if (!response.ok) throw new Error('Failed to fetch CVEs');
+ const data = await response.json();
+ setCves(data);
+ } catch (err) {
+ setError(err.message);
+ console.error('Error fetching CVEs:', err);
+ } finally {
+ setLoading(false);
+ }
+ };
+
+ const fetchVendors = async () => {
+ try {
+ const response = await fetch(`${API_BASE}/vendors`);
+ if (!response.ok) throw new Error('Failed to fetch vendors');
+ const data = await response.json();
+ setVendors(['All Vendors', ...data]);
+ } catch (err) {
+ console.error('Error fetching vendors:', err);
+ }
+ };
+
+ const fetchDocuments = async (cveId) => {
+ if (cveDocuments[cveId]) return;
+
+ try {
+ const response = await fetch(`${API_BASE}/cves/${cveId}/documents`);
+ if (!response.ok) throw new Error('Failed to fetch documents');
+ const data = await response.json();
+ setCveDocuments(prev => ({ ...prev, [cveId]: data }));
+ } catch (err) {
+ console.error('Error fetching documents:', err);
+ }
+ };
+
+ const quickCheckCVEStatus = async () => {
+ if (!quickCheckCVE.trim()) return;
+
+ try {
+ const response = await fetch(`${API_BASE}/cves/check/${quickCheckCVE.trim()}`);
+ if (!response.ok) throw new Error('Failed to check CVE');
+ const data = await response.json();
+ setQuickCheckResult(data);
+ } catch (err) {
+ console.error('Error checking CVE:', err);
+ setQuickCheckResult({ error: err.message });
+ }
+ };
+
+ const handleViewDocuments = async (cveId) => {
+ if (selectedCVE === cveId) {
+ setSelectedCVE(null);
+ } else {
+ setSelectedCVE(cveId);
+ await fetchDocuments(cveId);
+ }
+ };
+
+ const getSeverityColor = (severity) => {
+ const colors = {
+ 'Critical': 'bg-red-100 text-red-800',
+ 'High': 'bg-orange-100 text-orange-800',
+ 'Medium': 'bg-yellow-100 text-yellow-800',
+ 'Low': 'bg-blue-100 text-blue-800'
+ };
+ return colors[severity] || 'bg-gray-100 text-gray-800';
+ };
+
+ const toggleDocumentSelection = (docId) => {
+ setSelectedDocuments(prev =>
+ prev.includes(docId)
+ ? prev.filter(id => id !== docId)
+ : [...prev, docId]
+ );
+ };
+
+ const exportSelectedDocuments = () => {
+ alert(`Exporting ${selectedDocuments.length} documents for report attachment`);
+ };
+
+ const handleAddCVE = async (e) => {
+ e.preventDefault();
+ try {
+ const response = await fetch(`${API_BASE}/cves`, {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify(newCVE)
+ });
+
+ if (!response.ok) throw new Error('Failed to add CVE');
+
+ alert(`CVE ${newCVE.cve_id} added successfully!`);
+ setShowAddCVE(false);
+ setNewCVE({
+ cve_id: '',
+ vendor: '',
+ severity: 'Medium',
+ description: '',
+ published_date: new Date().toISOString().split('T')[0]
+ });
+ fetchCVEs();
+ } catch (err) {
+ alert(`Error: ${err.message}`);
+ }
+ };
+
+ const handleFileUpload = async (cveId, vendor) => {
+ const fileInput = document.createElement('input');
+ fileInput.type = 'file';
+ fileInput.accept = '.pdf,.png,.jpg,.jpeg,.txt,.doc,.docx';
+
+ fileInput.onchange = async (e) => {
+ const file = e.target.files[0];
+ if (!file) return;
+
+ const docType = prompt(
+ 'Document type (advisory, email, screenshot, patch, other):',
+ 'advisory'
+ );
+ if (!docType) return;
+
+ const notes = prompt('Notes (optional):');
+
+ setUploadingFile(true);
+
+ const formData = new FormData();
+ formData.append('file', file);
+ formData.append('cveId', cveId);
+ formData.append('vendor', vendor);
+ formData.append('type', docType);
+ if (notes) formData.append('notes', notes);
+
+ try {
+ const response = await fetch(`${API_BASE}/cves/${cveId}/documents`, {
+ method: 'POST',
+ body: formData
+ });
+
+ if (!response.ok) throw new Error('Failed to upload document');
+
+ alert(`Document uploaded successfully!`);
+ delete cveDocuments[cveId];
+ await fetchDocuments(cveId);
+ fetchCVEs();
+ } catch (err) {
+ alert(`Error: ${err.message}`);
+ } finally {
+ setUploadingFile(false);
+ }
+ };
+
+ fileInput.click();
+ };
+
+ const handleDeleteDocument = async (docId, cveId) => {
+ if (!window.confirm('Are you sure you want to delete this document?')) {
+ return;
+ }
+
+ try {
+ const response = await fetch(`${API_BASE}/documents/${docId}`, {
+ method: 'DELETE'
+ });
+
+ if (!response.ok) throw new Error('Failed to delete document');
+
+ alert('Document deleted successfully!');
+ delete cveDocuments[cveId];
+ await fetchDocuments(cveId);
+ fetchCVEs();
+ } catch (err) {
+ alert(`Error: ${err.message}`);
+ }
+ };
+
+ const filteredCVEs = cves;
+
+ return (
+
+
+ {/* Header with Charter Branding */}
+
+
+
CVE Dashboard
+
Query vulnerabilities, manage vendors, and attach documentation
+
+
setShowAddCVE(true)}
+ className="px-4 py-2 bg-[#0476D9] text-white rounded-lg hover:bg-[#0360B8] transition-colors flex items-center gap-2 shadow-md"
+ >
+ +
+ Add New CVE
+
+
+
+ {/* Add CVE Modal */}
+ {showAddCVE && (
+
+
+
+
+
Add New CVE
+ setShowAddCVE(false)}
+ className="text-gray-400 hover:text-gray-600"
+ >
+
+
+
+
+
+
+
+
+ )}
+
+ {/* Quick Check with Charter Blue */}
+
+
Quick CVE Status Check
+
+ setQuickCheckCVE(e.target.value)}
+ onKeyPress={(e) => e.key === 'Enter' && quickCheckCVEStatus()}
+ className="flex-1 px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-[#0476D9] focus:border-transparent"
+ />
+
+ Check Status
+
+
+
+ {quickCheckResult && (
+
+ {quickCheckResult.error ? (
+
+
+
+
Error
+
{quickCheckResult.error}
+
+
+ ) : quickCheckResult.exists ? (
+
+
+
+
✓ CVE Addressed
+
+
Vendor: {quickCheckResult.cve.vendor}
+
Severity: {quickCheckResult.cve.severity}
+
Status: {quickCheckResult.cve.status}
+
Documents: {quickCheckResult.cve.total_documents} attached
+
+
+ {quickCheckResult.compliance.advisory ? '✓' : '✗'} Advisory
+
+
+ {quickCheckResult.compliance.email ? '✓' : '○'} Email
+
+
+ {quickCheckResult.compliance.screenshot ? '✓' : '○'} Screenshot
+
+
+
+
+
+ ) : (
+
+
+
+
Not Found
+
This CVE has not been addressed yet. No entry exists in the database.
+
+
+ )}
+
+ )}
+
+
+ {/* Search and Filters */}
+
+
+
+
+
+ Search CVEs
+
+ setSearchQuery(e.target.value)}
+ className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-[#0476D9] focus:border-transparent"
+ />
+
+
+
+
+
+ Vendor
+
+ setSelectedVendor(e.target.value)}
+ className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-[#0476D9] focus:border-transparent"
+ >
+ {vendors.map(vendor => (
+ {vendor}
+ ))}
+
+
+
+
+
+
+ Severity
+
+
setSelectedSeverity(e.target.value)}
+ className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-[#0476D9] focus:border-transparent"
+ >
+ {severityLevels.map(level => (
+ {level}
+ ))}
+
+
+
+
+
+ {/* Results Summary */}
+
+
+ Found {filteredCVEs.length} CVE{filteredCVEs.length !== 1 ? 's' : ''}
+
+ {selectedDocuments.length > 0 && (
+
+
+ Export {selectedDocuments.length} Document{selectedDocuments.length !== 1 ? 's' : ''} for Report
+
+ )}
+
+
+ {/* CVE List */}
+ {loading ? (
+
+ ) : error ? (
+
+
+
Error Loading CVEs
+
{error}
+
+ Retry
+
+
+ ) : (
+
+ {filteredCVEs.map(cve => {
+ const documents = cveDocuments[cve.cve_id] || [];
+
+ return (
+
+
+
+
+
+
{cve.cve_id}
+
+ {cve.severity}
+
+
+ {cve.doc_status === 'Complete' ? '✓ Docs Complete' : '⚠ Incomplete'}
+
+
+
{cve.description}
+
+ Vendor: {cve.vendor}
+ Published: {cve.published_date}
+ Status: {cve.status}
+
+
+ {cve.document_count} document{cve.document_count !== 1 ? 's' : ''}
+
+
+
+
handleViewDocuments(cve.cve_id)}
+ className="px-4 py-2 text-[#0476D9] hover:bg-blue-50 rounded-lg transition-colors flex items-center gap-2 border border-[#0476D9]"
+ >
+
+ {selectedCVE === cve.cve_id ? 'Hide' : 'View'} Documents
+
+
+
+ {/* Documents Section */}
+ {selectedCVE === cve.cve_id && (
+
+
+
+ Attached Documents ({documents.length})
+
+ {documents.length > 0 ? (
+
+ {documents.map(doc => (
+
+
+
toggleDocumentSelection(doc.id)}
+ className="w-4 h-4 text-[#0476D9] rounded focus:ring-2 focus:ring-[#0476D9]"
+ />
+
+
+
{doc.name}
+
+ {doc.type} • {doc.file_size}
+ {doc.notes && ` • ${doc.notes}`}
+
+
+
+
+
+ View
+
+
handleDeleteDocument(doc.id, cve.cve_id)}
+ className="px-3 py-1 text-sm text-red-600 hover:bg-red-50 rounded transition-colors border border-red-600 flex items-center gap-1"
+ >
+
+ Delete
+
+
+
+ ))}
+
+ ) : (
+
No documents attached yet
+ )}
+
handleFileUpload(cve.cve_id, cve.vendor)}
+ disabled={uploadingFile}
+ className="mt-3 px-4 py-2 text-sm text-gray-600 hover:bg-gray-100 rounded-lg transition-colors flex items-center gap-2 disabled:opacity-50 border border-gray-300"
+ >
+
+ {uploadingFile ? 'Uploading...' : 'Upload New Document'}
+
+
+ )}
+
+
+ );
+ })}
+
+ )}
+
+ {filteredCVEs.length === 0 && !loading && (
+
+
+
No CVEs Found
+
Try adjusting your search criteria or filters
+
+ )}
+
+
+ );
+}
diff --git a/frontend/src/App.js.v1 b/frontend/src/App.js.v1
new file mode 100644
index 0000000..16769f6
--- /dev/null
+++ b/frontend/src/App.js.v1
@@ -0,0 +1,598 @@
+import React, { useState, useEffect } from 'react';
+import { Search, FileText, AlertCircle, Download, Upload, Eye, Filter, CheckCircle, XCircle, Loader } from 'lucide-react';
+
+const API_BASE = 'http://192.168.2.117:3001/api';
+
+const severityLevels = ['All Severities', 'Critical', 'High', 'Medium', 'Low'];
+
+export default function App() {
+ const [searchQuery, setSearchQuery] = useState('');
+ const [selectedVendor, setSelectedVendor] = useState('All Vendors');
+ const [selectedSeverity, setSelectedSeverity] = useState('All Severities');
+ const [selectedCVE, setSelectedCVE] = useState(null);
+ const [selectedDocuments, setSelectedDocuments] = useState([]);
+ const [cves, setCves] = useState([]);
+ const [vendors, setVendors] = useState(['All Vendors']);
+ const [loading, setLoading] = useState(true);
+ const [error, setError] = useState(null);
+ const [cveDocuments, setCveDocuments] = useState({});
+ const [quickCheckCVE, setQuickCheckCVE] = useState('');
+ const [quickCheckResult, setQuickCheckResult] = useState(null);
+ const [showAddCVE, setShowAddCVE] = useState(false);
+ const [newCVE, setNewCVE] = useState({
+ cve_id: '',
+ vendor: '',
+ severity: 'Medium',
+ description: '',
+ published_date: new Date().toISOString().split('T')[0]
+ });
+ const [uploadingFile, setUploadingFile] = useState(false);
+
+ // Fetch CVEs from API
+ useEffect(() => {
+ fetchCVEs();
+ fetchVendors();
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, []);
+
+ // Refetch when filters change
+ useEffect(() => {
+ fetchCVEs();
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [searchQuery, selectedVendor, selectedSeverity]);
+
+ const fetchCVEs = async () => {
+ setLoading(true);
+ setError(null);
+ try {
+ const params = new URLSearchParams();
+ if (searchQuery) params.append('search', searchQuery);
+ if (selectedVendor !== 'All Vendors') params.append('vendor', selectedVendor);
+ if (selectedSeverity !== 'All Severities') params.append('severity', selectedSeverity);
+
+ const response = await fetch(`${API_BASE}/cves?${params}`);
+ if (!response.ok) throw new Error('Failed to fetch CVEs');
+ const data = await response.json();
+ setCves(data);
+ } catch (err) {
+ setError(err.message);
+ console.error('Error fetching CVEs:', err);
+ } finally {
+ setLoading(false);
+ }
+ };
+
+ const fetchVendors = async () => {
+ try {
+ const response = await fetch(`${API_BASE}/vendors`);
+ if (!response.ok) throw new Error('Failed to fetch vendors');
+ const data = await response.json();
+ setVendors(['All Vendors', ...data]);
+ } catch (err) {
+ console.error('Error fetching vendors:', err);
+ }
+ };
+
+ const fetchDocuments = async (cveId) => {
+ if (cveDocuments[cveId]) return;
+
+ try {
+ const response = await fetch(`${API_BASE}/cves/${cveId}/documents`);
+ if (!response.ok) throw new Error('Failed to fetch documents');
+ const data = await response.json();
+ setCveDocuments(prev => ({ ...prev, [cveId]: data }));
+ } catch (err) {
+ console.error('Error fetching documents:', err);
+ }
+ };
+
+ const quickCheckCVEStatus = async () => {
+ if (!quickCheckCVE.trim()) return;
+
+ try {
+ const response = await fetch(`${API_BASE}/cves/check/${quickCheckCVE.trim()}`);
+ if (!response.ok) throw new Error('Failed to check CVE');
+ const data = await response.json();
+ setQuickCheckResult(data);
+ } catch (err) {
+ console.error('Error checking CVE:', err);
+ setQuickCheckResult({ error: err.message });
+ }
+ };
+
+ const handleViewDocuments = async (cveId) => {
+ if (selectedCVE === cveId) {
+ setSelectedCVE(null);
+ } else {
+ setSelectedCVE(cveId);
+ await fetchDocuments(cveId);
+ }
+ };
+
+ const getSeverityColor = (severity) => {
+ const colors = {
+ 'Critical': 'bg-red-100 text-red-800',
+ 'High': 'bg-orange-100 text-orange-800',
+ 'Medium': 'bg-yellow-100 text-yellow-800',
+ 'Low': 'bg-blue-100 text-blue-800'
+ };
+ return colors[severity] || 'bg-gray-100 text-gray-800';
+ };
+
+ const toggleDocumentSelection = (docId) => {
+ setSelectedDocuments(prev =>
+ prev.includes(docId)
+ ? prev.filter(id => id !== docId)
+ : [...prev, docId]
+ );
+ };
+
+ const exportSelectedDocuments = () => {
+ alert(`Exporting ${selectedDocuments.length} documents for report attachment`);
+ };
+
+ const handleAddCVE = async (e) => {
+ e.preventDefault();
+ try {
+ const response = await fetch(`${API_BASE}/cves`, {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify(newCVE)
+ });
+
+ if (!response.ok) throw new Error('Failed to add CVE');
+
+ alert(`CVE ${newCVE.cve_id} added successfully!`);
+ setShowAddCVE(false);
+ setNewCVE({
+ cve_id: '',
+ vendor: '',
+ severity: 'Medium',
+ description: '',
+ published_date: new Date().toISOString().split('T')[0]
+ });
+ fetchCVEs();
+ } catch (err) {
+ alert(`Error: ${err.message}`);
+ }
+ };
+
+ const handleFileUpload = async (cveId, vendor) => {
+ const fileInput = document.createElement('input');
+ fileInput.type = 'file';
+ fileInput.accept = '.pdf,.png,.jpg,.jpeg,.txt,.doc,.docx';
+
+ fileInput.onchange = async (e) => {
+ const file = e.target.files[0];
+ if (!file) return;
+
+ const docType = prompt(
+ 'Document type (advisory, email, screenshot, patch, other):',
+ 'advisory'
+ );
+ if (!docType) return;
+
+ const notes = prompt('Notes (optional):');
+
+ setUploadingFile(true);
+
+ const formData = new FormData();
+ formData.append('file', file);
+ formData.append('cveId', cveId);
+ formData.append('vendor', vendor);
+ formData.append('type', docType);
+ if (notes) formData.append('notes', notes);
+
+ try {
+ const response = await fetch(`${API_BASE}/cves/${cveId}/documents`, {
+ method: 'POST',
+ body: formData
+ });
+
+ if (!response.ok) throw new Error('Failed to upload document');
+
+ alert(`Document uploaded successfully!`);
+ delete cveDocuments[cveId];
+ await fetchDocuments(cveId);
+ fetchCVEs();
+ } catch (err) {
+ alert(`Error: ${err.message}`);
+ } finally {
+ setUploadingFile(false);
+ }
+ };
+
+ fileInput.click();
+ };
+
+ const filteredCVEs = cves;
+
+ return (
+
+
+ {/* Header */}
+
+
+
CVE Dashboard
+
Query vulnerabilities, manage vendors, and attach documentation
+
+
setShowAddCVE(true)}
+ className="px-4 py-2 bg-green-600 text-white rounded-lg hover:bg-green-700 transition-colors flex items-center gap-2"
+ >
+ +
+ Add New CVE
+
+
+
+ {/* Add CVE Modal */}
+ {showAddCVE && (
+
+
+
+
+
Add New CVE
+ setShowAddCVE(false)}
+ className="text-gray-400 hover:text-gray-600"
+ >
+
+
+
+
+
+
+
+ CVE ID *
+
+ setNewCVE({...newCVE, cve_id: e.target.value.toUpperCase()})}
+ className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500"
+ />
+
+
+
+
+ Vendor *
+
+ setNewCVE({...newCVE, vendor: e.target.value})}
+ className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500"
+ />
+
+
+
+
+ Severity *
+
+ setNewCVE({...newCVE, severity: e.target.value})}
+ className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500"
+ >
+ Critical
+ High
+ Medium
+ Low
+
+
+
+
+
+ Description *
+
+ setNewCVE({...newCVE, description: e.target.value})}
+ rows={3}
+ className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500"
+ />
+
+
+
+
+ Published Date *
+
+ setNewCVE({...newCVE, published_date: e.target.value})}
+ className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500"
+ />
+
+
+
+
+ Add CVE
+
+ setShowAddCVE(false)}
+ className="px-4 py-2 bg-gray-200 text-gray-700 rounded-lg hover:bg-gray-300 transition-colors"
+ >
+ Cancel
+
+
+
+
+
+
+ )}
+
+ {/* Quick Check */}
+
+
Quick CVE Status Check
+
+ setQuickCheckCVE(e.target.value)}
+ onKeyPress={(e) => e.key === 'Enter' && quickCheckCVEStatus()}
+ className="flex-1 px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
+ />
+
+ Check Status
+
+
+
+ {quickCheckResult && (
+
+ {quickCheckResult.error ? (
+
+
+
+
Error
+
{quickCheckResult.error}
+
+
+ ) : quickCheckResult.exists ? (
+
+
+
+
✓ CVE Addressed
+
+
Vendor: {quickCheckResult.cve.vendor}
+
Severity: {quickCheckResult.cve.severity}
+
Status: {quickCheckResult.cve.status}
+
Documents: {quickCheckResult.cve.total_documents} attached
+
+
+ {quickCheckResult.compliance.advisory ? '✓' : '✗'} Advisory
+
+
+ {quickCheckResult.compliance.email ? '✓' : '○'} Email
+
+
+ {quickCheckResult.compliance.screenshot ? '✓' : '○'} Screenshot
+
+
+
+
+
+ ) : (
+
+
+
+
Not Found
+
This CVE has not been addressed yet. No entry exists in the database.
+
+
+ )}
+
+ )}
+
+
+ {/* Search and Filters */}
+
+
+
+
+
+ Search CVEs
+
+ setSearchQuery(e.target.value)}
+ className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
+ />
+
+
+
+
+
+ Vendor
+
+ setSelectedVendor(e.target.value)}
+ className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
+ >
+ {vendors.map(vendor => (
+ {vendor}
+ ))}
+
+
+
+
+
+
+ Severity
+
+
setSelectedSeverity(e.target.value)}
+ className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
+ >
+ {severityLevels.map(level => (
+ {level}
+ ))}
+
+
+
+
+
+ {/* Results Summary */}
+
+
+ Found {filteredCVEs.length} CVE{filteredCVEs.length !== 1 ? 's' : ''}
+
+ {selectedDocuments.length > 0 && (
+
+
+ Export {selectedDocuments.length} Document{selectedDocuments.length !== 1 ? 's' : ''} for Report
+
+ )}
+
+
+ {/* CVE List */}
+ {loading ? (
+
+ ) : error ? (
+
+
+
Error Loading CVEs
+
{error}
+
+ Retry
+
+
+ ) : (
+
+ {filteredCVEs.map(cve => {
+ const documents = cveDocuments[cve.cve_id] || [];
+
+ return (
+
+
+
+
+
+
{cve.cve_id}
+
+ {cve.severity}
+
+
+ {cve.doc_status === 'Complete' ? '✓ Docs Complete' : '⚠ Incomplete'}
+
+
+
{cve.description}
+
+ Vendor: {cve.vendor}
+ Published: {cve.published_date}
+ Status: {cve.status}
+
+
+ {cve.document_count} document{cve.document_count !== 1 ? 's' : ''}
+
+
+
+
handleViewDocuments(cve.cve_id)}
+ className="px-4 py-2 text-blue-600 hover:bg-blue-50 rounded-lg transition-colors flex items-center gap-2"
+ >
+
+ {selectedCVE === cve.cve_id ? 'Hide' : 'View'} Documents
+
+
+
+ {/* Documents Section */}
+ {selectedCVE === cve.cve_id && (
+
+
+
+ Attached Documents ({documents.length})
+
+ {documents.length > 0 ? (
+
+ {documents.map(doc => (
+
+
+
toggleDocumentSelection(doc.id)}
+ className="w-4 h-4 text-blue-600 rounded focus:ring-2 focus:ring-blue-500"
+ />
+
+
+
{doc.name}
+
+ {doc.type} • {doc.file_size}
+ {doc.notes && ` • ${doc.notes}`}
+
+
+
+
+ View
+
+
+ ))}
+
+ ) : (
+
No documents attached yet
+ )}
+
handleFileUpload(cve.cve_id, cve.vendor)}
+ disabled={uploadingFile}
+ className="mt-3 px-4 py-2 text-sm text-gray-600 hover:bg-gray-100 rounded-lg transition-colors flex items-center gap-2 disabled:opacity-50"
+ >
+
+ {uploadingFile ? 'Uploading...' : 'Upload New Document'}
+
+
+ )}
+
+
+ );
+ })}
+
+ )}
+
+ {filteredCVEs.length === 0 && !loading && (
+
+
+
No CVEs Found
+
Try adjusting your search criteria or filters
+
+ )}
+
+
+ );
+}
diff --git a/frontend/src/App.test.js b/frontend/src/App.test.js
new file mode 100644
index 0000000..1f03afe
--- /dev/null
+++ b/frontend/src/App.test.js
@@ -0,0 +1,8 @@
+import { render, screen } from '@testing-library/react';
+import App from './App';
+
+test('renders learn react link', () => {
+ render( );
+ const linkElement = screen.getByText(/learn react/i);
+ expect(linkElement).toBeInTheDocument();
+});
diff --git a/frontend/src/Default-App.js b/frontend/src/Default-App.js
new file mode 100644
index 0000000..3784575
--- /dev/null
+++ b/frontend/src/Default-App.js
@@ -0,0 +1,25 @@
+import logo from './logo.svg';
+import './App.css';
+
+function App() {
+ return (
+
+ );
+}
+
+export default App;
diff --git a/frontend/src/index.css b/frontend/src/index.css
new file mode 100644
index 0000000..ec2585e
--- /dev/null
+++ b/frontend/src/index.css
@@ -0,0 +1,13 @@
+body {
+ margin: 0;
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
+ 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
+ sans-serif;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+code {
+ font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
+ monospace;
+}
diff --git a/frontend/src/index.js b/frontend/src/index.js
new file mode 100644
index 0000000..d563c0f
--- /dev/null
+++ b/frontend/src/index.js
@@ -0,0 +1,17 @@
+import React from 'react';
+import ReactDOM from 'react-dom/client';
+import './index.css';
+import App from './App';
+import reportWebVitals from './reportWebVitals';
+
+const root = ReactDOM.createRoot(document.getElementById('root'));
+root.render(
+
+
+
+);
+
+// If you want to start measuring performance in your app, pass a function
+// to log results (for example: reportWebVitals(console.log))
+// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
+reportWebVitals();
diff --git a/frontend/src/logo.svg b/frontend/src/logo.svg
new file mode 100644
index 0000000..9dfc1c0
--- /dev/null
+++ b/frontend/src/logo.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/frontend/src/reportWebVitals.js b/frontend/src/reportWebVitals.js
new file mode 100644
index 0000000..5253d3a
--- /dev/null
+++ b/frontend/src/reportWebVitals.js
@@ -0,0 +1,13 @@
+const reportWebVitals = onPerfEntry => {
+ if (onPerfEntry && onPerfEntry instanceof Function) {
+ import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
+ getCLS(onPerfEntry);
+ getFID(onPerfEntry);
+ getFCP(onPerfEntry);
+ getLCP(onPerfEntry);
+ getTTFB(onPerfEntry);
+ });
+ }
+};
+
+export default reportWebVitals;
diff --git a/frontend/src/setupTests.js b/frontend/src/setupTests.js
new file mode 100644
index 0000000..8f2609b
--- /dev/null
+++ b/frontend/src/setupTests.js
@@ -0,0 +1,5 @@
+// jest-dom adds custom jest matchers for asserting on DOM nodes.
+// allows you to do things like:
+// expect(element).toHaveTextContent(/react/i)
+// learn more: https://github.com/testing-library/jest-dom
+import '@testing-library/jest-dom';