From 3a5aacadd8979ae9334aa616d0474c882a7005c4 Mon Sep 17 00:00:00 2001 From: Vachhani-Tapan Date: Mon, 16 Mar 2026 16:06:56 +0530 Subject: [PATCH 1/6] chore: add vercel.json for backend deployment --- backend/vercel.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 backend/vercel.json diff --git a/backend/vercel.json b/backend/vercel.json new file mode 100644 index 0000000..b633a24 --- /dev/null +++ b/backend/vercel.json @@ -0,0 +1,15 @@ +{ + "version": 2, + "builds": [ + { + "src": "server.js", + "use": "@vercel/node" + } + ], + "routes": [ + { + "src": "/(.*)", + "dest": "server.js" + } + ] +} From 07f82d0eac2094e99afc37bdee4d1f46d78f6bb5 Mon Sep 17 00:00:00 2001 From: Vachhani-Tapan Date: Mon, 16 Mar 2026 17:14:49 +0530 Subject: [PATCH 2/6] fix: refactor CORS for deployment and add safety checks to debt routes --- backend/routes/debtRoutes.js | 18 +++++++++++++----- backend/server.js | 15 ++++++++++++--- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/backend/routes/debtRoutes.js b/backend/routes/debtRoutes.js index ef6b997..24a49d9 100644 --- a/backend/routes/debtRoutes.js +++ b/backend/routes/debtRoutes.js @@ -63,8 +63,9 @@ router.post('/ai-advice', async (req, res) => { const { uid } = req.body; if (!uid) return res.status(400).json({ error: 'uid is required' }); - if (!process.env.GROQ_API_KEY || process.env.GROQ_API_KEY === 'your_groq_api_key_here') { - return res.status(500).json({ error: 'Groq API key not configured.' }); + if (!process.env.GROQ_API_KEY || process.env.GROQ_API_KEY === 'your_groq_api_key_here' || process.env.GROQ_API_KEY === '') { + console.warn('GROQ_API_KEY is not configured.'); + return res.status(200).json({ response: "AI advice is currently unavailable. Please configure your GROQ_API_KEY in the backend environment variables." }); } const debts = await Debt.find({ userId: uid }); @@ -72,9 +73,16 @@ router.post('/ai-advice', async (req, res) => { return res.json({ response: "🎉 **Congratulations!** You have no debts recorded. Keep up the great financial discipline!" }); } - const savingsProfile = await SavingsGoal.findOne({ userId: uid }); - const monthlySalary = savingsProfile?.monthlySalary || 0; - const monthlySavings = savingsProfile?.monthlySavings || 0; + // Try to fetch profile but don't fail if not found + let monthlySalary = 0; + let monthlySavings = 0; + try { + const savingsProfile = await SavingsGoal.findOne({ userId: uid }); + monthlySalary = savingsProfile?.monthlySalary || 0; + monthlySavings = savingsProfile?.monthlySavings || 0; + } catch (profileErr) { + console.warn('Optional profile fetch failed:', profileErr); + } const totalDebt = debts.reduce((s, d) => s + d.remainingAmount, 0); const totalEMI = debts.reduce((s, d) => s + d.emiAmount, 0); diff --git a/backend/server.js b/backend/server.js index 945da43..9d9c793 100644 --- a/backend/server.js +++ b/backend/server.js @@ -25,13 +25,22 @@ app.use((req, res, next) => { }); // Middleware +const allowedOrigins = [ + 'http://localhost:5173', + 'http://localhost:5174', + process.env.FRONTEND_URL, +].filter(Boolean); + app.use(cors({ origin: (origin, callback) => { - const allowedOrigins = ['http://localhost:5173', 'http://localhost:5174', process.env.FRONTEND_URL]; - if (!origin || allowedOrigins.includes(origin) || (process.env.FRONTEND_URL && origin.startsWith(process.env.FRONTEND_URL))) { + // Logging origin for debugging in deployment + if (origin) console.log(`Incoming request from origin: ${origin}`); + + if (!origin || allowedOrigins.includes(origin) || allowedOrigins.some(o => origin.startsWith(o)) || origin.endsWith('.vercel.app') || origin.endsWith('.onrender.com')) { callback(null, true); } else { - callback(new Error('Not allowed by CORS')); + console.warn(`CORS blocked for origin: ${origin}`); + callback(null, false); // Deny but don't throw error to avoid 500 } }, credentials: true, From c166debd379f0fb8e5ce9baea3805d972ce2c597 Mon Sep 17 00:00:00 2001 From: Vachhani-Tapan Date: Sat, 11 Apr 2026 11:12:50 +0530 Subject: [PATCH 3/6] Added the robots.txt and sitemap.xml file for SEO --- finwiseai/public/robots.txt | 7 +++++++ finwiseai/public/sitemap.xml | 14 ++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 finwiseai/public/robots.txt create mode 100644 finwiseai/public/sitemap.xml diff --git a/finwiseai/public/robots.txt b/finwiseai/public/robots.txt new file mode 100644 index 0000000..7bae9d8 --- /dev/null +++ b/finwiseai/public/robots.txt @@ -0,0 +1,7 @@ +User-agent: * +Allow: / + +Sitemap: https://www.tapanvachhani.me/ + +User-agent: * +Disallow: / \ No newline at end of file diff --git a/finwiseai/public/sitemap.xml b/finwiseai/public/sitemap.xml new file mode 100644 index 0000000..77a70fd --- /dev/null +++ b/finwiseai/public/sitemap.xml @@ -0,0 +1,14 @@ + + + + https://finwiseai-1-yvg4.vercel.app/login + daily + 1.0 + + + https://finwiseai-1-yvg4.vercel.app/ + daily + 1.0 + + + \ No newline at end of file From 4cf46713bf88cd41cc9b2dcd6496933859903201 Mon Sep 17 00:00:00 2001 From: Vachhani-Tapan Date: Sat, 11 Apr 2026 11:14:30 +0530 Subject: [PATCH 4/6] Added the robots.txt and sitemap.xml file for SEO --- finwiseai/public/robots.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/finwiseai/public/robots.txt b/finwiseai/public/robots.txt index 7bae9d8..8141dae 100644 --- a/finwiseai/public/robots.txt +++ b/finwiseai/public/robots.txt @@ -1,7 +1,7 @@ User-agent: * Allow: / -Sitemap: https://www.tapanvachhani.me/ +Sitemap: https://finwiseai-1-yvg4.vercel.app/ User-agent: * Disallow: / \ No newline at end of file From 7eb666d5a7b55409463cb51bf0aaa9ec4306d471 Mon Sep 17 00:00:00 2001 From: Vachhani-Tapan Date: Sat, 11 Apr 2026 11:22:58 +0530 Subject: [PATCH 5/6] Added Google Search Console HTML file --- finwiseai/public/googlebeb19871fbe55511.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 finwiseai/public/googlebeb19871fbe55511.html diff --git a/finwiseai/public/googlebeb19871fbe55511.html b/finwiseai/public/googlebeb19871fbe55511.html new file mode 100644 index 0000000..bd20dcf --- /dev/null +++ b/finwiseai/public/googlebeb19871fbe55511.html @@ -0,0 +1 @@ +google-site-verification: googlebeb19871fbe55511.html \ No newline at end of file From 336d6bd504ff32246b647b46e28918dd4d46f20e Mon Sep 17 00:00:00 2001 From: Vachhani Tapan Date: Sat, 18 Apr 2026 17:22:09 +0530 Subject: [PATCH 6/6] Revise README for improved clarity and presentation Updated README.md to enhance clarity and modernize the presentation of FinWise AI features and functionalities. --- README.md | 348 +++++++++++------------------------------------------- 1 file changed, 71 insertions(+), 277 deletions(-) diff --git a/README.md b/README.md index bdf8f82..10218f9 100644 --- a/README.md +++ b/README.md @@ -1,357 +1,151 @@ -# FinWise AI +# 💰 FinWise AI — AI-Powered Personal Finance Platform -**AI-Powered Personal Finance Platform for Indian Investors** +**FinWise AI** is a modern personal finance platform designed for Indian users to manage expenses, investments, goals, taxes, and debt in one unified system. -FinWise AI is an intelligent personal finance platform that helps users manage **expenses, investments, financial goals, taxes, and debt** in one place. It combines **financial analytics, automation workflows, and AI agents** to deliver personalized financial insights and recommendations. - -The platform is designed primarily for **young Indian professionals** who want a modern, automated way to track and optimize their finances. +It leverages **AI-driven insights, automation, and financial analytics** to help users make smarter financial decisions with minimal manual effort. --- -# Core Features +## 🚀 Key Features -### Expense Management +### 📊 Expense Management -* Track daily expenses manually or import bank statements -* AI-powered categorization of transactions -* Budget management by category -* 50/30/20 financial rule analyzer -* Monthly spending analytics and charts -* CSV/PDF transaction import +* Track daily expenses (manual + file import) +* AI-based transaction categorization +* Budget tracking (50/30/20 rule) +* Monthly analytics & visual insights -### Investment Tracking +### 📈 Investment Tracking #### Mutual Funds -* Add and manage MF holdings +* Portfolio management * Live NAV tracking -* Historical NAV charts -* Portfolio metrics (CAGR, gain/loss) -* AI-powered fund analysis +* Performance metrics (CAGR, gain/loss) #### Stocks -* Portfolio management -* Technical indicators (RSI, MACD, SMA) -* Risk-reward tracking -* Stop-loss and target monitoring -* AI-powered stock verdicts +* Portfolio tracking +* Technical indicators (RSI, SMA, MACD) +* Risk-reward analysis + +--- -### Financial Goals +### 🎯 Financial Goals -* Create and track goals -* Automatic progress tracking +* Create and manage financial goals +* Automated progress tracking * Goal feasibility analysis * SIP recommendations -* Milestone notifications -### Net Worth Tracking +--- + +### 🧮 Net Worth Dashboard -* Consolidated assets and liabilities -* Automatic net worth calculation -* Historical net worth trends -* Asset allocation visualization +* Track assets & liabilities +* Real-time net worth calculation +* Historical trends +* Asset allocation insights + +--- -### AI Financial Advisor +### 🤖 AI Financial Advisor -AI agents analyze your financial data and provide actionable insights: +AI-powered modules provide: -* Mutual fund analysis agent -* Stock verdict agent -* Expense optimization agent -* Goal planning agent -* Finance orchestrator chat assistant +* Investment analysis +* Expense optimization +* Goal planning insights +* Conversational finance assistant -### Smart Alerts +--- -Real-time alerts for: +### 🔔 Smart Alerts -* Stop-loss breaches -* Target price hits -* Budget overspending +* Budget overspending alerts +* Investment triggers (stop-loss / targets) * Goal milestones * SIP reminders -* Tax deadlines -### Tax Planning +--- + +### 🏦 Tax & Debt Tools -* 80C deduction tracker +#### Tax Planning + +* 80C tracking * Old vs New regime comparison -* HRA calculator * Capital gains summary -* Tax calendar reminders -### Debt Planner +#### Debt Planner * Loan tracking -* Snowball repayment strategy -* Avalanche repayment strategy -* Extra payment simulator - -### Fixed Deposit Optimizer +* Snowball & avalanche strategies +* Extra payment simulation -* Compare FD rates across banks -* Maturity calendar -* Tax-adjusted yield calculations +--- -### Monthly AI Financial Report +### 📄 Monthly AI Report -Users receive an AI-generated monthly report summarizing: +Automated report including: +* Spending behavior * Investment performance -* Expense behavior * Goal progress -* Personalized financial recommendations +* Personalized recommendations --- -# Tech Stack +## 🛠️ Tech Stack -## Frontend +### Frontend * React * TypeScript -* Vite * TailwindCSS -* Recharts / Chart.js -* TradingView Lightweight Charts - -## Backend +* Chart.js / Recharts -* FastAPI -* Python -* Pydantic -* Motor (MongoDB async driver) - -## Database +### Backend * MongoDB -## AI - -* Claude AI (Anthropic) -* AI Agents with MCP architecture +### Authentication -## Automation - -* N8N workflows - -## Infrastructure - -* Docker -* Redis (caching) -* AWS S3 (file storage) - -## Authentication - -* Supabase Auth -* JWT-based session management +* Firebase Auth --- -# Architecture Overview - -``` -Frontend (React + TypeScript) - | - | -Backend API (FastAPI) - | - | -MongoDB Database - | - | -AI Agents (Claude) - | - | -Automation Workflows (N8N) -``` ---- +## 🔒 Security Notes -# Project Structure - -``` -finwise-ai -│ -├── frontend -│ ├── src -│ │ ├── components -│ │ ├── pages -│ │ ├── hooks -│ │ ├── services -│ │ ├── store -│ │ └── utils -│ -├── backend -│ ├── app -│ │ ├── routers -│ │ ├── models -│ │ ├── schemas -│ │ ├── services -│ │ ├── core -│ │ └── utils -│ -├── mcp_server -│ -├── n8n -│ -├── docs -│ -└── docker-compose.yml -``` +* Sensitive data is handled securely +* Authentication via Supabase +* AI responses are informational only --- -# Development Roadmap - -The development is structured into **four phases**. - -## Phase 1 — MVP - -* Authentication system -* Expense tracking -* Dashboard analytics -* Mutual fund portfolio tracking -* Stock portfolio tracking -* Goal management -* Net worth dashboard +## ⚠️ Disclaimer -## Phase 2 — AI Core - -* AI investment analysis -* Expense analyzer -* Goal planning AI -* Bank statement PDF import -* Smart alert system -* Finance chat assistant - -## Phase 3 — Full Features - -* Tax planner -* Debt payoff planner -* Fixed deposit optimizer -* Personalized finance news -* Monthly AI financial reports - -## Phase 4 — Scale - -* WhatsApp finance bot -* Redis caching -* Performance optimization -* Admin dashboard -* Monitoring and analytics +FinWise AI is **not a registered financial advisor**. +All insights are AI-generated and intended for **educational purposes only**. --- -# Installation - -## Clone the Repository - -``` -git clone https://github.com/yourusername/finwise-ai.git -cd finwise-ai -``` - ---- +## 🤝 Contributing -## Run with Docker - -``` -docker-compose up --build -``` - -Services started: - -* Backend API -* MongoDB -* Redis -* N8N - ---- - -## Run Frontend - -``` -cd frontend -npm install -npm run dev -``` - ---- - -## Run Backend - -``` -cd backend -pip install -r requirements.txt -uvicorn app.main:app --reload -``` - ---- - -# Environment Variables - -Create `.env` files for backend and frontend. - -Example: - -Backend: - -``` -MONGODB_URI= -REDIS_URL= -SUPABASE_URL= -SUPABASE_KEY= -ANTHROPIC_API_KEY= -AWS_S3_BUCKET= -``` - -Frontend: - -``` -VITE_API_BASE_URL= -VITE_SUPABASE_URL= -VITE_SUPABASE_ANON_KEY= -``` - ---- - -# Security & Compliance - -* All AI outputs include a **financial advisory disclaimer** -* Sensitive financial data is **anonymized before AI processing** -* Secure authentication using **Supabase** -* Encrypted storage for uploaded financial documents - ---- - -# Disclaimer - -FinWise AI is a **financial information tool**, not a registered investment advisor. -All AI-generated insights are for **educational purposes only** and should not be considered financial advice. - ---- - -# Contributing - -Contributions are welcome. +Contributions are welcome! Steps: -1. Fork the repository +1. Fork the repo 2. Create a feature branch 3. Commit changes 4. Open a pull request --- -# License +## 🌟 Vision -This project is licensed under the **MIT License**. +To evolve into a **personal AI CFO** that automates and optimizes financial decision-making for individuals. --- - -# Future Vision - -FinWise AI aims to become an **AI-powered personal CFO for individuals**, helping users make better financial decisions through automation, data analysis, and intelligent recommendations.