Financial literacy is a critical life skill, yet it remains a significant challenge for many young adults in India. As they step into the world of earning, banking, and investing, they are often unprepared to navigate the complexities of personal finance. This knowledge gap can lead to detrimental outcomes such as accumulating debt, falling for financial scams, and missing out on the power of long-term wealth creation through investing. The lack of accessible, relatable, and trustworthy financial education creates a barrier to economic empowerment for an entire generation.
FinGen is a comprehensive, AI-powered financial literacy application designed to bridge this gap. Our mission is to empower young Indians (ages 18-25) with the knowledge and tools they need to make informed and confident financial decisions.
By leveraging the advanced capabilities of the Google Gemini API, FinGen provides personalized learning experiences, interactive tools, and on-demand guidance in a simple, mobile-first interface. We aim to transform financial education from a daunting chore into an engaging and empowering journey, fostering a generation of financially savvy individuals.
- 🤖 AI-Powered Learning Modules: Bite-sized, easy-to-understand content on core topics like Banking, Investing, Taxes, Credit, and Insurance, generated by AI to stay relevant and clear.
- 🧠 Interactive Quizzes: Reinforce learning and test your knowledge with dynamic quizzes generated for each topic.
- 🧮 Suite of Financial Calculators:
- SIP & Mutual Fund Calculators: Project the growth of your investments.
- Life & Health Insurance Calculators: Estimate your coverage needs.
- Credit Score Estimator: Understand the factors affecting your credit score and get AI-driven tips for improvement.
- 🚀 Scenario Simulator: Define a financial goal and let our AI create a personalized, step-by-step plan to achieve it.
- 🔥 Investment Streak Tracker: A gamified tool to help you build a consistent habit of monthly investing.
- 🎯 Investment Goals Planner: A visual, Kanban-style board to set, track, and manage your financial goals from "Yet to Start" to "Completed".
- 💬 FinGen AI Assistant: A 24/7 chatbot to answer any financial question you have, from "What is a Nifty 50 index fund?" to "How can I save on taxes?".
- 💡 Daily Financial Tips: Get a new, actionable financial tip every day to build healthy money habits.
Our primary audience is young adults in India, aged 18-25. This includes:
- College students opening their first bank accounts.
- Recent graduates starting their first jobs.
- Young professionals looking to begin their investment journey.
- Frontend: React, TypeScript
- Styling: Tailwind CSS
- AI/LLM: Google Gemini API (
gemini-2.5-flash)
Here’s a look at how we leverage the Google Gemini API to power FinGen's core features.
All educational content in the "Learn" section is generated dynamically by the AI. We send a carefully crafted prompt to the gemini-2.5-flash model, asking it to explain a specific topic in simple terms tailored to a young Indian audience.
File: services/geminiService.ts
import { GoogleGenAI } from "@google/genai";
const ai = new GoogleGenAI({ apiKey: process.env.API_KEY as string });
export const getFinancialTopicContent = async (prompt: string): Promise<string> => {
try {
const response = await ai.models.generateContent({
model: 'gemini-2.5-flash',
contents: prompt, // The detailed prompt for the topic
});
return response.text;
} catch (error) {
console.error("Error fetching financial content:", error);
throw new Error("Failed to load content from AI. Please try again.");
}
};For the quizzes, we need a consistent data structure. We instruct the Gemini API to return its response in JSON format by defining a responseSchema. This ensures we always get an array of question objects that our frontend can easily parse and render, eliminating the need for complex string manipulation.
File: services/geminiService.ts
import { GoogleGenAI, Type } from "@google/genai";
import type { QuizQuestion } from '../types';
export const generateQuizQuestions = async (topicTitle: string): Promise<QuizQuestion[]> => {
try {
const prompt = `Generate 5 multiple-choice quiz questions about "${topicTitle}" for a beginner in India...`;
const response = await ai.models.generateContent({
model: "gemini-2.5-flash",
contents: prompt,
config: {
responseMimeType: "application/json",
responseSchema: { // We define the exact JSON structure we want
type: Type.OBJECT,
properties: {
questions: {
type: Type.ARRAY,
items: {
type: Type.OBJECT,
properties: {
question: { type: Type.STRING },
options: { type: Type.ARRAY, items: { type: Type.STRING } },
correctAnswerIndex: { type: Type.INTEGER }
},
}
}
},
}
},
});
const data = JSON.parse(response.text.trim());
return data.questions;
} catch (error) {
console.error("Error generating quiz questions:", error);
throw new Error("Failed to generate quiz. Please try again.");
}
};The FinGen AI Assistant uses the ai.chats.create method to establish a persistent conversation. We provide a systemInstruction to define the AI's persona and purpose. Each subsequent message from the user is sent via chat.sendMessage, allowing the AI to maintain the context of the conversation.
File: components/Chatbot.tsx
import { GoogleGenAI } from "@google/genai";
import type { Chat } from "@google/genai";
// Initialization in useEffect
useEffect(() => {
const initChat = () => {
const chatInstance = ai.chats.create({
model: 'gemini-2.5-flash',
config: {
systemInstruction: 'You are FinGen AI, a friendly and helpful financial assistant for young adults in India...',
},
});
setChat(chatInstance);
// ...
};
initChat();
}, []);
// Sending a message
const handleSendMessage = async (e: React.FormEvent) => {
// ...
try {
// 'chat.sendMessage' maintains conversation history
const response = await chat.sendMessage({ message: userInput });
const aiMessage: Message = { sender: 'ai', text: response.text };
setMessages(prev => [...prev, aiMessage]);
} catch (err) {
// ...
}
};The calculators work by taking user inputs, embedding them into a detailed prompt, and asking the AI for a personalized analysis. This transforms a standard form into an interactive advisory tool.
File: services/geminiService.ts
export const calculateCreditScore = async (paymentHistory: string, creditUtilization: string, /* ...other params */): Promise<string> => {
try {
// User inputs are dynamically inserted into the prompt
const prompt = `An 18-25 year old in India wants to understand their credit score. Here are their details:
- On-time Payment History: ${paymentHistory}
- Credit Utilization: ${creditUtilization}% of available credit is used.
...
Based on these factors... provide an estimated credit score range... and actionable tips.`;
const response = await ai.models.generateContent({
model: 'gemini-2.5-flash',
contents: prompt,
});
return response.text;
} catch (error) {
console.error("Error calculating credit score:", error);
throw new Error("Failed to get credit score analysis. Please try again.");
}
};To run FinGen locally, please follow these steps:
1. Prerequisites:
- You must have Node.js (v18 or later) installed.
- You need a package manager like
npmoryarn.
2. Clone the Repository:
git clone https://github.com/your-username/fingen-app.git
cd fingen-app3. Install Dependencies:
npm install4. Set Up Environment Variables: The application requires a Google Gemini API key to function.
- Create a file named
.envin the root directory of the project. - Add your API key to this file as follows:
API_KEY=YOUR_GEMINI_API_KEY - Replace
YOUR_GEMINI_API_KEYwith your actual key obtained from Google AI Studio.
5. Run the Development Server:
npm run devThe application should now be running and accessible in your web browser, typically at http://localhost:5173.
This project is licensed under the MIT License. See the LICENSE file for more details.