The Intelligent Multimodal Lab Notebook Companion 🚀
Bridging the gap between physical lab notebooks and digital scientific visualization with Google Gemini AI and Supabase.
In school and university science labs, students spend a disproportionate amount of time doing tedious administrative work rather than actual scientific analysis:
- Transcribing handwritten observation tables from physical notebooks.
- Manually calculating scales (e.g., 1 small square = 0.05 units) and sketching best-fit curves.
- Re-memorizing theory formulas or struggling with conceptual viva questions.
- Formatting lab reports to PDF.
Graphilia is an AI-powered desktop/web lab assistant designed to digitize, plot, and explain lab experiments instantly. Simply upload a picture of a handwritten lab notebook, and Graphilia does the rest.
- Powered by Gemini 2.5 Flash: Seamlessly detects and transcribes hand-drawn tables from notebook images.
- Confidence Heatmap: Identifies smudged or blurry handwritten digits and highlights low-confidence values in the data grid for manual verification.
- Smart Fallback: In offline mode or in case of API limits, falls back to pre-seeded mock experiments from the database.
- Auto-scaling Canvas: Replaces manual graph scale calculations. The app automatically determines the optimal axis intervals (e.g. 1 small square = 0.2 V).
- Interactive HTML5 Plotter: Zoom, scale, and print high-quality graphs with custom grid line toggles.
-
Curve Fitting Engine: Supports Linear, Exponential (
$y = a \cdot e^{bx} + c$ ), and Polynomial cubic regressions with real-time computation of slope, intercept, and$R^2$ .
- Explained Simply: Explains complex physics formulas in plain English (conceptual theory).
- Viva Q&A Simulator: Generates targeted viva questions based on the active experiment, categorized by difficulty (Basic, Conceptual, Formula, Tricky).
- Supabase Storage: Uploads scanned notebooks directly to Supabase storage.
- Cloudinary Fallback: Fallback integration to Cloudinary ensures file uploads never fail.
- Supabase Auth: Email verification gating, profile synchronization, and persistent history of experiment runs.
graph TD
subgraph Client [React Frontend]
A[React App] --> B[HTML5 Graph Canvas]
A --> C[Dynamic Data Table]
A --> D[Theory & Viva Panel]
end
subgraph Backend [Express API Server]
E[Express Server] --> F[Gemini 2.5 Multimodal API]
E --> G[Prisma ORM Client]
E --> H[Cloudinary API]
end
subgraph CloudServices [Cloud Services]
I[Supabase Auth & PostgreSQL]
J[Cloudinary Storage]
end
A -- REST Request --x E
G -- Queries --x I
E -- Upload Failover --x J
- Frontend: React 19, TypeScript, Vite, TailwindCSS, Lucide Icons, Custom HTML5 Canvas.
- Backend: Express, TypeScript, Multer (in-memory buffers), Prisma Client, Nodemon.
- Cloud Services: Supabase (PostgreSQL, Auth & Storage), Cloudinary (Image failover), Google Gemini API (Multimodal LLM).
-
Profile: Connects user credentials from Supabase Auth (auth.users.id) to their student metadata (year, department). -
SubjectExperiment: A template recipe for 14 pre-seeded physics/electrical experiments including default columns, formula structures, and best-fit algorithms. -
ExperimentRun: A single session of a student uploading an image and completing the OCR process. -
ObservationRow: Individual data points extracted from the handwritten table. -
GraphResult: Cached calculations including calculated slope, intercept,$R^2$ , and auto-scale suggestions. -
VivaQuestion: Curated list of viva questions connected to each experiment.
To get Graphilia running locally, follow these simple setup steps.
Make sure you have Node.js installed on your machine.
Create a .env file in both the root directory and the server directory.
Create d:/full-stack/Graphilia/.env and paste:
VITE_SUPABASE_URL=https://<your-project-ref>.supabase.co
VITE_SUPABASE_ANON_KEY=<your-anon-public-key>
VITE_API_URL=http://localhost:5000/apiCreate d:/full-stack/Graphilia/server/.env and paste:
PORT=5000
DATABASE_URL="postgresql://postgres:<your-db-password>@db.<your-project-ref>.supabase.co:5432/postgres?schema=public"
SUPABASE_URL=https://<your-project-ref>.supabase.co
SUPABASE_ANON_KEY=<your-anon-public-key>
SUPABASE_SERVICE_ROLE_KEY=<your-service-role-key>
CLOUDINARY_CLOUD_NAME=<your-cloudinary-name>
CLOUDINARY_API_KEY=<your-cloudinary-key>
CLOUDINARY_API_SECRET=<your-cloudinary-secret>
GEMINI_API_KEY=<your-google-gemini-api-key>Note
If your database password contains special characters (like #, @, [), make sure to URL-encode them in the DATABASE_URL string (e.g., replace a space with %20, @ with %40).
Open your terminal, navigate to the server directory, and initialize the database schema and seed data.
# Navigate to the server folder
cd server
# Push the Prisma schema to your Supabase PostgreSQL instance
npx prisma db push
# Generate the type-safe Prisma client
npx prisma generate
# Seed the database with the 14 lab experiments and viva questions
npm run prisma:seedIn the server directory, run:
npm run devThe server will boot up on http://localhost:5000.
Open a new terminal window in the root directory and run:
npm run devThe client app will boot up on http://localhost:5173. Open this URL in your web browser to start using Graphilia!
Graphilia was built to bring modern UX, automation, and intelligence into school and university laboratories. No more manual scale rules, no more squinting at handwritten tables—just snap, plot, and understand.