Skip to content

masoncfrancis/gasreceiptautomation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gas Receipt Automation

A tool to automate the process of entering gas receipts into LubeLogger.

FeaturesTech StackGetting StartedUsageArchitecture


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.

Features

  • 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.

Tech Stack

Component Technology
Frontend Next.js, React, TypeScript, Tailwind CSS, Auth0
Backend FastAPI, Python, Google Gemini API, Auth0
Deployment Docker, Docker Compose

Getting Started

Prerequisites

Installation

  1. Clone the repository:

    git clone https://github.com/MFRANCIS-git/gasreceiptautomation.git
    cd gasreceiptautomation
  2. Configure the environment: Create a .env file in the server directory 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 .env file in the client directory 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>
  3. Build and run the application:

    docker-compose up --build

    The application will be available at http://localhost:8003.

Usage

  1. Log in: Access the application and log in using your Auth0 credentials.
  2. Select a vehicle: Choose the vehicle you are logging a gas receipt for from the dropdown menu.
  3. Upload receipt: Upload a clear photo of your gas receipt.
  4. Provide odometer reading: Enter the odometer reading manually or upload a photo of the odometer.
  5. Submit: Click the "Submit" button. The application will process the information and create a new gas record in LubeLogger.

Architecture

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.

About

Enter your gas receipts to LubeLogger automatically with AI

Resources

Stars

Watchers

Forks

Releases

No releases published