Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
73 changes: 73 additions & 0 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs)
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/)

## React Compiler

The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).

## Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:

```js
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...

// Remove tseslint.configs.recommended and replace with this
tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
tseslint.configs.stylisticTypeChecked,

// Other configs...
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])
```

You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:

```js
// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'

export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Enable lint rules for React
reactX.configs['recommended-typescript'],
// Enable lint rules for React DOM
reactDom.configs.recommended,
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])
```
96 changes: 96 additions & 0 deletions frontend/context.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Anti-Fraud System — Context

## Overview
This system is designed to **prevent financial fraud in real time** by evaluating the risk of user actions within a banking or money-movement environment.
Rather than only detecting fraud after it occurs, the system focuses on **prevention through dynamic risk assessment and automated decision-making**.

---

## Core Principle
Every user action is treated as a **risk evaluation event**.

Risk is not static. It is continuously recalculated based on:
- user behavior
- transaction context
- device and network signals
- recent security-related events

The system adapts its response dynamically to minimize fraud while maintaining user experience.

---

## Event Flow

### 1. Trigger Event
An event initiates the evaluation process. Examples include:
- user login
- money transfer
- adding a new beneficiary
- credential changes (password, email, 2FA)

---

### 2. Signal Collection
The system gathers and computes relevant signals, such as:
- transaction amount vs user baseline
- action frequency (velocity)
- device trust level
- geolocation consistency
- recent security events (OTP usage, password reset)

---

### 3. Risk Evaluation
All signals are aggregated into a **risk score**.

The score reflects:
- behavioral anomalies
- contextual inconsistencies
- known fraud patterns or network associations

---

### 4. Decision Engine
Based on the risk score, the system determines the appropriate action:

- **Low risk** → approve action
- **Medium risk** → require step-up authentication (OTP, MFA)
- **High risk** → block or reject action

---

### 5. Automated Response
The system executes the decision in real time:
- allow transaction
- request additional verification
- block operation
- freeze session or account
- generate alerts for monitoring systems

---

### 6. Continuous Monitoring
During the user session:
- risk is recalculated dynamically
- anomalies trigger re-evaluation
- additional controls may be applied if risk increases

---

### 7. Post-Event Analysis
After execution:
- transactions are analyzed for patterns (e.g., fraud networks, mule accounts)
- models and rules are updated to improve future detection

---

## Key Objective
To **intercept and stop fraudulent activity before funds are moved**, while minimizing friction for legitimate users.

---

## Design Philosophy
- Real-time decisioning is critical
- Combine multiple weak signals into strong indicators
- Prefer adaptive responses over static rules
- Balance security with user experience
23 changes: 23 additions & 0 deletions frontend/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'
import { defineConfig, globalIgnores } from 'eslint/config'

export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
js.configs.recommended,
tseslint.configs.recommended,
reactHooks.configs.flat.recommended,
reactRefresh.configs.vite,
],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
},
])
18 changes: 18 additions & 0 deletions frontend/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover, maximum-scale=1" />
<meta name="description" content="Temis RiskControl — Secure banking with real-time fraud prevention" />
<meta name="theme-color" content="#0a1628" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet" />
<title>Temis — Secure Banking</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading
Loading