A tool to automate the process of entering gas receipts into LubeLogger.
Features • Tech Stack • Getting Started • Usage • Architecture
Gas Receipt Automation is a full-stack application designed to streamline the process of logging fuel expenses. Users can submit a photo of their gas receipt and odometer, and the application will automatically extract the relevant information using AI and record it in LubeLogger, a self-hosted service for vehicle maintenance tracking.
- Automated Data Extraction: Utilizes Google's Gemini multi-modal LLM to intelligently parse receipt photos and extract key details like total cost, gallons purchased, and transaction date.
- Flexible Odometer Input: Supports multiple methods for odometer entry, including manual input, a separate photo of the odometer, or extracting it from the receipt photo itself.
- Vehicle Management: Fetches and displays a list of vehicles from your LubeLogger instance, allowing you to associate each gas receipt with the correct vehicle.
- Secure Authentication: Integrated with Auth0 to ensure that access to the application is secure and user-specific.
- Containerized Deployment: The entire application is containerized using Docker, making setup and deployment straightforward.
| Component | Technology |
|---|---|
| Frontend | Next.js, React, TypeScript, Tailwind CSS, Auth0 |
| Backend | FastAPI, Python, Google Gemini API, Auth0 |
| Deployment | Docker, Docker Compose |
- Docker
- Docker Compose
- A running instance of LubeLogger
- An Auth0 account for authentication
- A Google Gemini API key
-
Clone the repository:
git clone https://github.com/MFRANCIS-git/gasreceiptautomation.git cd gasreceiptautomation -
Configure the environment: Create a
.envfile in theserverdirectory and add the following environment variables:LUBELOGGER_URL=<your-lubelogger-url> GOOGLE_API_KEY=<your-google-gemini-api-key> AUTH0_DOMAIN=<your-auth0-domain> AUTH0_AUDIENCE=<your-auth0-api-audience>
Create a
.envfile in theclientdirectory and add the following environment variables:NEXT_PUBLIC_AUTH0_DOMAIN=<your-auth0-domain> NEXT_PUBLIC_AUTH0_CLIENT_ID=<your-auth0-client-id> NEXT_PUBLIC_AUTH0_REDIRECT_URI=<your-auth0-redirect-uri> NEXT_PUBLIC_AUTH0_AUDIENCE=<your-auth0-api-audience>
-
Build and run the application:
docker-compose up --build
The application will be available at
http://localhost:8003.
- Log in: Access the application and log in using your Auth0 credentials.
- Select a vehicle: Choose the vehicle you are logging a gas receipt for from the dropdown menu.
- Upload receipt: Upload a clear photo of your gas receipt.
- Provide odometer reading: Enter the odometer reading manually or upload a photo of the odometer.
- Submit: Click the "Submit" button. The application will process the information and create a new gas record in LubeLogger.
The application is composed of two main services:
- Client: A Next.js single-page application that provides the user interface for submitting gas receipts. It communicates with the backend API to submit the data.
- Server: A FastAPI backend that handles the business logic. It receives the receipt and odometer data, uses the Google Gemini API to extract the relevant information, and then creates a new gas record in LubeLogger via its API.
Both services are containerized with Docker and orchestrated using Docker Compose.
Note
This project is designed to be used with a self-hosted LubeLogger instance. For more information on setting up LubeLogger, please refer to the official documentation.