React-based frontend application for the MLOps project.
This service provides:
- User interface for interacting with ML models
- Data visualization and exploration
- Model prediction interface
- RAG query interface
- Admin dashboard for model management
- Node.js 20+
- npm or yarn
- Install dependencies:
npm install- Create
.env.local:
REACT_APP_API_URL=http://localhost:8000- Start development server:
npm start- Access the app: http://localhost:3000
Students should implement:
-
Pages/Views
- Home/Landing page
- Data upload/collection interface
- Model prediction interface
- RAG query interface
- Model management dashboard
-
Components
- File upload component
- Prediction form
- Results visualization
- Loading states
- Error handling
-
State Management
- API integration with backend
- Global state (Context API or Redux)
- Form state management
-
Styling
- Responsive design
- UI component library (Material-UI, Chakra, etc.)
- Dark/light mode
frontend-react/
├── public/
│ └── index.html
├── src/
│ ├── components/ # Reusable components
│ ├── pages/ # Page components
│ ├── services/ # API clients
│ ├── hooks/ # Custom React hooks
│ ├── context/ # Context providers
│ ├── utils/ # Utility functions
│ ├── App.js
│ └── index.js
├── package.json
└── Dockerfile
npm start # Start dev server
npm test # Run tests
npm run build # Build for production
npm run lint # Run linterConnect to backend API:
const API_URL = process.env.REACT_APP_API_URL;
async function predict(features) {
const response = await fetch(`${API_URL}/api/v1/model/predict`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ features })
});
return response.json();
}Build:
docker build -t mlops-frontend-react .Run:
docker run -p 3000:80 mlops-frontend-reactThe frontend is built as a static site and served through:
- Development: React dev server
- Production: Nginx in Docker container → deployed to GKE
REACT_APP_API_URL: Backend API URLREACT_APP_ENV: Environment (development/production)
- UI Framework: Material-UI, Chakra UI, or Ant Design
- State Management: React Context API or Redux Toolkit
- HTTP Client: Axios or Fetch API
- Routing: React Router
- Charts: Recharts or Chart.js
- Forms: React Hook Form