Spaces:
Running
Running
Update index.html
Browse files- index.html +108 -147
index.html
CHANGED
|
@@ -1,156 +1,117 @@
|
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="en">
|
| 3 |
-
<head>
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
<!-- TailwindCSS -->
|
| 9 |
-
<script src="https://cdn.tailwindcss.com"></script>
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
|
|
|
| 15 |
|
| 16 |
-
<!-- Plaid Link -->
|
| 17 |
-
<script src="https://cdn.plaid.com/link/v2/stable/link-initialize.js"></script>
|
| 18 |
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
}
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
<
|
| 32 |
-
body { margin: 0; font-family: system-ui, sans-serif; background-color: #111827; color: #f9fafb; }
|
| 33 |
-
#root { display: flex; justify-content: center; align-items: flex-start; padding: 2rem; min-height: 100vh; }
|
| 34 |
-
.card { background: #1f2937; padding: 1.5rem; border-radius: 0.5rem; box-shadow: 0 2px 10px rgba(0,0,0,0.5); width: 100%; max-width: 600px; }
|
| 35 |
-
button { background-color: #3b82f6; color: white; padding: 0.5rem 1rem; border-radius: 0.375rem; cursor: pointer; border: none; margin-top: 0.5rem; }
|
| 36 |
-
button:hover { background-color: #2563eb; }
|
| 37 |
-
table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
|
| 38 |
-
th, td { border: 1px solid #374151; padding: 0.5rem; text-align: left; }
|
| 39 |
-
th { background-color: #111827; }
|
| 40 |
-
</style>
|
| 41 |
</head>
|
| 42 |
-
<body>
|
| 43 |
-
<div id="root"></div>
|
| 44 |
-
|
| 45 |
-
<script type="module">
|
| 46 |
-
import React from 'react';
|
| 47 |
-
import ReactDOM from 'react-dom/client';
|
| 48 |
-
import { Auth0Provider, useAuth0 } from "@auth0/auth0-react";
|
| 49 |
-
import { LineChart, Line, XAxis, YAxis, Tooltip, CartesianGrid } from 'recharts';
|
| 50 |
-
|
| 51 |
-
// Failsafe fetch for transactions
|
| 52 |
-
async function fetchTransactions(token) {
|
| 53 |
-
try {
|
| 54 |
-
const res = await fetch('https://ce47fe80-dabc-4ad0-b0e7-cf285695b8b8.mock.pstmn.io/transactions', {
|
| 55 |
-
headers: { Authorization: `Bearer ${token}` }
|
| 56 |
-
});
|
| 57 |
-
if (!res.ok) throw new Error('Fetch failed');
|
| 58 |
-
return await res.json();
|
| 59 |
-
} catch (e) {
|
| 60 |
-
// fallback transactions
|
| 61 |
-
return {
|
| 62 |
-
data: [
|
| 63 |
-
{ id: 'txn_001', amount: 125.5, description: 'Fallback Coffee', status: 'posted', date: '2025-12-01' },
|
| 64 |
-
{ id: 'txn_002', amount: 2200, description: 'Fallback Payroll', status: 'pending', date: '2025-12-03' }
|
| 65 |
-
]
|
| 66 |
-
};
|
| 67 |
-
}
|
| 68 |
-
}
|
| 69 |
-
|
| 70 |
-
function TransactionsTable({ transactions }) {
|
| 71 |
-
return (
|
| 72 |
-
<table>
|
| 73 |
-
<thead>
|
| 74 |
-
<tr>
|
| 75 |
-
<th>ID</th>
|
| 76 |
-
<th>Description</th>
|
| 77 |
-
<th>Amount</th>
|
| 78 |
-
<th>Status</th>
|
| 79 |
-
<th>Date</th>
|
| 80 |
-
</tr>
|
| 81 |
-
</thead>
|
| 82 |
-
<tbody>
|
| 83 |
-
{transactions.map(txn => (
|
| 84 |
-
<tr key={txn.id}>
|
| 85 |
-
<td>{txn.id}</td>
|
| 86 |
-
<td>{txn.description}</td>
|
| 87 |
-
<td>${txn.amount}</td>
|
| 88 |
-
<td>{txn.status}</td>
|
| 89 |
-
<td>{txn.date || '-'}</td>
|
| 90 |
-
</tr>
|
| 91 |
-
))}
|
| 92 |
-
</tbody>
|
| 93 |
-
</table>
|
| 94 |
-
);
|
| 95 |
-
}
|
| 96 |
-
|
| 97 |
-
function TransactionsChart({ transactions }) {
|
| 98 |
-
const chartData = transactions.map(txn => ({ date: txn.date || txn.id, amount: txn.amount }));
|
| 99 |
-
return (
|
| 100 |
-
<LineChart width={550} height={250} data={chartData} margin={{ top: 5, right: 20, bottom: 5, left: 0 }}>
|
| 101 |
-
<XAxis dataKey="date" stroke="#f9fafb" />
|
| 102 |
-
<YAxis stroke="#f9fafb" />
|
| 103 |
-
<Tooltip />
|
| 104 |
-
<CartesianGrid stroke="#374151" strokeDasharray="5 5" />
|
| 105 |
-
<Line type="monotone" dataKey="amount" stroke="#3b82f6" />
|
| 106 |
-
</LineChart>
|
| 107 |
-
);
|
| 108 |
-
}
|
| 109 |
-
|
| 110 |
-
function App() {
|
| 111 |
-
const { loginWithRedirect, logout, isAuthenticated, getAccessTokenSilently } = useAuth0();
|
| 112 |
-
const [transactions, setTransactions] = React.useState([]);
|
| 113 |
-
|
| 114 |
-
React.useEffect(() => {
|
| 115 |
-
if (isAuthenticated) {
|
| 116 |
-
getAccessTokenSilently()
|
| 117 |
-
.then(token => fetchTransactions(token))
|
| 118 |
-
.then(data => setTransactions(data.data || []));
|
| 119 |
-
}
|
| 120 |
-
}, [isAuthenticated]);
|
| 121 |
-
|
| 122 |
-
return (
|
| 123 |
-
<div className="card">
|
| 124 |
-
<h1 className="text-2xl mb-4">Sovereign AI Banking Nexus</h1>
|
| 125 |
-
|
| 126 |
-
{!isAuthenticated ? (
|
| 127 |
-
<button onClick={() => loginWithRedirect()}>Login</button>
|
| 128 |
-
) : (
|
| 129 |
-
<>
|
| 130 |
-
<button onClick={() => logout({ returnTo: window.location.origin })}>Logout</button>
|
| 131 |
-
<h2 className="text-xl mt-4 mb-2">Transactions:</h2>
|
| 132 |
-
<TransactionsTable transactions={transactions} />
|
| 133 |
-
<h2 className="text-xl mt-4 mb-2">Transaction Chart:</h2>
|
| 134 |
-
<TransactionsChart transactions={transactions} />
|
| 135 |
-
<button onClick={() => alert('Plaid Link would open here')}>Connect Bank (Plaid)</button>
|
| 136 |
-
</>
|
| 137 |
-
)}
|
| 138 |
-
</div>
|
| 139 |
-
);
|
| 140 |
-
}
|
| 141 |
-
|
| 142 |
-
const domain = "citibankdemobusinessinc.us.auth0.com";
|
| 143 |
-
const clientId = "rsBLCcuq5MVA9Dj84NEVdDqpOFePLsjI";
|
| 144 |
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
clientId={clientId}
|
| 149 |
-
authorizationParams={{ redirect_uri: window.location.origin }}
|
| 150 |
-
>
|
| 151 |
-
<App />
|
| 152 |
-
</Auth0Provider>
|
| 153 |
-
);
|
| 154 |
-
</script>
|
| 155 |
-
</body>
|
| 156 |
</html>
|
|
|
|
| 1 |
+
|
| 2 |
<!DOCTYPE html>
|
| 3 |
<html lang="en">
|
| 4 |
+
<head><script>window.huggingface={variables:{"SPACE_CREATOR_USER_ID":"65c52be73cf0b5c5f3619b56"}};</script>
|
| 5 |
+
<meta charset="UTF-8" />
|
| 6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 7 |
+
<title>Sovereign AI Banking Nexus</title>
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 10 |
+
<script src="https://cdn.plaid.com/link/v2/stable/link-initialize.js"></script>
|
| 11 |
+
<link
|
| 12 |
+
rel="stylesheet"
|
| 13 |
+
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"/>
|
| 14 |
|
|
|
|
|
|
|
| 15 |
|
| 16 |
+
<link rel="stylesheet" href="/index.css">
|
| 17 |
+
<script type="importmap">
|
| 18 |
+
{
|
| 19 |
+
"imports": {
|
| 20 |
+
"react": "https://aistudiocdn.com/react@^19.1.1",
|
| 21 |
+
"modern-treasury": "https://aistudiocdn.com/modern-treasury@^3.3.0",
|
| 22 |
+
"react-dom/": "https://aistudiocdn.com/react-dom@^19.1.1/",
|
| 23 |
+
"react/": "https://aistudiocdn.com/react@^19.1.1/",
|
| 24 |
+
"recharts": "https://aistudiocdn.com/recharts@^3.2.0",
|
| 25 |
+
"@google/genai": "https://aistudiocdn.com/@google/genai@^1.19.0",
|
| 26 |
+
"express-openid-connect": "https://aistudiocdn.com/express-openid-connect@2.18.3",
|
| 27 |
+
"recharts/": "https://aistudiocdn.com/recharts@^3.3.0/",
|
| 28 |
+
"chart.js": "https://aistudiocdn.com/chart.js@^4.5.1",
|
| 29 |
+
"react-chartjs-2": "https://aistudiocdn.com/react-chartjs-2@^5.3.1",
|
| 30 |
+
"@tanstack/react-query": "https://aistudiocdn.com/@tanstack/react-query@^5.90.10",
|
| 31 |
+
"uuid": "https://aistudiocdn.com/uuid@^13.0.0",
|
| 32 |
+
"react-icons/": "https://aistudiocdn.com/react-icons@^5.5.0/",
|
| 33 |
+
"vite": "https://aistudiocdn.com/vite@^7.2.4",
|
| 34 |
+
"lucide-react": "https://aistudiocdn.com/lucide-react@^0.555.0",
|
| 35 |
+
"path": "https://aistudiocdn.com/path@^0.12.7",
|
| 36 |
+
"plaid": "https://aistudiocdn.com/plaid@^20.0.0",
|
| 37 |
+
"@vitejs/plugin-react": "https://aistudiocdn.com/@vitejs/plugin-react@^5.1.1",
|
| 38 |
+
"@mui/x-data-grid": "https://aistudiocdn.com/@mui/x-data-grid@^8.20.0",
|
| 39 |
+
"@mui/material": "https://aistudiocdn.com/@mui/material@^7.3.6",
|
| 40 |
+
"@google/generative-ai": "https://aistudiocdn.com/@google/generative-ai@^0.24.1",
|
| 41 |
+
"react-router-dom": "https://aistudiocdn.com/react-router-dom@^7.10.0",
|
| 42 |
+
"@mui/material/": "https://aistudiocdn.com/@mui/material@^7.3.6/",
|
| 43 |
+
"@chakra-ui/react": "https://aistudiocdn.com/@chakra-ui/react@^3.30.0",
|
| 44 |
+
"@chakra-ui/icons": "https://aistudiocdn.com/@chakra-ui/icons@^2.2.4",
|
| 45 |
+
"class-variance-authority": "https://aistudiocdn.com/class-variance-authority@^0.7.1",
|
| 46 |
+
"@hello-pangea/dnd": "https://aistudiocdn.com/@hello-pangea/dnd@18.0.1",
|
| 47 |
+
"tailwind-merge": "https://aistudiocdn.com/tailwind-merge@^3.4.0",
|
| 48 |
+
"clsx": "https://aistudiocdn.com/clsx@^2.1.1",
|
| 49 |
+
"@nestjs/common": "https://aistudiocdn.com/@nestjs/common@^11.1.9",
|
| 50 |
+
"xml2js": "https://aistudiocdn.com/xml2js@^0.6.2",
|
| 51 |
+
"axios": "https://aistudiocdn.com/axios@^1.13.2",
|
| 52 |
+
"@mui/icons-material": "https://aistudiocdn.com/@mui/icons-material@^7.3.6",
|
| 53 |
+
"primereact/": "https://aistudiocdn.com/primereact@^10.9.7/",
|
| 54 |
+
"zustand": "https://aistudiocdn.com/zustand@^5.0.9",
|
| 55 |
+
"@mui/icons-material/": "https://aistudiocdn.com/@mui/icons-material@^7.3.6/",
|
| 56 |
+
"react-hook-form": "https://aistudiocdn.com/react-hook-form@^7.67.0",
|
| 57 |
+
"inversify": "https://aistudiocdn.com/inversify@^7.10.5",
|
| 58 |
+
"react-bootstrap": "https://aistudiocdn.com/react-bootstrap@^2.10.10",
|
| 59 |
+
"@tanstack/react-table": "https://aistudiocdn.com/@tanstack/react-table@^8.21.3",
|
| 60 |
+
"@stripe/stripe-js": "https://aistudiocdn.com/@stripe/stripe-js@^8.5.3",
|
| 61 |
+
"zustand/": "https://aistudiocdn.com/zustand@^5.0.9/",
|
| 62 |
+
"dotenv": "https://aistudiocdn.com/dotenv@^17.2.3",
|
| 63 |
+
"zod": "https://aistudiocdn.com/zod@^4.1.13",
|
| 64 |
+
"fs": "https://aistudiocdn.com/fs@^0.0.1-security",
|
| 65 |
+
"framer-motion": "https://aistudiocdn.com/framer-motion@^12.23.25",
|
| 66 |
+
"notistack": "https://aistudiocdn.com/notistack@^3.0.2",
|
| 67 |
+
"date-fns": "https://aistudiocdn.com/date-fns@^4.1.0",
|
| 68 |
+
"fast-xml-parser": "https://aistudiocdn.com/fast-xml-parser@^5.3.2",
|
| 69 |
+
"react-plaid-link": "https://aistudiocdn.com/react-plaid-link@^4.1.1",
|
| 70 |
+
"js-yaml": "https://aistudiocdn.com/js-yaml@^4.1.1",
|
| 71 |
+
"styled-components": "https://aistudiocdn.com/styled-components@^6.1.19",
|
| 72 |
+
"antd": "https://aistudiocdn.com/antd@^6.0.1",
|
| 73 |
+
"@ant-design/icons": "https://aistudiocdn.com/@ant-design/icons@^6.1.0",
|
| 74 |
+
"@radix-ui/react-progress": "https://aistudiocdn.com/@radix-ui/react-progress@^1.1.8",
|
| 75 |
+
"cmdk": "https://aistudiocdn.com/cmdk@^1.1.1",
|
| 76 |
+
"@radix-ui/react-separator": "https://aistudiocdn.com/@radix-ui/react-separator@^1.1.8",
|
| 77 |
+
"@radix-ui/react-label": "https://aistudiocdn.com/@radix-ui/react-label@^2.1.8",
|
| 78 |
+
"jspdf-autotable": "https://aistudiocdn.com/jspdf-autotable@^5.0.2",
|
| 79 |
+
"jspdf": "https://aistudiocdn.com/jspdf@^3.0.4",
|
| 80 |
+
"@heroicons/react/": "https://aistudiocdn.com/@heroicons/react@^2.2.0/",
|
| 81 |
+
"express": "https://aistudiocdn.com/express@^5.2.1",
|
| 82 |
+
"url": "https://aistudiocdn.com/url@^0.11.4",
|
| 83 |
+
"reactflow/": "https://aistudiocdn.com/reactflow@^11.11.4/",
|
| 84 |
+
"reactflow": "https://aistudiocdn.com/reactflow@^11.11.4",
|
| 85 |
+
"@hookform/resolvers/": "https://aistudiocdn.com/@hookform/resolvers@^5.2.2/",
|
| 86 |
+
"sonner": "https://aistudiocdn.com/sonner@^2.0.7",
|
| 87 |
+
"@radix-ui/react-select": "https://aistudiocdn.com/@radix-ui/react-select@^2.2.6",
|
| 88 |
+
"@radix-ui/react-slot": "https://aistudiocdn.com/@radix-ui/react-slot@^1.2.4",
|
| 89 |
+
"@radix-ui/react-dialog": "https://aistudiocdn.com/@radix-ui/react-dialog@^1.1.15",
|
| 90 |
+
"stripe": "https://aistudiocdn.com/stripe@^20.0.0",
|
| 91 |
+
"antd/": "https://aistudiocdn.com/antd@^6.0.1/",
|
| 92 |
+
"react-dropzone": "https://aistudiocdn.com/react-dropzone@^14.3.8",
|
| 93 |
+
"react-circular-progressbar/": "https://aistudiocdn.com/react-circular-progressbar@^2.2.0/",
|
| 94 |
+
"react-circular-progressbar": "https://aistudiocdn.com/react-circular-progressbar@^2.2.0",
|
| 95 |
+
"chartjs-adapter-date-fns": "https://aistudiocdn.com/chartjs-adapter-date-fns@^3.0.0",
|
| 96 |
+
"react-select": "https://aistudiocdn.com/react-select@^5.10.2",
|
| 97 |
+
"@rjsf/core": "https://aistudiocdn.com/@rjsf/core@^6.1.2",
|
| 98 |
+
"@stripe/react-stripe-js": "https://aistudiocdn.com/@stripe/react-stripe-js@^5.4.1",
|
| 99 |
+
"json-schema": "https://aistudiocdn.com/json-schema@^0.4.0",
|
| 100 |
+
"@radix-ui/react-popover": "https://aistudiocdn.com/@radix-ui/react-popover@^1.1.15",
|
| 101 |
+
"@rjsf/validator-ajv8": "https://aistudiocdn.com/@rjsf/validator-ajv8@^6.1.2",
|
| 102 |
+
"react-simple-maps": "https://esm.sh/react-simple-maps@^3.0.0",
|
| 103 |
+
"react-router": "https://esm.sh/react-router@^7.10.1",
|
| 104 |
+
"react-leaflet": "https://esm.sh/react-leaflet@^5.0.0",
|
| 105 |
+
"leaflet": "https://esm.sh/leaflet@^1.9.4",
|
| 106 |
+
"@auth0/auth0-react": "https://aistudiocdn.com/@auth0/auth0-react@^2.2.4",
|
| 107 |
+
"express-oauth2-jwt-bearer": "https://aistudiocdn.com/express-oauth2-jwt-bearer@^1.6.0"
|
| 108 |
}
|
| 109 |
+
}
|
| 110 |
+
</script>
|
| 111 |
+
<script type="module" crossorigin src="./assets/index-BoHSF06O.js"></script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
</head>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
|
| 114 |
+
<body class="bg-gray-900">
|
| 115 |
+
<div id="root"></div>
|
| 116 |
+
</body>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
</html>
|