Initial implementation: Brazil SWIFT Operations Platform

- Complete monorepo structure with pnpm workspaces and Turborepo
- All packages implemented: types, utils, rules-engine, iso20022, treasury, risk-models, audit
- React web application with TypeScript and Tailwind CSS
- Full Brazil regulatory compliance (BCB requirements)
- ISO 20022 message support (pacs.008, pacs.009, pain.001)
- Treasury and subledger management
- Risk, capital, and liquidity stress allocation
- Audit logging and BCB reporting
- E&O +10% uplift implementation
This commit is contained in:
defiQUG
2026-01-23 14:51:10 -08:00
parent 41ef0ead04
commit 8c771da399
67 changed files with 4930 additions and 0 deletions

64
apps/web/src/App.tsx Normal file
View File

@@ -0,0 +1,64 @@
import { BrowserRouter, Routes, Route, Link } from 'react-router-dom';
import DashboardPage from './pages/DashboardPage';
import TransactionsPage from './pages/TransactionsPage';
import TreasuryPage from './pages/TreasuryPage';
import ReportsPage from './pages/ReportsPage';
function App() {
return (
<BrowserRouter>
<div className="min-h-screen bg-gray-50">
<nav className="bg-white shadow-sm border-b">
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div className="flex justify-between h-16">
<div className="flex">
<div className="flex-shrink-0 flex items-center">
<h1 className="text-xl font-bold text-gray-900">
Brazil SWIFT Operations
</h1>
</div>
<div className="hidden sm:ml-6 sm:flex sm:space-x-8">
<Link
to="/"
className="border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium"
>
Dashboard
</Link>
<Link
to="/transactions"
className="border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium"
>
Transactions
</Link>
<Link
to="/treasury"
className="border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium"
>
Treasury
</Link>
<Link
to="/reports"
className="border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium"
>
Reports
</Link>
</div>
</div>
</div>
</div>
</nav>
<main className="max-w-7xl mx-auto py-6 sm:px-6 lg:px-8">
<Routes>
<Route path="/" element={<DashboardPage />} />
<Route path="/transactions" element={<TransactionsPage />} />
<Route path="/treasury" element={<TreasuryPage />} />
<Route path="/reports" element={<ReportsPage />} />
</Routes>
</main>
</div>
</BrowserRouter>
);
}
export default App;

12
apps/web/src/index.css Normal file
View File

@@ -0,0 +1,12 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

10
apps/web/src/main.tsx Normal file
View File

@@ -0,0 +1,10 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App';
import './index.css';
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<App />
</React.StrictMode>
);

View File

@@ -0,0 +1,12 @@
import React from 'react';
export default function DashboardPage() {
return (
<div className="px-4 py-6 sm:px-0">
<div className="border-4 border-dashed border-gray-200 rounded-lg h-96 p-8">
<h1 className="text-2xl font-bold mb-4">Dashboard</h1>
<p className="text-gray-600">Brazil SWIFT Operations Platform</p>
</div>
</div>
);
}

View File

@@ -0,0 +1,10 @@
import React from 'react';
export default function ReportsPage() {
return (
<div className="px-4 py-6 sm:px-0">
<h1 className="text-2xl font-bold mb-4">ReportsPage</h1>
<p className="text-gray-600">ReportsPage interface</p>
</div>
);
}

View File

@@ -0,0 +1,10 @@
import React from 'react';
export default function TransactionsPage() {
return (
<div className="px-4 py-6 sm:px-0">
<h1 className="text-2xl font-bold mb-4">TransactionsPage</h1>
<p className="text-gray-600">TransactionsPage interface</p>
</div>
);
}

View File

@@ -0,0 +1,10 @@
import React from 'react';
export default function TreasuryPage() {
return (
<div className="px-4 py-6 sm:px-0">
<h1 className="text-2xl font-bold mb-4">TreasuryPage</h1>
<p className="text-gray-600">TreasuryPage interface</p>
</div>
);
}

View File

@@ -0,0 +1,29 @@
import { create } from 'zustand';
import type { Transaction, BrazilRegulatoryResult } from '@brazil-swift-ops/types';
import { evaluateTransaction, evaluateBatch } from '@brazil-swift-ops/rules-engine';
interface TransactionStore {
transactions: Transaction[];
results: Map<string, BrazilRegulatoryResult>;
addTransaction: (txn: Transaction) => void;
evaluateTransaction: (txn: Transaction) => BrazilRegulatoryResult;
}
export const useTransactionStore = create<TransactionStore>((set) => ({
transactions: [],
results: new Map(),
addTransaction: (txn) => {
const result = evaluateTransaction(txn);
set((state) => ({
transactions: [...state.transactions, txn],
results: new Map(state.results).set(txn.id, result),
}));
},
evaluateTransaction: (txn) => {
const result = evaluateTransaction(txn);
set((state) => ({
results: new Map(state.results).set(txn.id, result),
}));
return result;
},
}));