Skip to content

Bharath-code/invoicebot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

InvoiceBot - AI Invoice Data Entry Automation

Stop wasting hours on manual invoice data entry. Upload any invoice image or PDF and let AI extract all the data automatically.

Features

  • 🤖 AI-Powered Extraction - Uses Gemini 1.5 Flash for accurate invoice data extraction
  • Fast Processing - Process invoices in seconds, not minutes
  • 📊 Auto-Categorization - Automatically categorizes expenses (Software, Travel, Meals, etc.)
  • 📁 Export Anywhere - Export to CSV, QuickBooks, Xero
  • 💰 Save Money - Free tier available, paid plans from $29/month

Tech Stack

  • Framework: Next.js 14 (App Router)
  • Styling: Tailwind CSS + shadcn/ui
  • AI: Google Gemini 1.5 Flash (free tier available)
  • Payments: DodoPayments (ready to integrate)
  • Database: Supabase (ready to integrate)

Getting Started

Prerequisites

  • Node.js 18+
  • Google Gemini API key (free tier available)
  • DodoPayments account (for payments)
  • Supabase account (for database)

Installation

# Clone the repository
cd invoicebot

# Install dependencies
npm install

# Copy environment variables
cp .env.example .env.local

# Configure your environment variables
# Edit .env.local with your API keys

Environment Variables

Create a .env.local file with:

# Google Gemini (free tier available at https://aistudio.google.com)
GOOGLE_API_KEY=your_gemini_api_key

# DodoPayments (https://dodopayments.com)
DODO_PAYMENTS_API_KEY=your_dodo_api_key
DODO_PAYMENTS_WEBHOOK_KEY=your_webhook_key
DODO_PAYMENTS_RETURN_URL=http://localhost:3000
DODO_PAYMENTS_ENVIRONMENT=test_mode

# Supabase (https://supabase.com)
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key

# App
NEXT_PUBLIC_APP_URL=http://localhost:3000

Run Development Server

npm run dev

Open http://localhost:3000 to see the app.

Project Structure

invoicebot/
├── src/
│   ├── app/
│   │   ├── api/
│   │   │   ├── upload/route.ts    # File upload endpoint
│   │   │   └── process/route.ts   # AI processing endpoint
│   │   ├── dashboard/page.tsx     # Dashboard with invoice list
│   │   ├── layout.tsx             # Root layout
│   │   └── page.tsx               # Landing page
│   ├── components/                # React components
│   ├── lib/
│   │   ├── supabase.ts           # Supabase client
│   │   ├── gemini.ts             # Gemini AI client
│   │   ├── dodopayments.ts       # DodoPayments client
│   │   └── utils.ts              # Utility functions
│   └── types/                    # TypeScript types
├── public/                       # Static assets
└── package.json

Database Setup (Supabase)

Run the following SQL in your Supabase SQL Editor:

-- Profiles table
create table profiles (
  id uuid references auth.users primary key,
  email text,
  stripe_customer_id text,
  plan text default 'free',
  invoices_used integer default 0,
  created_at timestamptz default now()
);

-- Invoices table
create table invoices (
  id uuid default gen_random_uuid() primary key,
  user_id uuid references profiles(id),
  vendor text,
  total decimal,
  date date,
  category text,
  file_url text,
  status text default 'pending',
  raw_text text,
  created_at timestamptz default now()
);

-- Enable RLS
alter table profiles enable row level security;
alter table invoices enable row level security;

-- Create policies (adjust for your needs)
create policy "Users can view own profile" on profiles
  for select using (auth.uid() = id);

create policy "Users can view own invoices" on invoices
  for select using (auth.uid() = user_id);

create policy "Users can insert own invoices" on invoices
  for insert with check (auth.uid() = user_id);

API Endpoints

POST /api/upload

Upload an invoice file for processing.

POST /api/process

Process an uploaded invoice with AI extraction.

Deployment

Vercel (Recommended)

  1. Push to GitHub
  2. Connect to Vercel
  3. Add environment variables
  4. Deploy

Docker

docker build -t invoicebot .
docker run -p 3000:3000 invoicebot

Pricing

Plan Price Features
Free $0/mo 5 invoices/month
Pro $29/mo 20 invoices/month
Lifetime $197 one-time Unlimited invoices

Roadmap

  • Supabase authentication integration
  • DodoPayments subscription handling
  • Export to QuickBooks/Xero
  • Email notifications
  • Mobile app (React Native)
  • API access for developers

Contributing

Contributions welcome! Please read the contributing guidelines first.

License

MIT License - feel free to use this for your own projects.


Built with ❤️ using Next.js, Tailwind CSS, and Gemini AI

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published