Incision is a virtual dissection lab that runs in the browser. Pick an organism, rotate its 3D anatomical model, select organs to read about them, hide or show body systems, and take a short guided tour. A Gemini-powered “Quiz me” button asks you a question about whichever organ you’ve selected
- 3D viewer. Orbit, zoom and pan around the model. Clicking an organ flies the camera to it, and the other organs fade back.
- Organ info panel. Shows a description for the selected part, written for students.
- Body systems sidebar. Toggles whole systems (digestive, circulatory, respiratory, urinary, external) or single organs on and off.
- Skin fade. The skin turns see-through as you zoom in, so you can see the organs inside.
- Guided tour. A short tour that steps through the heart and stomach, with Back, Next and Skip.
- Quiz me. Asks one multiple-choice question about the selected organ, then checks your answer and explains it. Uses Google Gemini.
| Part | Tools |
|---|---|
| Frontend | Next.js 16 (App Router), React 19, TypeScript, Tailwind CSS v4 |
| Backend | FastAPI (Python), Pydantic, google-genai |
| 3D | three.js, React Three Fiber, drei, three-mesh-bvh |
| Animation | Motion |
- Node.js 20.9 or newer, with npm
- Python 3.9 or newer
- uv, which runs the backend
- A Gemini API key from Google AI Studio. You only need this for Quiz me.
Run the frontend and the backend in two separate terminals.
cd backend
echo "GEMINI_API_KEY=your-key-here" > .env
uv run fastapi devThe API starts at http://localhost:8000. Open http://localhost:8000/docs to see the interactive API docs. backend/.env is gitignored, so your key is never committed.
npm install
npm run devIn development the frontend calls the API at http://localhost:8000/api. In production it calls /api on the same domain. To point it somewhere else, set NEXT_PUBLIC_API_URL in a .env.local file in the project root.
If the backend isn't running, the 3D viewer still works, but organ descriptions, body systems, the tour and Quiz me will be empty or unavailable.
| Method | Path | Purpose |
|---|---|---|
| GET | /api |
Health check |
| GET | /api/models/{slug}/content |
Parts, groups and tour for a model. Returns empty lists if the model has no content file. |
| POST | /api/chat |
Sends a conversation to Gemini, along with the selected part's notes. Quiz me uses this. |
The site and the backend deploy together as one Vercel project using Vercel Services, configured in vercel.json. Requests to /api/* go to the FastAPI backend, and everything else goes to the Next.js app. Set GEMINI_API_KEY in the Vercel project's environment variables.
- Add the file. Put the
.glbinpublic/models/, compressed (see below). - Register it. Add an entry to
MODELSinapp/data/models.tswith aslug,name,categoryandpath. - Write its content (optional). Create
backend/src/api/content/<slug>.jsonwithparts,groupsandtour, usingfrog.jsonas a template. The keys underpartsmust match the object names in the GLB.
GitHub rejects files over 100 MB, and raw Blender exports are often bigger than that. Keep the raw export in models-source/, which is gitignored, and commit only the compressed copy:
npx @gltf-transform/cli resize models-source/Model.glb /tmp/a.glb --width 1024 --height 1024
npx @gltf-transform/cli webp /tmp/a.glb /tmp/b.glb
npx @gltf-transform/cli meshopt /tmp/b.glb public/models/Model.glbThese steps shrink the textures and compress the geometry without removing any detail. For example, they took the frog from 194 MB to 14 MB.
| Command | What it does |
|---|---|
npm run dev |
Starts the Next.js dev server |
npm run build |
Builds the frontend for production |
npm run start |
Serves the production build |
npm run lint |
Runs ESLint |