The frontend application for DataDetox, an interactive AI agent orchestration system for tracing ML data and model provenance. This React-based web application provides a user-friendly interface for exploring AI model lineages, identifying hidden risks in datasets, and understanding upstream dependencies in the AI ecosystem.
The DataDetox frontend enables users to:
- Query AI models and datasets through an interactive chatbot interface
- Visualize model lineage trees and relationships
- Explore connections between models, datasets, and upstream dependencies
- Identify potential risks in model training data (e.g., copyrighted content, problematic datasets)
- React 18 - UI framework
- TypeScript - Type safety
- Vite - Build tool and development server
- Tailwind CSS - Styling
- shadcn-ui - UI component library (Radix UI primitives)
- React Router - Client-side routing
- TanStack Query (React Query) - Data fetching and state management
- React Flow / ELK.js - Graph visualization for model trees
- React Markdown - Markdown rendering for chat messages
frontend/
├── src/
│ ├── components/ # React components
│ │ ├── ui/ # shadcn-ui components
│ │ ├── ChatMessage.tsx # Chat message display
│ │ ├── ModelTree*.tsx # Model lineage visualization
│ │ ├── Navbar.tsx # Navigation bar
│ │ ├── Hero.tsx # Landing page hero section
│ │ ├── Features.tsx # Features showcase
│ │ └── UseCases.tsx # Use cases section
│ ├── pages/ # Page components
│ │ ├── Index.tsx # Landing page
│ │ ├── Chatbot.tsx # Main chatbot interface
│ │ └── NotFound.tsx # 404 page
│ ├── hooks/ # Custom React hooks
│ ├── lib/ # Utility functions
│ └── App.tsx # Main app component with routing
├── public/ # Static assets
└── package.json # Dependencies and scripts
- Node.js (v18 or higher) - Install with nvm
- npm or bun (comes with Node.js)
-
Navigate to the frontend directory:
cd frontend -
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Access the application:
- Frontend: http://localhost:3000
- Chatbot: http://localhost:3000/chatbot
npm run dev- Start development server with hot reloadnpm run build- Build for productionnpm run build:dev- Build in development modenpm run preview- Preview production build locallynpm run lint- Run ESLintnpm run test- Run tests with Vitestnpm run test:ui- Run tests with UInpm run test:coverage- Run tests with coverage report
- Hero section introducing DataDetox
- Features showcase
- Use cases demonstration
- Navigation to chatbot interface
- Interactive chat interface for querying models and datasets
- Real-time model lineage tree visualization
- Support for complex queries about model relationships
- Display of metadata (arXiv papers, search terms, processing times)
- Risk indicators for datasets
- Interactive graph visualization of model relationships
- Tree layout using ELK.js
- Node details with model metadata
- Relationship types between models and datasets
The frontend communicates with the backend API through a Vite proxy configuration:
- Development: Requests to
/backend/*are proxied tohttp://localhost:8000 - Production: Configure the backend URL via environment variables
The backend API provides:
- Search endpoints for querying models
- Neo4j graph data for lineage visualization
- HuggingFace model information
- arXiv paper extraction
For production deployments, configure the backend API URL:
VITE_API_URL=http://your-backend-url:8000The project uses Vitest for unit testing and React Testing Library for component testing:
# Run all tests
npm run test
# Run tests with UI
npm run test:ui
# Generate coverage report
npm run test:coverage-
Build the application:
npm run build
-
Output: The production build will be in the
dist/directory -
Preview the build:
npm run preview
The frontend can be deployed using Docker. See the root docker-compose.yml and Dockerfile in this directory for containerization configuration.
When contributing to the frontend:
- Follow the existing code style and TypeScript conventions
- Add tests for new components and features
- Ensure all tests pass before submitting PRs
- Update this README if adding new features or changing setup
- Main Project README - Full project overview and setup
- Backend README - Backend API documentation
- Application Design Document - System architecture