Virtual Physiology Lab
🌐 Try it now: https://mrnerd96.github.io/virtual-lab/
A comprehensive, interactive simulation suite designed for performing and visualizing physiological experiments in a virtual environment. This application leverages modern web technologies to provide realistic simulations of amphibian skeletal muscle, amphibian heart, and hematology experiments.
🚀 Key Features
- Realistic Simulations: Uses physics-based models to simulate muscle contraction, fatigue, and cardiac cycles.
- Interactive 3D Visualizations: Powered by Three.js and React Three Fiber for immersive 3D models of experimental setups (kymographs, microscopes, muscle/heart preparations).
- Dynamic Graphing: Real-time data visualization using Recharts to mimic oscilloscopes and chart recorders.
- Cross-Platform: Built with React and Capacitor, ready for deployment on Web and Android.
🔬 Experiments
Amphibian Skeletal Muscle
- Simple Muscle Twitch: Analyze the phases of a single muscle twitch (Latent, Contraction, Relaxation).
- Effect of Load: Study the relationship between load and work done producing free and after loaded curves.
- Effect of Temperature: Observe how temperature changes affect muscle enzyme activity and twitch duration.
- Effect of Stimulus Strength: Demonstrate the "All-or-None" law and graded response in whole muscle.
- Genesis of Fatigue: Simulate muscle fatigue through repeated stimulation.
- Genesis of Tetanus: Demonstrate summation of contractions and tetanus by varying stimulus frequency.
- Conduction Velocity: Measure the speed of nerve impulse conduction.
- Two Successive Stimuli: Investigate the refractory period and summation of potential.
Amphibian Heart
- Normal Cardiogram: Record and analyze normal cardiac rhythm and phases (systole, diastole).
Hematology
- Total RBC Count: Simulate red blood cell counting using a Neubauer chamber.
- Total WBC Count: Simulate white blood cell counting.
- Differential Leukocyte Count (DLC): Identify and count different types of WBCs from a blood smear.
- Blood Grouping: ABO and Rh typing by slide agglutination with anti-A, anti-B and anti-D sera.
🛠️ Technologies Used
- Frontend: React, TypeScript, Vite
- Styling: Tailwind CSS
- 3D Graphics: Three.js, @react-three/fiber, @react-three/drei
- Charting: Recharts
- Mobile Runtime: Capacitor
- Icons: Lucide React
💻 Setup & Installation
Prerequisites: Node.js (v18+ recommended)
-
Clone the repository:
git clone https://github.com/MrNerd96/virtual-lab.git
cd virtual-lab
-
Install dependencies:
npm install
-
Set up environment variables:
Create a .env.local file in the root directory and add any necessary API keys (e.g., for AI features if applicable).
VITE_GEMINI_API_KEY=your_api_key_here
-
Run the development server:
npm run dev
-
Build for production:
npm run build
📱 Mobile Build (Android)
This project is configured with Capacitor for Android deployment.
-
Sync the project:
npx cap sync
-
Open in Android Studio:
npx cap open android