Skip to content

This is a BillBot ๐Ÿค– which acts a simplistic invoice generator, just by taking input from user and converting into a Invoice and sending invoice image to user.

Notifications You must be signed in to change notification settings

ChandanKhamitkar/BillBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

78 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“ƒ BillBot - AI-powered Invoice Generator

๐Ÿš€ BillBot is an AI-powered Telegram bot that extracts structured data from text messages, generates professional invoices using Next.js, and delivers them as images via a webhook. It leverages GenAI for data extraction, Puppeteer for rendering, and is optimized for Vercel deployment.

๐Ÿ› ๏ธ Tech Stack

My Skills

Technology Purpose
Node.js & Express Backend for handling Telegram webhooks
Puppeteer + @sparticuz/chromium Generates invoice images using headless Chromium
GenAI ( Google's Gemini ) Extracts structured data from user messages
Redis Caching of Business Details (To avoid repeated DB requests)
Next.js Renders the invoice dynamically
Telegram Bot API Receives & Sends messages from users
Vercel Deployment for both webhook, invoice rendering and Next.js
TypeScript Ensure Typesafe

Architecture

Demo Result

Demo Video

Demo-video.mp4

๐Ÿ“Œ Features

  • โœ… AI-powered Data Extraction - Uses GenAI to structure invoice details.
  • โœ… Beautiful Invoice Rendering - Uses Next.js for frontend rendering.
  • โœ… Real-time Telegram Bot - Handles messages and replies instantly.
  • โœ… Puppeteer Image Generation - Converts invoices to high-quality images.
  • โœ… Serverless Deployment - Runs efficiently on Vercel.

Sample .env

# Telegram Bot
TELEGRAM_TOKEN=your-telegram-bot-token

# Gemini API Key (for AI-based data extraction)
API_KEY=your-api-key

How things actually are working in under the hood๐Ÿค” ?

  • Step - 1: At initial user starts sending customer details such as:
    • Customer Name
    • Phone Number
    • Items list ( Item Name, Quantity, Price of each )
    • Shipping cost
  • This user entered message will be forwarded to Backend Server which has been attached as a WebHook for Telegram-bot-api.
  • Step - 2: The response message will be forwarded to Gemini-API to extract & format into a preferred JSON format, however the user types the message of customer details. And sends back the json to Webhook server.
  • Step - 3: Now this json will be attached as a query parameter to Next.js Frontend URL. And this full URL will be passed to Puppeteer.
  • Step - 4: The Puppeteer will lauch the headless browser via @sparticuz/chromium - a precompiled chromium binary. And then Puppeteer will take screen shot and return that screenshot to the user.

That's it.โœจ


Sample from user

Radhe Krishna
+91 1234567890
Face Wash x4 100
Dandruff Shampoo x2 300
Shipping 40

About

This is a BillBot ๐Ÿค– which acts a simplistic invoice generator, just by taking input from user and converting into a Invoice and sending invoice image to user.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published