# e1n7/brainly-ban-checker architecture

> Architecture diagram of the GitHub repository e1n7/brainly-ban-checker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/e1n7/brainly-ban-checker
- Repository: https://github.com/e1n7/brainly-ban-checker

## Overview

Brainly Ban Checker lets users submit text for country-specific banned-word scanning and view flagged patterns and highlighted locations. The browser optionally parses pasted Brainly HTML, then sends text and a country code to a Supabase Edge Function, which loads private enabled terms and runs the matching and highlighting algorithm. The interface also offers a symbol finder for copying or inserting alternate characters. The README documents four supported country codes and private database access; source excerpts show the request and response handling. The README’s aggregate-only privacy claim differs from the sampled response and display code, which include matched terms.

Main entry points: [`app/page.jsx`](https://github.com/e1n7/brainly-ban-checker/blob/main/app/page.jsx) (Checker page), [`supabase/functions/analyze-content/index.ts`](https://github.com/e1n7/brainly-ban-checker/blob/main/supabase/functions/analyze-content/index.ts) (Analyze content function), [`components/ban-checker/SymbolPanel.jsx`](https://github.com/e1n7/brainly-ban-checker/blob/main/components/ban-checker/SymbolPanel.jsx) (Symbol finder), [`components/ban-checker/CountrySelector.jsx`](https://github.com/e1n7/brainly-ban-checker/blob/main/components/ban-checker/CountrySelector.jsx) (Country selector)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Checker interface"]
  node_page["Checker page<br/>[page.jsx]"]
  node_country["Country selector"]
  node_results["Results display<br/>[ResultsDisplay.jsx]"]
  node_symbol["Symbol finder<br/>[SymbolPanel.jsx]"]
end

subgraph group_preparation["Input preparation"]
  node_parser["Brainly HTML parser<br/>[brainlyParser.js]"]
  node_countries["Country definitions<br/>[countries.js]"]
  node_publicconfig["Supabase request config<br/>[supabasePublic.js]"]
end

subgraph group_analysis["Scan service"]
  node_edge["Analyze content function<br/>[index.ts]"]
  node_analyzer["Text matching<br/>[analyzeText.js]"]
end

subgraph group_data["Reference data"]
  node_symboldata["Symbol map<br/>[symbolMap.json]"]
  node_database[("Private ban_words table")]
end

node_user(("User"))
node_supabase["Supabase service"]

node_user -->|"enters text"| node_page
node_page -->|"renders selector"| node_country
node_country -->|"reads options"| node_countries
node_page -->|"parses HTML"| node_parser
node_page -->|"reads request config"| node_publicconfig
node_page -->|"POSTs scan request"| node_edge
node_edge -->|"queries table"| node_supabase
node_supabase -->|"reads enabled terms"| node_database
node_edge -->|"calls matcher"| node_analyzer
node_edge -->|"returns scan result"| node_page
node_page -->|"passes result"| node_results
node_page -->|"renders finder"| node_symbol
node_symbol -->|"reads symbols"| node_symboldata
node_symbol -->|"copies or inserts"| node_user

click node_page "https://github.com/e1n7/brainly-ban-checker/blob/main/app/page.jsx"
click node_country "https://github.com/e1n7/brainly-ban-checker/blob/main/components/ban-checker/CountrySelector.jsx"
click node_results "https://github.com/e1n7/brainly-ban-checker/blob/main/components/ban-checker/ResultsDisplay.jsx"
click node_symbol "https://github.com/e1n7/brainly-ban-checker/blob/main/components/ban-checker/SymbolPanel.jsx"
click node_symboldata "https://github.com/e1n7/brainly-ban-checker/blob/main/data/symbolMap.json"
click node_parser "https://github.com/e1n7/brainly-ban-checker/blob/main/lib/brainlyParser.js"
click node_countries "https://github.com/e1n7/brainly-ban-checker/blob/main/lib/countries.js"
click node_publicconfig "https://github.com/e1n7/brainly-ban-checker/blob/main/lib/supabasePublic.js"
click node_edge "https://github.com/e1n7/brainly-ban-checker/blob/main/supabase/functions/analyze-content/index.ts"
click node_analyzer "https://github.com/e1n7/brainly-ban-checker/blob/main/lib/analyzeText.js"

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_page,node_country,node_results,node_symbol,node_user toneBlue
class node_parser,node_countries,node_publicconfig toneAmber
class node_edge,node_analyzer toneMint
class node_symboldata,node_database toneRose
class node_supabase toneIndigo
```

## Components

### Checker interface

- [Checker page](https://github.com/e1n7/brainly-ban-checker/blob/main/app/page.jsx): `app/page.jsx`
- [Country selector](https://github.com/e1n7/brainly-ban-checker/blob/main/components/ban-checker/CountrySelector.jsx): `components/ban-checker/CountrySelector.jsx`
- [Results display](https://github.com/e1n7/brainly-ban-checker/blob/main/components/ban-checker/ResultsDisplay.jsx): `components/ban-checker/ResultsDisplay.jsx`
- [Symbol finder](https://github.com/e1n7/brainly-ban-checker/blob/main/components/ban-checker/SymbolPanel.jsx): `components/ban-checker/SymbolPanel.jsx`

### Input preparation

- [Brainly HTML parser](https://github.com/e1n7/brainly-ban-checker/blob/main/lib/brainlyParser.js): `lib/brainlyParser.js`
- [Country definitions](https://github.com/e1n7/brainly-ban-checker/blob/main/lib/countries.js): `lib/countries.js`
- [Supabase request config](https://github.com/e1n7/brainly-ban-checker/blob/main/lib/supabasePublic.js): `lib/supabasePublic.js`

### Scan service

- [Analyze content function](https://github.com/e1n7/brainly-ban-checker/blob/main/supabase/functions/analyze-content/index.ts): `supabase/functions/analyze-content/index.ts`
- [Text matching](https://github.com/e1n7/brainly-ban-checker/blob/main/lib/analyzeText.js): `lib/analyzeText.js`

### Reference data

- [Symbol map](https://github.com/e1n7/brainly-ban-checker/blob/main/data/symbolMap.json): `data/symbolMap.json`
- **Private ban_words table**

### Other components

- **User**
- **Supabase service**

## Connections

- User → Checker page: enters text
- Checker page → Country selector: renders selector
- Country selector → Country definitions: reads options
- Checker page → Brainly HTML parser: parses HTML
- Checker page → Supabase request config: reads request config
- Checker page → Analyze content function: POSTs scan request
- Analyze content function → Supabase service: queries table
- Supabase service → Private ban_words table: reads enabled terms
- Analyze content function → Text matching: calls matcher
- Analyze content function → Checker page: returns scan result
- Checker page → Results display: passes result
- Checker page → Symbol finder: renders finder
- Symbol finder → Symbol map: reads symbols
- Symbol finder → User: copies or inserts
