Skip to content

technogise/llm-expense-app

Repository files navigation

Welcome to your Expo app 👋

This is an Expo project created with create-expo-app.

Get started

  1. Install dependencies

    npm install
  2. Start the app

     npx expo start

In the output, you'll find options to open the app in a

You can start developing by editing the files inside the app directory. This project uses file-based routing.

Environment Variables

The app uses environment variables for API tokens and other sensitive information. Create a .env file in the root directory of the project and add the following variables:

API_TOKEN=your-api-token
USERNAME=your-username
OPENAI_API_KEY=your-openai-api-key

AI Providers

The app supports three AI providers:

  • Ollama
  • ChatGPT

You can switch between providers by setting the CURRENT_PROVIDER variable in the constants.js file.

Implementation Details

Architecture Overview

This is an Expo-based mobile application for expense management that integrates with Kimai timesheet system and AI-powered image analysis for automated expense entry.

Tech Stack

  • Frontend Framework: Expo (React Native)
  • Language: JavaScript
  • AI Integration: Multi-provider support (Ollama, ChatGPT, Claude)
  • External APIs: Kimai timesheet API
  • File-based Routing: Expo Router

Key Features

  1. Kimai Integration: Direct integration with Kimai timesheet system for expense tracking
  2. AI-Powered OCR: Automatically extracts expense details from receipt images
  3. Multi-AI Provider Support: Flexible configuration to use different AI services
  4. Expense Management: Track expenses with categories, dates, and amounts

How It Works

1. Expense Image Analysis

The AI service processes receipt/invoice images through the following flow:

  • User captures or uploads an expense receipt image
  • Image is converted to base64 format
  • AI service sends the image to configured provider (Ollama/ChatGPT/Claude)
  • AI extracts structured data: date, category, description, and amount
  • Extracted data is returned in JSON format for further processing

2. Kimai API Integration

The application connects to Kimai timesheet system to:

  • Fetch expense categories
  • Submit expense entries
  • Retrieve customer and project data
  • Manage activities and timesheets

Authentication is handled via custom headers:

  • X-AUTH-USER: Username
  • X-AUTH-TOKEN: API token

3. AI Provider Configuration

The app supports three AI providers with a unified interface:

Ollama (Local/Self-hosted):

  • Uses ngrok tunnel for remote access
  • Model: llama3.2-vision

ChatGPT:

  • OpenAI API integration
  • Model: gpt-4-turbo
  • Vision capabilities for image analysis

Data Flow

  1. Image Capture → Base64 Encoding
  2. AI Analysis → Structured JSON extraction
  3. Data Validation → Category mapping and formatting
  4. Kimai Submission → Expense entry creation

Configuration

Switch AI providers by updating AI_CONFIG.CURRENT_PROVIDER in utils/constants.js:

CURRENT_PROVIDER: AI_PROVIDERS.CHATGPT  // or OLLAMA, CLAUDE

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors