commit 657b6ecd754730deba6704ba0c16042041c5572d Author: Flatlogic Bot Date: Sat Mar 7 06:53:12 2026 +0000 Initial import diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..7a550fe --- /dev/null +++ b/.env.example @@ -0,0 +1,9 @@ +# GEMINI_API_KEY: Required for Gemini AI API calls. +# AI Studio automatically injects this at runtime from user secrets. +# Users configure this via the Secrets panel in the AI Studio UI. +GEMINI_API_KEY="MY_GEMINI_API_KEY" + +# APP_URL: The URL where this applet is hosted. +# AI Studio automatically injects this at runtime with the Cloud Run service URL. +# Used for self-referential links, OAuth callbacks, and API endpoints. +APP_URL="MY_APP_URL" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5a86d2a --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +node_modules/ +build/ +dist/ +coverage/ +.DS_Store +*.log +.env* +!.env.example diff --git a/README.md b/README.md new file mode 100644 index 0000000..ea8689a --- /dev/null +++ b/README.md @@ -0,0 +1,20 @@ +
+GHBanner +
+ +# Run and deploy your AI Studio app + +This contains everything you need to run your app locally. + +View your app in AI Studio: https://ai.studio/apps/aa0a996b-c612-43f6-a22a-d2d9e6b595df + +## Run Locally + +**Prerequisites:** Node.js + + +1. Install dependencies: + `npm install` +2. Set the `GEMINI_API_KEY` in [.env.local](.env.local) to your Gemini API key +3. Run the app: + `npm run dev` diff --git a/index.html b/index.html new file mode 100644 index 0000000..21dfe69 --- /dev/null +++ b/index.html @@ -0,0 +1,13 @@ + + + + + + My Google AI Studio App + + +
+ + + + diff --git a/metadata.json b/metadata.json new file mode 100644 index 0000000..4a7b7de --- /dev/null +++ b/metadata.json @@ -0,0 +1,5 @@ +{ + "name": "Generali Central Life Insurance Portal", + "description": "A comprehensive portal for exploring life insurance plans, understanding benefits, and generating custom benefit illustrations.", + "requestFramePermissions": [] +} diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..e69de29 diff --git a/package.json b/package.json new file mode 100644 index 0000000..3c7b140 --- /dev/null +++ b/package.json @@ -0,0 +1,35 @@ +{ + "name": "react-example", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite --port=3000 --host=0.0.0.0", + "build": "vite build", + "preview": "vite preview", + "clean": "rm -rf dist", + "lint": "tsc --noEmit" + }, + "dependencies": { + "@google/genai": "^1.29.0", + "@tailwindcss/vite": "^4.1.14", + "@vitejs/plugin-react": "^5.0.4", + "lucide-react": "^0.546.0", + "react": "^19.0.0", + "react-dom": "^19.0.0", + "vite": "^6.2.0", + "express": "^4.21.2", + "dotenv": "^17.2.3", + "better-sqlite3": "^12.4.1", + "motion": "^12.23.24" + }, + "devDependencies": { + "@types/node": "^22.14.0", + "autoprefixer": "^10.4.21", + "tailwindcss": "^4.1.14", + "tsx": "^4.21.0", + "typescript": "~5.8.2", + "vite": "^6.2.0", + "@types/express": "^4.17.21" + } +} diff --git a/src/App.tsx b/src/App.tsx new file mode 100644 index 0000000..cd29a30 --- /dev/null +++ b/src/App.tsx @@ -0,0 +1,623 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ + +import React, { useState, useMemo } from 'react'; +import { + ShieldCheck, + TrendingUp, + Clock, + HeartPulse, + ChevronRight, + Info, + Calculator, + ArrowRight, + CheckCircle2, + FileText, + User, + Mail, + Phone, + Calendar +} from 'lucide-react'; +import { motion, AnimatePresence } from 'motion/react'; + +// --- Types --- + +type PlanType = 'money-back' | 'long-term-income'; + +interface QuoteData { + name: string; + age: number; + gender: 'male' | 'female'; + planType: PlanType; + sumAssured: number; + policyTerm: number; + premiumTerm: number; +} + +// --- Components --- + +const Navbar = () => ( + +); + +const Hero = () => ( +
+
+
+ + + Secure Your Future + +

+ Protection that
+ Grows with You. +

+

+ Explore our range of Individual, Non-Linked, Non-Participating Savings Life Insurance Plans designed to provide both security and guaranteed returns. +

+ +
+ +
+ Family Security +
+
+
+
+ +
+ Guaranteed Returns +
+

Fixed payouts and maturity benefits to ensure your financial goals are met.

+
+
+
+
+
+); + +const PlanExplanation = () => ( +
+
+
+

Understanding Your Policy

+

Insurance can be complex. We break down the key terms from your benefit illustration so you can make an informed choice.

+
+ +
+ {[ + { + title: "Sum Assured", + desc: "The fixed amount guaranteed to be paid to the nominee in case of the life assured's death during the policy term.", + icon: ShieldCheck, + color: "bg-blue-50 text-blue-600" + }, + { + title: "Annualized Premium", + desc: "The premium amount payable in a year, excluding taxes, rider premiums, and underwriting extra premiums.", + icon: Clock, + color: "bg-purple-50 text-purple-600" + }, + { + title: "Guaranteed Additions", + desc: "Additional amounts added to your policy benefits, typically accruing after a certain number of policy years.", + icon: TrendingUp, + color: "bg-emerald-50 text-emerald-600" + }, + { + title: "Survival Benefit", + desc: "Periodic payouts made to you during the policy term if the life assured survives to specified dates.", + icon: HeartPulse, + color: "bg-red-50 text-red-600" + }, + { + title: "GSV vs SSV", + desc: "GSV (Guaranteed Surrender Value) is the minimum guaranteed amount if you cancel. SSV (Special Surrender Value) is often higher but not guaranteed.", + icon: Info, + color: "bg-amber-50 text-amber-600" + }, + { + title: "Rider Benefits", + desc: "Optional add-ons like 'Accidental Death Benefit' that provide extra protection for a small additional premium.", + icon: CheckCircle2, + color: "bg-zinc-50 text-zinc-600" + } + ].map((item, idx) => ( + +
+ +
+

{item.title}

+

{item.desc}

+
+ ))} +
+
+
+); + +const QuoteForm = () => { + const [formData, setFormData] = useState({ + name: '', + age: 30, + gender: 'male', + planType: 'money-back', + sumAssured: 1000000, + policyTerm: 20, + premiumTerm: 20 + }); + + const [isCalculated, setIsCalculated] = useState(false); + + const handleSubmit = (e: React.FormEvent) => { + e.preventDefault(); + setIsCalculated(true); + }; + + const illustration = useMemo(() => { + if (!isCalculated) return null; + + // Simplified logic based on PDF data + const annualPremium = formData.sumAssured * 0.1; // Roughly 10% for 10L sum assured + const years = Array.from({ length: formData.policyTerm }, (_, i) => i + 1); + + return years.map(year => { + const isPayoutYear = formData.planType === 'money-back' && year % 5 === 0 && year < formData.policyTerm; + const survivalBenefit = isPayoutYear ? formData.sumAssured * 0.11 : 0; + const guaranteedAddition = year >= 8 ? annualPremium * 0.838 : 0; + const deathBenefit = formData.sumAssured + (year >= 8 ? guaranteedAddition * (year - 7) : 0); + + return { + year, + premium: annualPremium, + survivalBenefit, + guaranteedAddition, + deathBenefit, + surrenderValue: annualPremium * year * (year / formData.policyTerm) * 0.6 // Mock curve + }; + }); + }, [isCalculated, formData]); + + return ( +
+
+
+ + {/* Form Side */} +
+
+
+
+ +
+

Illustration Builder

+
+ +
+
+ + setFormData({...formData, name: e.target.value})} + /> +
+ +
+
+ + setFormData({...formData, age: parseInt(e.target.value)})} + /> +
+
+ + +
+
+ +
+ +
+ + +
+
+ +
+ + setFormData({...formData, sumAssured: parseInt(e.target.value)})} + /> +
+ ₹5L + ₹{(formData.sumAssured / 100000).toFixed(1)}L + ₹50L +
+
+ + +
+
+
+ + {/* Results Side */} +
+ + {!isCalculated ? ( + +
+ +
+

Ready to See Your Benefits?

+

Fill out the form to generate a detailed year-by-year benefit illustration.

+
+ ) : ( + +
+
+
+

Illustration Summary

+
{formData.name || 'Valued Customer'}
+
+
+
Plan Type
+
{formData.planType === 'money-back' ? 'Money Back Super' : 'Long Term Income'}
+
+
+ +
+
+
Sum Assured
+
₹{(formData.sumAssured / 100000).toFixed(1)}L
+
+
+
Annual Premium
+
₹{(formData.sumAssured * 0.1 / 1000).toFixed(0)}K
+
+
+
Policy Term
+
{formData.policyTerm} Yrs
+
+
+
+ +
+
+

Yearly Benefit Projection

+ Guaranteed Values +
+
+ + + + + + + + + + + + {illustration?.slice(0, 10).map((row) => ( + + + + + + + + ))} + +
YearPremiumSurvival BenefitDeath BenefitSurrender Value
{row.year}₹{row.premium.toLocaleString()} + {row.survivalBenefit > 0 ? ( + ₹{row.survivalBenefit.toLocaleString()} + ) : ( + + )} + ₹{row.deathBenefit.toLocaleString()}₹{row.surrenderValue.toLocaleString(undefined, { maximumFractionDigits: 0 })}
+
+
+ +
+
+
+ )} +
+
+
+
+
+ ); +}; + +const Footer = () => ( +
+
+
+
+
+
+ +
+ Generali Central +
+

+ Generali Central Life Insurance Company Limited (Formerly known as Future Generali India Life Insurance Company Limited). + Registered Office: Unit 801 and 802, 8th floor, Tower C, Embassy 247 Park, L.B.S. Marg, Vikhroli (W), Mumbai – 400083. +

+
+ +
+

Contact

+
    +
  • care@generalicentral.com
  • +
  • 1800 102 2355
  • +
+
+
+
+

© 2026 Generali Central Life Insurance Company Limited. IRDAI Regn. No.: 133 | CIN: U66010MH2006PLC165288

+

Insurance is the subject matter of solicitation. For more details on risk factors, terms and conditions, please read sales brochure carefully before concluding a sale.

+
+
+
+); + +export default function App() { + return ( +
+ +
+ + + {/* Quick Stats */} +
+
+ {[ + { label: "Claims Ratio", value: "98.4%", icon: ShieldCheck }, + { label: "Happy Families", value: "2.5M+", icon: User }, + { label: "Solvency Ratio", value: "1.92", icon: TrendingUp }, + { label: "Support", value: "24/7", icon: Phone }, + ].map((stat, i) => ( +
+ +
{stat.value}
+
{stat.label}
+
+ ))} +
+
+ + + + {/* Plan Comparison Section */} +
+
+
+
+

Choose Your Shield

+

Whether you need periodic payouts or a long-term income stream, we have the right plan for your life's milestones.

+
+
+
01
+
02
+
+
+ +
+
+
+ +
+ Best for Milestones +

Money Back Super Plan

+
    +
  • Guaranteed Survival Benefits every 5 years
  • +
  • Accrued Guaranteed Additions
  • +
  • Life cover for the entire policy term
  • +
+ {/**/} +
+ +
+
+ +
+ Best for Retirement +

Long Term Income Plan

+
    +
  • Regular income for up to 50 years
  • +
  • Immediate or Deferred income options
  • +
  • Maturity benefit equal to Sum Assured
  • +
+ {/**/} +
+
+
+
+ +
+
+
+
+

Talk to an Expert

+

+ Our certified financial advisors are ready to help you customize a plan that perfectly fits your family's needs and budget. +

+
+
+
+ +
+
+
Call Us
+
1800 102 2355
+
+
+
+
+ +
+
+
Email Us
+
care@generalicentral.com
+
+
+
+
+
+
+
+
+ + +
+
+ + +
+
+
+ + +
+
+ + +
+
+ + +
+ +
+
+
+
+
+ {/* */} + + {/* Trust Section */} + {/*
+
+

Trusted by Industry Leaders

+
+
GENERALI
+
FUTURE GROUP
+
CENTRAL BANK
+
IRDAI
+
+
+
*/} +
+
+
+ ); +} diff --git a/src/index.css b/src/index.css new file mode 100644 index 0000000..f1d8c73 --- /dev/null +++ b/src/index.css @@ -0,0 +1 @@ +@import "tailwindcss"; diff --git a/src/main.tsx b/src/main.tsx new file mode 100644 index 0000000..080dac3 --- /dev/null +++ b/src/main.tsx @@ -0,0 +1,10 @@ +import {StrictMode} from 'react'; +import {createRoot} from 'react-dom/client'; +import App from './App.tsx'; +import './index.css'; + +createRoot(document.getElementById('root')!).render( + + + , +); diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..d88f175 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "target": "ES2022", + "experimentalDecorators": true, + "useDefineForClassFields": false, + "module": "ESNext", + "lib": [ + "ES2022", + "DOM", + "DOM.Iterable" + ], + "skipLibCheck": true, + "moduleResolution": "bundler", + "isolatedModules": true, + "moduleDetection": "force", + "allowJs": true, + "jsx": "react-jsx", + "paths": { + "@/*": [ + "./*" + ] + }, + "allowImportingTsExtensions": true, + "noEmit": true + } +} diff --git a/vite.config.ts b/vite.config.ts new file mode 100644 index 0000000..0506f1b --- /dev/null +++ b/vite.config.ts @@ -0,0 +1,24 @@ +import tailwindcss from '@tailwindcss/vite'; +import react from '@vitejs/plugin-react'; +import path from 'path'; +import {defineConfig, loadEnv} from 'vite'; + +export default defineConfig(({mode}) => { + const env = loadEnv(mode, '.', ''); + return { + plugins: [react(), tailwindcss()], + define: { + 'process.env.GEMINI_API_KEY': JSON.stringify(env.GEMINI_API_KEY), + }, + resolve: { + alias: { + '@': path.resolve(__dirname, '.'), + }, + }, + server: { + // HMR is disabled in AI Studio via DISABLE_HMR env var. + // Do not modify—file watching is disabled to prevent flickering during agent edits. + hmr: process.env.DISABLE_HMR !== 'true', + }, + }; +});