Use a MultiModal AI workflow to scan a receipt or bill, extract structured data, and persist it.
BillScan consists of two parts:
- Frontend (
frontend/) - Vite + React + TypeScript for uploading images, viewing extracted bill data, and interacting with AI services. - Backend (
backend/) - Express + SQLite providing REST endpoints to store and retrieve bills.
BillScan/
├── frontend/ # React frontend application
│ ├── components/ # Reusable UI components
│ ├── services/ # AI and storage service integrations
│ ├── views/ # Page components
│ ├── Dockerfile # Frontend Docker build
│ └── ...
├── backend/ # Express backend API
│ ├── index.js # Server entry point
│ ├── db.js # SQLite database setup
│ ├── Dockerfile # Backend Docker build
│ └── ...
├── docker-compose.yml # Docker orchestration
├── LICENSE
└── README.md
- Node.js (v18+ recommended) - for local development
- Docker and Docker Compose - for containerized deployment
- API key for at least one AI service (see AI Service Configuration below)
BillScan supports multiple AI services for bill/receipt extraction. Configure which service to use by setting the AI_SERVICE environment variable in your backend/.env file.
-
Gemini (default) - Google's Gemini AI
AI_SERVICE=gemini GEMINI_API_KEY=your_gemini_key_here
-
OpenAI - GPT-4 Vision or GPT-4o
AI_SERVICE=openai OPENAI_API_KEY=your_openai_key_here
-
Claude - Anthropic's Claude with vision
AI_SERVICE=claude ANTHROPIC_API_KEY=your_anthropic_key_here
-
Ollama - Local AI models
AI_SERVICE=ollama OLLAMA_HOST=http://localhost:11434 # Optional, defaults to localhost:11434
If AI_SERVICE is not set, the application defaults to gemini
The easiest way to run BillScan is with Docker Compose:
-
Create a
.envfile in the project root with your API keys:# .env file GEMINI_API_KEY=your_key_here AI_SERVICE=gemini # Add other keys as needed (see AI Service Configuration above)
-
Build and start the containers:
docker compose up --build
-
Access the application:
- Frontend: http://localhost:8080
- Backend API: http://localhost:8080/api (proxied through frontend)
-
To stop the containers:
docker compose down
From the frontend/ directory:
- Install dependencies:
cd frontend npm install - Configure your AI service in
.env(create the file if missing):# Choose your AI service AI_SERVICE=gemini # or openai, claude, ollama # For Gemini (default): GEMINI_API_KEY=your_key_here # For OpenAI: # OPENAI_API_KEY=your_key_here # For Claude: # ANTHROPIC_API_KEY=your_key_here # For Ollama (local): # OLLAMA_HOST=http://localhost:11434 # OLLAMA_MODEL=gemma3
- Start the dev server:
npm run dev
- Open the printed local URL (typically
http://localhost:3001).
The backend lives in backend/ and uses an on-disk SQLite database bills.db created automatically.
- Install backend dependencies:
cd backend npm install - Start the server (port 3000 by default):
You should see:
node index.js
Server running on http://localhost:3000.
If you prefer, add a script to backend/package.json:
"scripts": { "start": "node index.js" }Then run:
npm start- If Docker build fails, ensure you have Docker and Docker Compose installed.
- To reset Docker data:
docker compose down -v(removes volumes and data). - View container logs:
docker compose logs -f - Rebuild containers after code changes:
docker compose up --build



