A React-based web application for predicting biomass glucose and xylose yields using machine learning.
- Biomass Type Selection: Choose from 21+ predefined feedstocks (corn stover, bamboo, rice straw, etc.)
- Process Parameter Input: Configure enzyme loading, hydrolysis temperature, time, pH, and more
- Real-time Predictions: ML-powered glucose and xylose yield predictions via HuggingFace
- PDF Report Generation: Export detailed reports of predictions and analysis
- Responsive UI: Beautiful, mobile-friendly interface with Tailwind CSS
- Frontend: React 19 + TypeScript + Vite
- Styling: Tailwind CSS + Radix UI
- State Management: React Context API + Zustand
- API: HuggingFace Spaces (Python/Scikit-learn backend)
- PDF Export: jsPDF
- Charts: Recharts + Framer Motion
- Node.js >= 18.0.0
- npm >= 9.0.0
# Install dependencies
npm install
# Set up environment variables
# Copy .env.local to src/frontend/.env.local if needednpm run devThe app will start at http://localhost:5173
npm run buildOutput will be in src/frontend/dist/
npm run previewThe following environment variables can be set in .env.local:
VITE_API_URL=https://iayaanhere-enzymax-ai-api.hf.space
NEXT_PUBLIC_API_URL=https://iayaanhere-enzymax-ai-api.hf.space
STORAGE_GATEWAY_URL=https://iayaanhere-enzymax-ai-api.hf.space
- Prediction Endpoint:
POST /predictat the configured API URL - Expected Response: JSON with
glucose_yield_pctandxylose_yield_pctfields
- Push code to GitHub
- Connect to Vercel
- Set build command:
npm run build - Set public directory:
src/frontend/dist - Deploy
The Vite build output is compatible with Vercel's static hosting.
src/
├── frontend/
│ ├── src/
│ │ ├── App.tsx # Main application component
│ │ ├── config.ts # Configuration loading
│ │ ├── components/ # React components
│ │ ├── context/ # BiomassContext for state management
│ │ ├── hooks/ # Custom hooks (useCustomBiomass, etc.)
│ │ ├── utils/ # Utilities (generateReport, StorageClient)
│ │ └── declarations/ # Generated type definitions
│ ├── vite.config.js # Vite configuration
│ └── package.json
└── backend/
└── main.mo # Minimal Motoko backend (optional)
The application implements:
- Client-side heuristic: Saeman model approximation in
useCustomBiomass.ts - ML predictions: Python/Scikit-learn model on HuggingFace Spaces
Critical calculations are preserved unchanged during deployment.
See LICENSE file for details.