A modern web application that uses AI to automatically parse and track your energy and gas bills. Upload your bills, let Claude AI extract the key information, review and confirm the data, then automatically update your yearly statistics.
- Yearly Overview: See your total costs and consumption for the current year
- Quick Stats: Energy usage (kW), Gas usage (mΒ³), and total spending
- Year Navigation: Easily switch between years to view historical data
- Breakdown Details: Detailed statistics for energy and gas separately
- Smart Upload: Drag & drop or click to upload bill PDFs or images (JPG/PNG)
- AI Extraction: Claude 3.5 Sonnet automatically extracts:
- Bill type (energy or gas)
- Billing period
- Total cost
- Consumption amount
- Confidence score
- Review & Confirm: Review extracted data before saving
- Edit Capabilities: Manually adjust any values if needed
- View All Bills: Browse all uploaded and confirmed bills
- Filtering: Filter by status, year, and bill type
- Quick Actions: Confirm pending bills or delete incorrect entries
- Bill Details: View notes and extraction confidence
- Automatic Updates: Yearly statistics automatically update when bills are confirmed
- Data Persistence: SQLite database for local storage
- Transaction Support: Ensures data consistency
- Frontend: Vue 3, Nuxt 4, Tailwind CSS
- Backend: Nuxt Server Routes (Nitro)
- AI: Anthropic Claude 3.5 Sonnet via Vercel AI SDK
- Database: Prisma ORM + SQLite
- Language: TypeScript
- Node.js 18+ or Bun
- An Anthropic API key (get one at console.anthropic.com)
# Navigate to the project directory
cd bills-tracker
# Install dependencies (using npm, yarn, or bun)
npm install
# or
bun install# Copy the example environment file
cp .env.example .env.local
# Edit .env.local and add your Anthropic API key
ANTHROPIC_API_KEY=your_api_key_here
DATABASE_URL="file:./dev.db"# Generate Prisma client
npx prisma generate
# Run migrations to create the database schema
npx prisma migrate dev --name initnpm run dev
# or
bun run devThe application will be available at http://localhost:3000
- Click "Upload New Bill" on the dashboard or navigate to
/upload - Drag and drop your bill image/PDF or click to select a file
- The AI will automatically extract information from the bill
- Review the extracted data and make any necessary corrections
- Click "Confirm & Save" to save the bill and update yearly statistics
- The home page shows your yearly summary
- Use the year selector to view different years
- See breakdown of energy and gas costs and consumption
- Navigate to the "Bills" section to see all bills
- Filter by status (pending/confirmed), year, or type
- Confirm pending bills or delete incorrect entries
- View bill notes and confidence scores
POST /api/bills/parse- Parse a bill image with AIPOST /api/bills/[id]/confirm- Confirm a parsed billDELETE /api/bills/[id]- Delete a billGET /api/bills- Get bills (query params: status, year)
GET /api/stats- Get yearly statistics (query param: year)
id: Unique identifierbillType: 'energy' or 'gas'period: Billing period (e.g., "January 2024")cost: Total cost in currency unitsconsumption: Amount consumedunit: 'kW' or 'mΒ³'confirmed: Boolean statusyear&month: For efficient queryingnotes: Optional notes from AI or user
year: Year identifier (unique)energyTotalCost,energyTotalConsumed,energyBillCount: Energy statisticsgasTotalCost,gasTotalConsumed,gasBillCount: Gas statisticscombinedTotalCost: Total cost for the year
bills-tracker/
βββ app/
β βββ pages/
β β βββ index.vue # Dashboard
β β βββ upload.vue # Bill upload page
β β βββ bills.vue # Bills list page
β βββ components/ # Vue components
β βββ server/
β β βββ api/
β β β βββ bills/ # Bill-related endpoints
β β β βββ stats.get.ts # Statistics endpoint
β β βββ utils/
β β βββ ai.ts # AI parsing logic
β β βββ db.ts # Database utilities
β βββ app.vue # Root component
βββ prisma/
β βββ schema.prisma # Database schema
βββ nuxt.config.ts # Nuxt configuration
.env.local file or expose API keys in the code.
The API key should only be used on the backend server. The frontend makes requests to the server, which then uses the API key securely.
- Maximum file size: 10 MB
- Supported formats: PDF, JPG, PNG
The application displays a confidence score (0-1) for each parsed bill. Always review bills with low confidence scores before confirming.
All data is stored locally in the SQLite database. No bill data is sent to external services except through the Anthropic API for parsing.
- Check that your bill image is clear and readable
- Ensure the file format is supported (PDF, JPG, PNG)
- Verify your Anthropic API key is correct
- Check your API quota and rate limits
- Ensure
DATABASE_URLis correctly set in.env.local - Run
npx prisma migrate devto fix schema issues - Check file permissions in the project directory
- Clear node_modules:
rm -rf node_modules && npm install - Rebuild Prisma:
npx prisma generate - Check Node.js version:
node --version(should be 18+)
npm run testnpm run build
npm run preview# Open Prisma Studio to view/edit data
npx prisma studio
# Create a new migration
npx prisma migrate dev --name your_migration_nameFeel free to submit issues and enhancement requests!
MIT License - feel free to use this project for personal or commercial purposes.
For issues or questions:
- Check the troubleshooting section
- Review the API documentation
- Check the Anthropic API documentation
- Open an issue in the repository
Happy bill tracking! ππ°