<div align="center">
  <h1>🛡️ ADBIS Shared Core</h1>
  <p><b>The Immutable Zero-Trust Detection & Policy Engine for ADBIS</b></p>
  
  [![npm version](https://img.shields.io/npm/v/@bhaveshbhardwaj7/adbis-shared?style=for-the-badge&color=success)](https://www.npmjs.com/package/@bhaveshbhardwaj7/adbis-shared)
  [![License](https://img.shields.io/npm/l/@bhaveshbhardwaj7/adbis-shared?style=for-the-badge)](https://github.com/BhaveshBhardwaj/ADBIS)
</div>

<br/>

> **ADBIS (Advanced Data Breach Detection & Incident Response System)** is a next-generation, real-time security framework. `@bhaveshbhardwaj7/adbis-shared` is the neural network of the ecosystem—housing the ultra-fast anomaly heuristics, policy evaluation engine, and strict TypeScript contracts that power the entire suite.

## 🔥 Why ADBIS Shared?

In modern distributed architectures, **millisecond-level threat evaluation is critical**. This package is completely decoupled from UI or database logic, meaning it can run **anywhere** (Edge Functions, Cloudflare Workers, Node backends, or the browser). 

- 🚀 **Zero-Day Heuristics**: Detects impossible travel (via exact Haversine Math), IP drifts, and suspicious bot patterns out-of-the-box.
- 🧱 **Immutable Contracts**: Bulletproof `TypeScript` schemas that reject corrupted payloads instantly.
- ⚡ **Dynamic Policy Engine**: Create `PolicyRules` that evaluate `CRITICAL` breaches in microseconds.
- ⏳ **Time-Decay Windows**: True temporal decay algorithms to eliminate false positives over time.

## 📦 Installation

```bash
npm install @bhaveshbhardwaj7/adbis-shared
```

## 🛠️ Viral Features & Architecture

### The Haversine "Impossible Travel" Detector
Stop stolen session cookies instantly. By calculating the exact geospatial curve between network requests, the engine flags accounts moving faster than physical physics allows.

```typescript
import { haversineDistanceKm } from '@bhaveshbhardwaj7/adbis-shared';

const distance = haversineDistanceKm(req1.lat, req1.lon, req2.lat, req2.lon);
if (distance > 1000 && timeDiffMs < 3600000) {
  // Flagged: Impossible Travel Detected!
}
```

### Pluggable Architecture
Integrate natively into **Fastify, Express, Next.js, or NestJS**. The `StorageAdapter` and `EventBus` contracts allow you to hot-swap SQLite, Redis, or Postgres effortlessly!

---
<div align="center">
  <b>Built for highly-scalable, production-grade security architectures.</b><br/>
  <i>#cybersecurity #adbis #threatdetection #devsecops #zerotrust #infosec #websecurity #typescript</i>
</div>


## 🌐 Universal Web Architecture

ADBIS is a completely **framework-agnostic** universal security product. It does not depend on any specific application structure, backend framework, or frontend library. It is completely decoupled from any hardcoded application logic and works with any website.