Automated incident evidence packaging for Geotab fleets. Generates professional PDF reports with GPS trails, speed analysis, diagnostics, and weather data for insurance claims and fleet management.
- MyGeotab Add-In: React-based Add-In built with Geotab Zenith design system
- Automatic Incident Detection: Polls Geotab for ExceptionEvents (harsh braking, collisions, speeding)
- Evidence Packaging: Collects GPS trail, speed data, diagnostics, and weather conditions
- Photo Evidence: Upload and attach photos to reports via Geotab MediaFile API
- Professional PDF Reports: Generated using QuestPDF with customizable branding
- Email Sharing: Send reports via email with PDF attachments
- Notifications: Email (Gmail OAuth) and webhook support
- Multi-tenant: Supports multiple Geotab databases from a single deployment
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Customer's MyGeotab β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β FleetClaim Add-In (React) β β
β β - View/manage incident reports β β
β β - Upload photo evidence β β
β β - Request on-demand reports β β
β β - Download PDFs, send emails β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β ββββββββββββββββ ββββββββββ΄ββββββββ ββββββββββββββββββ β
β βExceptionEventβ β AddInData β β MediaFile β β
β β (incidents) β β(reports/config)β β (photo storage)β β
β ββββββββ¬ββββββββ βββββββββ¬βββββββββ βββββββββ¬βββββββββ β
βββββββββββΌβββββββββββββββββββΌββββββββββββββββββββΌβββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FleetClaim API (GCP Cloud Run) β
β - POST /api/pdf - Generate PDF with user credentials β
β - POST /api/email - Send report via email β
β - GET /api/pdf/{db}/{id} - Service account PDF download β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FleetClaim Worker (GCP Cloud Run Job) β
β - Scheduled polling for new incidents β
β - Automatic report generation β
β - Process on-demand report requests β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Project | Description |
|---|---|
FleetClaim.AddIn.React |
MyGeotab Add-In (React + Zenith) |
FleetClaim.Core |
Shared models, services, Geotab integration |
FleetClaim.Worker |
Background job for polling and report generation |
FleetClaim.Api |
Web API for PDF generation and email |
FleetClaim.Admin |
Admin dashboard (optional) |
FleetClaim.Tests |
Unit tests |
| Component | Technology |
|---|---|
| Add-In Frontend | React 18, TypeScript, Geotab Zenith |
| Runtime | .NET 8 |
| PDF Generation | QuestPDF |
| Gmail OAuth2 | |
| Weather | Open-Meteo (free API) |
| Maps | Google Static Maps (optional) |
| Hosting | GCP Cloud Run |
| Secrets | GCP Secret Manager |
| CI/CD | GitHub Actions (conditional deploys) |
- .NET 8 SDK
- Node.js 18+ (for Add-In development)
- Google Cloud CLI
- A GCP project with billing enabled
# Clone and build
cd fleetclaim
dotnet restore
dotnet build
dotnet test
# Build Add-In
cd src/FleetClaim.AddIn.React
npm install
npm run build
npm testcd src/FleetClaim.AddIn.React
npm run devThen configure your MyGeotab Add-In to point to http://localhost:9000.
The project uses GitHub Actions with conditional deployments - only changed components are deployed:
# Push to main triggers CI/CD
git push origin main
# Or manually trigger specific components via GitHub ActionsFor each customer database, create a secret in Secret Manager:
# Create credentials file
cat > creds.json << EOF
{
"database": "customer_db_name",
"userName": "fleetclaim-integration@company.com",
"password": "your-password",
"server": "my.geotab.com"
}
EOF
# Create secret
gcloud secrets create fleetclaim-creds-customer_db_name \
--data-file=creds.json \
--project=your-project-id
# Clean up
rm creds.json- View all incident reports with filtering (severity, date range, vehicle)
- Date filter defaults to "Last 30 days"
- Click any report to view details, photos, and damage assessment
- Download PDF or send via email
- Submit on-demand report requests for specific vehicles/time ranges
- Track request status (pending, processing, completed, failed)
- "Force Report" option to generate reports even without detected incidents
- Configure notification preferences
- Set severity thresholds
- Manage webhook integrations
See docs/API.md for full API documentation.
| Endpoint | Auth | Description |
|---|---|---|
GET /health |
None | Health check |
POST /api/pdf |
X-Geotab-* headers | Generate PDF with user session |
GET /api/pdf/{db}/{id} |
Query param | PDF via service account |
POST /api/email |
X-Geotab-* headers | Send report via email |
| Variable | Required | Description |
|---|---|---|
GCP_PROJECT_ID |
Yes | GCP project ID for Secret Manager |
GMAIL_CLIENT_ID |
No | Gmail OAuth client ID |
GMAIL_CLIENT_SECRET |
No | Gmail OAuth client secret |
GMAIL_REFRESH_TOKEN |
No | Gmail OAuth refresh token |
GMAIL_FROM_EMAIL |
No | From email address |
PDF_COMPANY_NAME |
No | Company name in PDF header |
GOOGLE_MAPS_API_KEY |
No | For static map images in PDFs |
| Variable | Required | Description |
|---|---|---|
GCP_PROJECT_ID |
Yes | GCP project ID for Secret Manager |
POLL_INTERVAL_MINUTES |
No | Polling interval (default: 5) |
The project uses conditional deployments via dorny/paths-filter:
- API changes (
src/FleetClaim.Api/**,src/FleetClaim.Core/**) β Deploy API - Add-In changes (
src/FleetClaim.AddIn.React/**) β Deploy Add-In - Worker changes (
src/FleetClaim.Worker/**,src/FleetClaim.Core/**) β Deploy Worker - Admin changes (
src/FleetClaim.Admin/**) β Deploy Admin
Tests must pass before any deployment.
- Session-based Auth: API endpoints verify user credentials via Geotab GetSystemTime call
- X-Header Authentication: Credentials passed via
X-Geotab-Database,X-Geotab-UserName,X-Geotab-SessionId - Credential Isolation: Each customer's Geotab credentials stored in separate secrets
- Rate Limiting: PDF (10/min) and email (5/min) endpoints are rate limited
- CORS Restricted: Only allows requests from
*.geotab.com,*.geotab.ca, and Cloud Run domains
# Run .NET tests
dotnet test
# Run Add-In tests (97 tests)
cd src/FleetClaim.AddIn.React
npm testThis project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- QuestPDF - Used under the Community License (free for companies with < $1M annual revenue)
- Geotab Zenith - Geotab's design system, used under their SDK terms