# kantimohanthy/team-empty-sarajevo-hackathon architecture

> Architecture diagram of the GitHub repository kantimohanthy/team-empty-sarajevo-hackathon, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kantimohanthy/team-empty-sarajevo-hackathon
- Repository: https://github.com/kantimohanthy/team-empty-sarajevo-hackathon

## Overview

G-Core is a behavioral-banking loyalty prototype: customer banking activity is contextualized and filtered before behavioral evaluation, goal and reward decisions, and pseudonymous G-Core status. Customers explore banking and ecosystem views and can trigger simulations; bank staff have a separate intelligence console. The graph combines documented capabilities with sampled server calls. Some API routes and UI pages were not sampled, so their internal wiring is omitted where it cannot be established.

Main entry points: [`lib/server/pipeline.ts`](https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/lib/server/pipeline.ts) (Evaluation pipeline), [`lib/server/gcore-engine.ts`](https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/lib/server/gcore-engine.ts) (G-Core engine), [`app/ecosystem/page.tsx`](https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/app/ecosystem/page.tsx) (Ecosystem views), [`lib/demo-context.tsx`](https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/lib/demo-context.tsx) (Demo state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Product experiences"]
  node_banking["Banking interface<br/>[page.tsx]"]
  node_ecosystem["Ecosystem views<br/>[page.tsx]"]
  node_admin["Bank admin console<br/>[page.tsx]"]
  node_network["Network view<br/>[page.tsx]"]
end

subgraph group_demo["Browser demo"]
  node_democtx["Demo state<br/>[demo-context.tsx]"]
  node_demoengine["Demo simulation<br/>[demo-engine.ts]"]
  node_mock["Demo seed data<br/>[mock-data.ts]"]
  node_gcorectx["G-Core client state<br/>[gcore-context.tsx]"]
  node_simulationapi["Simulation APIs<br/>[route.ts]"]
end

subgraph group_evaluation["Behavior evaluation"]
  node_pipeline["Evaluation pipeline<br/>[pipeline.ts]"]
  node_classification["Transaction classification"]
  node_ingest["Transaction ingestion<br/>[ingest.ts]"]
  node_antigaming["Transfer filtering"]
  node_behavior["Behavior scoring<br/>[behavior-engine.ts]"]
  node_rewards["Reward eligibility<br/>[reward-engine.ts]"]
  node_events["Event stream<br/>[event-engine.ts]"]
  node_behaviorapi["Behavior evaluation API<br/>[route.ts]"]
  node_transactionapi["Transaction API<br/>[route.ts]"]
end

subgraph group_loyalty["Loyalty and state"]
  node_gcore["G-Core engine<br/>[gcore-engine.ts]"]
  node_snapshot["Bank snapshot<br/>[bank-snapshot.ts]"]
  node_database[("SQLite database<br/>[db.ts]")]
end

node_customer(("Customer"))

node_customer -->|"uses"| node_banking
node_customer -->|"explores"| node_ecosystem
node_banking -->|"reads state"| node_democtx
node_ecosystem -->|"reads state"| node_democtx
node_ecosystem -->|"reads state"| node_gcorectx
node_admin -->|"reads state"| node_democtx
node_democtx -->|"runs simulations"| node_demoengine
node_demoengine -->|"loads seed data"| node_mock
node_democtx -->|"syncs actions"| node_simulationapi
node_behaviorapi -->|"runs evaluation"| node_pipeline
node_transactionapi -->|"ingests transactions"| node_ingest
node_ingest -->|"classifies"| node_classification
node_pipeline -->|"reads and writes"| node_database
node_pipeline -->|"filters transfers"| node_antigaming
node_pipeline -->|"scores behavior"| node_behavior
node_pipeline -->|"evaluates offers"| node_rewards
node_pipeline -->|"writes events"| node_events
node_pipeline -->|"syncs status"| node_gcore
node_gcore -->|"refreshes snapshot"| node_pipeline
node_gcore -->|"reads bank metrics"| node_snapshot
node_snapshot -->|"reads feed"| node_events
node_ecosystem -.->|"shows points and tiers"| node_gcore
node_ecosystem -.->|"offers perk claims"| node_gcore
node_admin -.->|"shows event stream"| node_events
node_network -.->|"shows network status"| node_gcore

click node_banking "https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/app/bank/page.tsx"
click node_ecosystem "https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/app/ecosystem/page.tsx"
click node_admin "https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/app/bank-admin/page.tsx"
click node_network "https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/app/network/page.tsx"
click node_democtx "https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/lib/demo-context.tsx"
click node_demoengine "https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/lib/demo-engine.ts"
click node_mock "https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/lib/mock-data.ts"
click node_gcorectx "https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/lib/gcore-context.tsx"
click node_pipeline "https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/lib/server/pipeline.ts"
click node_classification "https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/lib/server/classification-engine.ts"
click node_ingest "https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/lib/server/ingest.ts"
click node_antigaming "https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/lib/server/anti-gaming-engine.ts"
click node_behavior "https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/lib/server/behavior-engine.ts"
click node_rewards "https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/lib/server/reward-engine.ts"
click node_events "https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/lib/server/event-engine.ts"
click node_gcore "https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/lib/server/gcore-engine.ts"
click node_snapshot "https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/lib/server/bank-snapshot.ts"
click node_database "https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/lib/server/db.ts"
click node_behaviorapi "https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/app/api/behavior/evaluate/route.ts"
click node_transactionapi "https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/app/api/transactions/route.ts"
click node_simulationapi "https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/app/api/simulation/month/route.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_banking,node_ecosystem,node_admin,node_network toneBlue
class node_democtx,node_demoengine,node_mock,node_gcorectx,node_simulationapi toneAmber
class node_pipeline,node_classification,node_ingest,node_antigaming,node_behavior,node_rewards,node_events,node_behaviorapi,node_transactionapi toneMint
class node_gcore,node_snapshot,node_database toneRose
class node_customer toneIndigo
```

## Components

### Product experiences

- [Banking interface](https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/app/bank/page.tsx): `app/bank/page.tsx`
- [Ecosystem views](https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/app/ecosystem/page.tsx): `app/ecosystem/page.tsx`
- [Bank admin console](https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/app/bank-admin/page.tsx): `app/bank-admin/page.tsx`
- [Network view](https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/app/network/page.tsx): `app/network/page.tsx`

### Browser demo

- [Demo state](https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/lib/demo-context.tsx): `lib/demo-context.tsx`
- [Demo simulation](https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/lib/demo-engine.ts): `lib/demo-engine.ts`
- [Demo seed data](https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/lib/mock-data.ts): `lib/mock-data.ts`
- [G-Core client state](https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/lib/gcore-context.tsx): `lib/gcore-context.tsx`
- [Simulation APIs](https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/app/api/simulation/month/route.ts): `app/api/simulation/month/route.ts`

### Behavior evaluation

- [Evaluation pipeline](https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/lib/server/pipeline.ts): `lib/server/pipeline.ts`
- [Transaction classification](https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/lib/server/classification-engine.ts): `lib/server/classification-engine.ts`
- [Transaction ingestion](https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/lib/server/ingest.ts): `lib/server/ingest.ts`
- [Transfer filtering](https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/lib/server/anti-gaming-engine.ts): `lib/server/anti-gaming-engine.ts`
- [Behavior scoring](https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/lib/server/behavior-engine.ts): `lib/server/behavior-engine.ts`
- [Reward eligibility](https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/lib/server/reward-engine.ts): `lib/server/reward-engine.ts`
- [Event stream](https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/lib/server/event-engine.ts): `lib/server/event-engine.ts`
- [Behavior evaluation API](https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/app/api/behavior/evaluate/route.ts): `app/api/behavior/evaluate/route.ts`
- [Transaction API](https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/app/api/transactions/route.ts): `app/api/transactions/route.ts`

### Loyalty and state

- [G-Core engine](https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/lib/server/gcore-engine.ts): `lib/server/gcore-engine.ts`
- [Bank snapshot](https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/lib/server/bank-snapshot.ts): `lib/server/bank-snapshot.ts`
- [SQLite database](https://github.com/kantimohanthy/team-empty-sarajevo-hackathon/blob/main/lib/server/db.ts): `lib/server/db.ts`

### Other components

- **Customer**

## Connections

- Customer → Banking interface: uses
- Customer → Ecosystem views: explores
- Banking interface → Demo state: reads state (evidence: `app/bank/page.tsx`)
- Ecosystem views → Demo state: reads state (evidence: `app/ecosystem/page.tsx`)
- Ecosystem views → G-Core client state: reads state (evidence: `app/ecosystem/page.tsx`)
- Bank admin console → Demo state: reads state (evidence: `app/bank-admin/page.tsx`)
- Demo state → Demo simulation: runs simulations (evidence: `lib/demo-context.tsx`)
- Demo simulation → Demo seed data: loads seed data (evidence: `lib/demo-engine.ts`)
- Demo state → Simulation APIs: syncs actions (evidence: `lib/demo-context.tsx`)
- Behavior evaluation API → Evaluation pipeline: runs evaluation (evidence: `app/api/behavior/evaluate/route.ts`)
- Transaction API → Transaction ingestion: ingests transactions (evidence: `app/api/transactions/route.ts`)
- Transaction ingestion → Transaction classification: classifies (evidence: `lib/server/ingest.ts`)
- Evaluation pipeline → SQLite database: reads and writes (evidence: `lib/server/pipeline.ts`)
- Evaluation pipeline → Transfer filtering: filters transfers (evidence: `lib/server/pipeline.ts`)
- Evaluation pipeline → Behavior scoring: scores behavior (evidence: `lib/server/pipeline.ts`)
- Evaluation pipeline → Reward eligibility: evaluates offers (evidence: `lib/server/pipeline.ts`)
- Evaluation pipeline → Event stream: writes events (evidence: `lib/server/pipeline.ts`)
- Evaluation pipeline → G-Core engine: syncs status (evidence: `lib/server/pipeline.ts`)
- G-Core engine → Evaluation pipeline: refreshes snapshot (evidence: `lib/server/gcore-engine.ts`)
- G-Core engine → Bank snapshot: reads bank metrics (evidence: `lib/server/gcore-engine.ts`)
- Bank snapshot → Event stream: reads feed (evidence: `lib/server/bank-snapshot.ts`)
- Ecosystem views → G-Core engine: shows points and tiers
- Ecosystem views → G-Core engine: offers perk claims
- Bank admin console → Event stream: shows event stream
- Network view → G-Core engine: shows network status
