- Multi-camera snapshot capture with per-camera selection
- Gallery with filter chips per camera and a full-size lightbox
- Snapshots saved to
./snapshots/{CameraName}/YYYYMMDD_HHMMSS.jpg - MFA login flow; auto-login on restart via persisted OAuth tokens
- Optional AI image analysis via Google Gemini
- Python 3.11+
- A Blink account with at least one camera
uv
git clone https://github.com/your-username/BlinkThink.git
cd BlinkThink
uv sync
cp .env.example .env # add GEMINI_API_KEY if desired
uv run uvicorn main:app --host 0.0.0.0 --port 8000 --reloadOpen http://localhost:8000 in your browser.
Copy .env.example to .env. All variables are optional — defaults are shown below.
| Variable | Default | Description |
|---|---|---|
SNAPSHOT_DIR |
./snapshots |
Root directory for saved snapshots |
CREDENTIALS_FILE |
./blink_credentials.json |
Path for persisted Blink OAuth tokens |
ALLOWED_ORIGINS |
http://localhost:8000,http://127.0.0.1:8000 |
Comma-separated CORS origins |
GEMINI_API_KEY |
(empty) | Google Gemini API key — enables the Analyze button |
GEMINI_MODEL |
gemini-2.5-flash |
Gemini model for image analysis |
- Enter your Blink email and password in the login screen.
- Enter the verification code sent to your email.
- Tokens are saved to
blink_credentials.jsonand reused on restart — no MFA required.
To force re-authentication, delete blink_credentials.json.
snapshots/
├── FrontDoor/
│ ├── 20250315_143022.jpg
│ └── 20250315_143501.jpg
└── Backyard/
└── 20250315_143022.jpg
Camera names are sanitised ([A-Za-z0-9_-] only) before use as directory names.
- Local-only by default. Do not expose port 8000 publicly. Use a VPN or authenticated reverse proxy for remote access.
- CORS is restricted to
ALLOWED_ORIGINS— wildcard*is never used. - Login fields and MFA codes are validated via Pydantic before any Blink API call.
.env,blink_credentials.json, andsnapshots/are gitignored.
BlinkThink/
├── main.py # FastAPI app, routes, lifespan
├── clients/
│ ├── blink_client.py # BlinkClient singleton (blinkpy wrapper)
│ └── ai/
│ ├── base.py # AIImageAnalyzer ABC
│ └── gemini.py # GeminiClient (google-genai wrapper)
├── utils/
│ └── files.py # Path/timestamp helpers
├── static/
│ ├── index.html # Single-page frontend
│ ├── app.js # Camera selection, gallery, lightbox, analysis
│ ├── style.css
│ └── logo.png
├── .env.example
└── pyproject.toml
