Mileage Tracking Automation — Plan
How it works
- Open the web app on your phone
- Take a photo of the odometer
- Claude Vision API reads the number automatically
- The km driven is calculated and saved to an Excel sheet
- Download the sheet anytime
Stack
| Layer |
Technology |
| Backend |
Rust + Axum |
| AI / OCR |
Claude API (vision) |
| Spreadsheet |
rust_xlsxwriter (Excel) |
| Frontend |
Mobile-friendly HTML |
Excel sheet columns
| Date |
Time |
Odometer (km) |
Trip (km) |
Notes |
| 2026-03-18 |
08:14 |
84 320 |
47 |
Work |
Files to create
Driverthing/
├── src/
│ ├── main.rs # Axum server + routes
│ ├── claude.rs # Claude API vision call
│ └── excel.rs # Excel read/write logic
├── templates/
│ └── index.html # Mobile camera upload page
├── Cargo.toml
└── mileage_log.xlsx # Generated, gitignored
Flow
Phone camera → upload photo
→ Axum receives multipart/form-data
→ Claude Vision: "What is the odometer reading?"
→ Extract number
→ Calculate delta from last reading
→ Append row to Excel
→ Show confirmation on screen
Implementation steps
- Set up Axum server with a multipart file upload endpoint
- Send uploaded image (base64) to Claude API with a vision prompt
- Parse the odometer number from the response
- Read the last recorded odometer value from the Excel file
- Calculate the difference (km driven)
- Append a new row (date, time, odometer, trip km, notes) to the sheet
- Return confirmation to the browser
- Add a download endpoint for the Excel file