An acoustic biodiversity monitor that listens to the world and tells you what's disappearing.
Point a microphone at any outdoor environment — a garden, a forest edge, a park at dawn — and Last Breath identifies every species by sound, cross-references each one against the IUCN Red List, and gives you a real-time biodiversity health score for that place. Verified sightings are logged to a live global map shared across all users.
We are living through the sixth mass extinction. Most people have no idea it is happening outside their window. Acoustic monitoring — listening for the species present in a soundscape — is one of the most sensitive and non-invasive ways to measure biodiversity. Field researchers have done this for decades with expensive equipment and months of manual analysis. Last Breath brings the same capability to anyone with a browser.
Record a 10-second clip outdoors. Within seconds you'll know which species you're sharing your environment with, whether their populations are declining, and roughly how many breeding seasons remain if current trends continue.
Microphone input (10s)
│
▼
Web Audio API ←─ live waveform visualisation
│
▼
Base64 audio blob
│
▼
/api/analyse ←─ Vercel serverless function (key never exposed)
│
▼
Gemini 2.5 Flash ←─ bioacoustician prompt → structured JSON
│
▼
Species list
│
├──► /api/iucn ←─ IUCN Red List API v4 (parallel lookups)
│ │
│ ▼
│ category · population trend · habitat narrative
│
▼
Biodiversity score ←─ weighted by threat category
│
▼
/api/sightings ←─ Supabase (global, shared across all users)
│
▼
Leaflet map ←─ live global sightings from every user
- Live waveform visualiser — Web Audio API renders your microphone input in real time so you can see the soundscape before the analysis begins
- AI species identification — Gemini 2.5 Flash identifies birds, frogs, insects and mammals by their acoustic signatures alone
- Real conservation data — every detected species is looked up against the IUCN Red List v4 API for its current threat category, population trend, and habitat description
- Biodiversity health score — a 0–100 score calculated from the threat categories present in your soundscape, animated with an SVG ring gauge
- Extinction countdown — for species that are Vulnerable, Endangered, or Critically Endangered with a decreasing population trend, the app estimates breeding seasons remaining in your region
- Verified sighting log — Auth0 authentication lets users log sightings as provable conservation records
- Global community map — every logged sighting is stored in Supabase and appears on a shared Leaflet map with CartoDB dark tiles
- No build step — single
index.htmlfile served statically; backend logic lives in three Vercel serverless functions
| Layer | Technology |
|---|---|
| Frontend | Vanilla HTML, CSS, JavaScript (zero frameworks) |
| AI analysis | Google Gemini 2.5 Flash via generateContent API |
| Conservation data | IUCN Red List API v4 |
| Authentication | Auth0 Universal Login (SPA SDK) |
| Map | Leaflet.js + CartoDB Dark Matter tiles |
| Database | Supabase (PostgreSQL) |
| Hosting | Vercel (static site + serverless functions) |
| Fonts | DM Serif Display + DM Mono (Google Fonts) |
git clone https://github.com/Boweii22/LastBreadth
cd lastbreathDeploy to Vercel:
npm i -g vercel
vercel deploy --prodOr connect the repo directly at vercel.com — no build settings required.
In your Vercel project → Settings → Environment Variables, add:
| Variable | Where to get it |
|---|---|
GEMINI_API_KEY |
aistudio.google.com |
IUCN_API_TOKEN |
api.iucnredlist.org/users/sign_up |
SUPABASE_URL |
Supabase project → Settings → API → Project URL |
SUPABASE_SERVICE_KEY |
Supabase project → Settings → API → service_role secret |
ALLOWED_ORIGIN |
Your deployed URL e.g. https://last-breath.vercel.app |
- Create a free application at auth0.com — type: Single Page Application
- Copy Domain and Client ID into
index.html:
const AUTH0_DOMAIN = 'dev-xxxx.us.auth0.com';
const AUTH0_CLIENT_ID = 'your_client_id';- In your Auth0 application settings, add your Vercel URL to:
- Allowed Callback URLs
- Allowed Logout URLs
- Allowed Web Origins
In your Supabase project → SQL Editor:
CREATE TABLE sightings (
id TEXT PRIMARY KEY,
timestamp TIMESTAMPTZ DEFAULT NOW(),
common_name TEXT NOT NULL,
scientific_name TEXT,
iucn_category TEXT,
lat DOUBLE PRECISION,
lng DOUBLE PRECISION,
city TEXT,
user_sub TEXT NOT NULL,
user_email TEXT
);vercel devThis runs the static site and all serverless functions locally at localhost:3000.
API keys and database credentials never reach the browser. All external API calls are proxied through three serverless functions:
api/analyse.js— injectsGEMINI_API_KEYserver-side; retries across model fallbacks on overloadapi/iucn.js— injectsIUCN_API_TOKENserver-side; handles the two-step v4 taxa → assessment lookupapi/sightings.js— injectsSUPABASE_SERVICE_KEYserver-side; validates all writes
Only Auth0's domain and clientId are in client-side code — this is by design; the Auth0 SPA SDK is built for browser use and security is enforced by the Allowed Callback URLs whitelist in your Auth0 dashboard.
last-breath/
├── index.html # entire frontend — HTML, CSS, JS
├── api/
│ ├── analyse.js # Gemini proxy with retry + model fallback
│ ├── iucn.js # IUCN Red List v4 proxy
│ └── sightings.js # Supabase read/write proxy
└── .gitignore
- Audio file upload (analyse recordings you didn't make live)
- Species trend graph over time for a specific location
- Exportable PDF field report for each recording session
- PWA support for offline-first mobile use
- Community species verification (flag uncertain identifications)
Every detected species is assigned a status by the IUCN Red List. Here is what each code means:
| Code | Full Name | What it means |
|---|---|---|
| EX | Extinct | Last individual has died. Gone forever. |
| EW | Extinct in the Wild | Only survives in captivity or cultivation. Functionally gone from nature. |
| CR | Critically Endangered | Extremely high risk of extinction in the wild. One bad event away. |
| EN | Endangered | Very high risk of extinction. Population declining severely. |
| VU | Vulnerable | High risk of extinction if circumstances don't change. |
| NT | Near Threatened | Not yet at risk but being watched closely. Could worsen soon. |
| LC | Least Concern | Population stable and widespread. No immediate threat. |
| DD | Data Deficient | Not enough information to make an assessment. The species exists but hasn't been studied enough to assign a threat level. |
| NE | Not Evaluated | Never been assessed by the IUCN at all. |
| Status | Score impact |
|---|---|
| CR | −15 |
| EN | −10 |
| VU | −6 |
| NT | −3 |
| LC | +2 |
| DD / NE | 0 |
CR, EN, and VU also trigger the extinction countdown shown on each species card. LC is the only status that adds to the score — hearing many LC species indicates a healthy, functioning ecosystem. DD does not mean safe; it means unknown.
- Species conservation status — IUCN Red List of Threatened Species, the world's most comprehensive inventory of species' global conservation status
- Acoustic identification — Google Gemini 2.5 Flash multimodal model
- Reverse geocoding — Nominatim (OpenStreetMap)
- Map tiles — CartoDB Dark Matter
Pull requests are welcome. For significant changes please open an issue first.
If you find a species misidentified, or want to improve the bioacoustician prompt, the system prompt lives at the top of the callGemini function in index.html — it is the single most impactful thing to tune.
MIT
