A full-stack personal finance application that combines AI-powered receipt scanning, interactive data visualizations, and a financial chatbot — all in a clean, single-page experience.
| Feature | Description |
|---|---|
| 📱 GPay Screenshot OCR | Upload a Google Pay screenshot and let Gemini Vision auto-extract merchant, amount, and date |
| 🧾 Bill / Receipt Scanner | Upload any receipt image to extract individual line items with prices and categories |
| 💵 Manual Entry | Quick-add cash expenses with vendor, category, date, and description |
| 📊 Visual Dashboard | Pie chart for category breakdown + bar chart for monthly spending trends (Chart.js) |
| 📈 Financial Analysis | Metrics panel showing total spent, average expense, category count, and monthly activity |
| 💬 AI Chatbot | Ask Gemini questions about your spending patterns and get personalized financial insights |
| 📥 CSV Export | Download all expense data as a .csv file |
| 🔐 User Auth | Register / Login with bcrypt-hashed passwords |
| 💰 Budget Setup | Set your monthly salary and spending budget on first sign-up |
| Layer | Technology |
|---|---|
| Backend | Express.js 5, Node.js |
| Database | SQLite via better-sqlite3 (WAL mode) |
| AI / OCR | Google Gemini 2.5 Flash (@google/generative-ai) |
| Auth | bcryptjs for password hashing |
| Frontend | Vanilla HTML / CSS / JavaScript |
| Charts | Chart.js (CDN) |
mini-project-final/
├── start.bat # One-click launcher (Windows)
├── .gitignore
└── UI/
├── server.js # Express API server (auth, expenses, OCR, chatbot)
├── package.json
├── .env # Gemini API key (not committed)
├── budget.db # SQLite database (auto-created, not committed)
├── Login.html # Login page
├── Register.html # Registration page
├── salary_budget.html # Salary & budget setup (post-registration)
└── budget.html # Main dashboard (expenses, charts, analysis, chatbot)
- Node.js v18 or higher — download
- Google Gemini API Key — get one here
-
Clone the repository
git clone <repo-url> cd mini-project-final
-
Install dependencies
cd UI npm install -
Configure environment
Create a
.envfile inside theUI/directory:GEMINI_API_KEY=your_gemini_api_key_here
-
Start the server
node server.js
Or on Windows, simply double-click
start.batfrom the project root. -
Open in browser
http://localhost:3000/Login.html
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/register |
Create a new user account |
POST |
/api/login |
Authenticate and log in |
PUT |
/api/user |
Update salary and budget |
GET |
/api/expenses/:userId |
Fetch all expenses for a user |
POST |
/api/expenses |
Add one or more expenses |
DELETE |
/api/expenses/:id |
Delete an expense |
POST |
/extract |
OCR — extract data from a receipt/bill image |
POST |
/chat |
Send a message to the AI financial chatbot |
users
├── id INTEGER PRIMARY KEY
├── name TEXT NOT NULL
├── email TEXT NOT NULL UNIQUE
├── password_hash TEXT NOT NULL
├── salary REAL DEFAULT 0
└── budget REAL DEFAULT 0
expenses
├── id INTEGER PRIMARY KEY
├── user_id INTEGER (FK → users.id)
├── date TEXT NOT NULL
├── amount REAL NOT NULL
├── item TEXT NOT NULL -- category (Groceries, Transport, etc.)
├── vendor TEXT
├── description TEXT
├── type TEXT -- 'manual' | 'gpay' | 'bill'
└── created_at TEXTThis project is licensed under ISC.