Skip to content

About

Wildlife intake app for SERC — photos paper intake sheets and saves data to Google Sheets

Topics

Resources

Code of conduct

Contributing

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

🐢 SERC Wildlife Intake

Web app for Southeastern Reptile Conservation (SERC) volunteers to photograph a paper intake sheet, have patient and rescuer data extracted via OCR, review the results, then submit directly to WRMD via its public intake form.

Live app: https://intake.southeastreptile.org


How It Works

  1. Upload — volunteer photographs the SERC paper intake form
  2. Extract — Gemini 3.1 Pro reads the handwriting and returns structured fields
  3. Review — volunteer corrects any OCR errors on the review screen
  4. Submit — "Open WRMD Form" opens the WRMD public intake form in a new tab; the app shows a reference card so the volunteer can type the data in

Tech Stack

Layer Technology
Front-end React 19, Material UI v7
Back-end Python, FastAPI
OCR Google Gemini 3.1 Pro (multimodal)
Frontend hosting Firebase Hosting
Backend hosting Google Cloud Run
CI/CD GitHub Actions

Project Structure

turtle-intake/
├── .github/workflows/deploy.yml  # CI/CD — push to main deploys both services
├── firebase.json                 # Firebase Hosting config
├── frontend/
│   ├── .env.production           # Production API URL
│   └── src/
│       ├── components/
│       │   ├── UploadForm/       # Photo upload + size validation
│       │   └── ReviewForm/       # Review & edit extracted fields; "Open WRMD Form" button
│       ├── services/api.js       # API client (extract only)
│       ├── App.jsx               # Flow: upload → review → reference card
│       └── theme.js              # MUI theme (SERC earth tones)
└── backend/
    ├── Dockerfile
    ├── main.py                   # FastAPI app + CORS
    ├── routers/intake.py         # POST /api/intake/extract
    ├── services/ocr.py           # Gemini 3.1 Pro → IntakeRecord
    ├── models/intake.py          # IntakeRecord, IntakeResponse
    ├── utils/dates.py            # M-D-YY → YYYY-MM-DD
    └── requirements.txt

Local Development

Prerequisites

Front-End

cd frontend
npm install
# Create frontend/.env:
# REACT_APP_API_BASE_URL=http://localhost:8000
npm start   # http://localhost:3000

Back-End

cd backend
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
# Create backend/.env from backend/.env.example
uvicorn main:app --reload --port 8000

Environment Variables

Back-End (backend/.env)

Variable Description
GEMINI_API_KEY Gemini API key for OCR
FRONTEND_ORIGIN Comma-separated allowed CORS origins

Front-End (frontend/.env)

Variable Description
REACT_APP_API_BASE_URL FastAPI back-end URL

API

Endpoint Description
POST /api/intake/extract Upload intake form photo (multipart, image field, max 15 MB). Returns { extracted: IntakeRecord, warnings: string[] }.
GET /health Health check.

Deployment

Both services deploy automatically on push to main via GitHub Actions.

Required GitHub Secrets

Secret Description
GCP_SA_KEY GCP service account JSON (roles: run.admin, iam.serviceAccountUser, artifactregistry.writer, secretmanager.secretAccessor, firebasehosting.admin)
FIREBASE_TOKEN Firebase CI token (firebase login:ci)

Required GCP Secret Manager Secrets

Secret name Value
GEMINI_API_KEY Gemini API key
FRONTEND_ORIGIN Allowed CORS origin(s), e.g. https://intake.southeastreptile.org

About

Wildlife intake app for SERC — photos paper intake sheets and saves data to Google Sheets

Topics

Resources

Code of conduct

Contributing

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages