import React, { useEffect, useState } from 'react'; import { Wrench, Database } from 'lucide-react'; import { api } from '../api/client'; import { NavigationHeader } from '../components/NavigationHeader'; /* * The admin panel is the project overview and nothing else. * * It used to carry three more sub-tabs behind a local `activeTab` switch - * train/test dataset upload, a stock-remaining discount allocator, and a * trigger for the vector ingestion pipeline. They were retired from the UI; * with one view left there is nothing to switch between, so the tab bar and * its state went too. * * Only the UI was removed. The endpoints behind those panels are still * registered and still work - ingestion in particular is reachable from * `python cli/ingest_brand.py ""` and from POST /api/catalog/generate. */ export function AdminPage() { const [projectDetails, setProjectDetails] = useState(null); const [loadingProject, setLoadingProject] = useState(true); const fetchProjectDetails = async () => { try { setProjectDetails(await api.getProjectDetails()); } catch (e) { console.warn('Could not fetch project details', e); } finally { setLoadingProject(false); } }; // This effect also drove a 3-second poll of ingestion job status; that went // with the ingest panel, leaving a single fetch on mount. useEffect(() => { fetchProjectDetails(); }, []); return (

Existing Project Details & System Architecture

High-level overview of active brand catalogs, PostgreSQL vector database tables, S3 image storage pipeline, and store intelligence ML models.

{loadingProject ? (
Loading project details...
) : projectDetails ? (

Total Brands

{projectDetails.total_brands}

Ingested brand tables in pgvector

Total Products

{projectDetails.total_products}

Unique products with vector embeddings

S3 Storage Status

{projectDetails.s3_image_status}

Bucket: {projectDetails.storage_bucket}

System Version

{projectDetails.version}

Multi-Store & RAG Engine

) : null}
{projectDetails?.brand_product_counts && (

Ingested Brand Database Breakdown

{Object.entries(projectDetails.brand_product_counts).map(([bName, count]) => (
{bName} {count} items
))}
)}
); }