Interactive visual guide to popular tarantula species.
The app shows a tree of lifestyles → genera → species and a detail panel with region, temperament, toxicity, size and short/long descriptions.
- React + TypeScript + Vite
react-d3-treefor the tree visualization- Firebase Hosting
- Google Cloud Storage (
@google-cloud/storage) - Image processing with
sharp - Utility scripts via
tsx
- Node.js 18+
npmgcloudCLIfirebase-tools(installed globally)
Prepare:
npm install -g firebase-tools
gcloud auth application-default loginYou also need a GCS bucket (for example: .firebasestorage.app) and access to the Firebase project.
git clone <repo-url>
cd spiders
npm installnpm run devVite will start the dev server (usually on http://localhost:5173)
npm run buildOptionally:
npm run previewnpm run build && firebase deploy --only hostingThis assumes Firebase Hosting is already configured for the project.
Species images are stored in a GCS bucket and generated from external URLs listed in src/tools/species-images.json
The JSON file looks like:
[
{
"id": "psalmopoeus-pulcher",
"sourceUrl": "https://example.com/image1.png"
},
{
"id": "poecilotheria-metallica",
"sourceUrl": "https://example.com/image2.jpg"
}
]Upload / optimize all species images
This script:
1. Reads src/tools/species-images.json
2. Downloads each sourceUrl
3. Resizes and converts to WebP (900×550, fit: cover)
4. Uploads to the bucket as species/<id>/main.webp
5. Makes each file public with long cache headers
Run:
npx tsx src/tools/upload-images.ts \
--bucket <bucket>.firebasestorage.app \
--prefix species \
--insecureFlags:
--bucket – GCS bucket name
--prefix – prefix inside the bucket (default: species)
--json – optional custom JSON file path
--insecure – disable TLS verification (only for broken HTTPS sources)
If a particular image cannot be processed, the script logs an error and skips to the next item.
The info panel uses a local placeholder when a species image is missing.
src/tools/optimize-placeholder.ts:
- Reads
public/images/spider.png - Resizes to 900×550 with fit: contain
- Adds a dark background
- Writes
public/images/spider-placeholder.webp
Run:
npx tsx src/tools/optimize-placeholder.tsThe app then loads it as: /images/spider-placeholder.webp