# israarefaat/swot architecture

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

- Interactive diagram: https://gitdiagram.com/israarefaat/swot
- Repository: https://github.com/israarefaat/swot

## Overview

swot supports JetBrains educational-license eligibility by matching an email domain against educational institution domains, while excluding stoplisted domains. The main workflow normalizes the supplied email, checks the stoplist, then accepts a listed TLD or finds a matching institution name. The domain files also feed a compiler that emits a sorted domain list. The tree and README establish the catalog’s role; source excerpts show the matching and compilation behavior, but not downstream use of the generated artifact.

Main entry points: [`src/main/kotlin/swot/Swot.kt`](https://github.com/israarefaat/swot/blob/master/src/main/kotlin/swot/Swot.kt) (Academic checks), [`src/main/kotlin/swot/Compiler.kt`](https://github.com/israarefaat/swot/blob/master/src/main/kotlin/swot/Compiler.kt) (Domain compiler), [`lib/domains`](https://github.com/israarefaat/swot/tree/master/lib/domains) (Institution domains), [`lib/domains/tlds.txt`](https://github.com/israarefaat/swot/blob/master/lib/domains/tlds.txt) (Allowed TLDs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_matching["Domain matching"]
  node_matching_api["Academic checks<br/>[Swot.kt]"]
  node_normalizer["Domain parsing<br/>[Swot.kt]"]
  node_school_lookup["School-name lookup<br/>[Swot.kt]"]
  node_set_check["Set matching<br/>[Swot.kt]"]
  node_decision["Eligibility result<br/>[Swot.kt]"]
end

subgraph group_catalog["Domain catalog"]
  node_institution_domains["Institution domains"]
  node_tld_list["Allowed TLDs<br/>[tlds.txt]"]
  node_stoplist["Stoplist<br/>[stoplist.txt]"]
end

subgraph group_compilation["Catalog compilation"]
  node_compiler["Domain compiler<br/>[Compiler.kt]"]
  node_compiled_list["Compiled domain list<br/>[Compiler.kt]"]
end

node_applicant(("License applicant"))

node_applicant -->|"submits email"| node_matching_api
node_matching_api -->|"parses input"| node_normalizer
node_normalizer -->|"returns parts"| node_matching_api
node_matching_api -->|"checks membership"| node_set_check
node_matching_api -->|"looks up names"| node_school_lookup
node_school_lookup -->|"reads matching files"| node_institution_domains
node_matching_api -->|"checks TLDs"| node_tld_list
node_matching_api -->|"checks exclusions"| node_stoplist
node_matching_api -->|"returns result"| node_decision
node_compiler -->|"walks files"| node_institution_domains
node_compiler -->|"loads entries"| node_stoplist
node_compiler -->|"loads entries"| node_tld_list
node_compiler -->|"filters domains"| node_set_check
node_compiler -->|"writes sorted output"| node_compiled_list

click node_matching_api "https://github.com/israarefaat/swot/blob/master/src/main/kotlin/swot/Swot.kt"
click node_normalizer "https://github.com/israarefaat/swot/blob/master/src/main/kotlin/swot/Swot.kt"
click node_school_lookup "https://github.com/israarefaat/swot/blob/master/src/main/kotlin/swot/Swot.kt"
click node_set_check "https://github.com/israarefaat/swot/blob/master/src/main/kotlin/swot/Swot.kt"
click node_decision "https://github.com/israarefaat/swot/blob/master/src/main/kotlin/swot/Swot.kt"
click node_institution_domains "https://github.com/israarefaat/swot/tree/master/lib/domains"
click node_tld_list "https://github.com/israarefaat/swot/blob/master/lib/domains/tlds.txt"
click node_stoplist "https://github.com/israarefaat/swot/blob/master/lib/domains/stoplist.txt"
click node_compiler "https://github.com/israarefaat/swot/blob/master/src/main/kotlin/swot/Compiler.kt"
click node_compiled_list "https://github.com/israarefaat/swot/blob/master/src/main/kotlin/swot/Compiler.kt"

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_matching_api,node_normalizer,node_school_lookup,node_set_check,node_decision toneBlue
class node_institution_domains,node_tld_list,node_stoplist toneAmber
class node_compiler,node_compiled_list toneMint
class node_applicant toneIndigo
```

## Components

### Domain matching

- [Academic checks](https://github.com/israarefaat/swot/blob/master/src/main/kotlin/swot/Swot.kt): `src/main/kotlin/swot/Swot.kt`
- [Domain parsing](https://github.com/israarefaat/swot/blob/master/src/main/kotlin/swot/Swot.kt): `src/main/kotlin/swot/Swot.kt`
- [School-name lookup](https://github.com/israarefaat/swot/blob/master/src/main/kotlin/swot/Swot.kt): `src/main/kotlin/swot/Swot.kt`
- [Set matching](https://github.com/israarefaat/swot/blob/master/src/main/kotlin/swot/Swot.kt): `src/main/kotlin/swot/Swot.kt`
- [Eligibility result](https://github.com/israarefaat/swot/blob/master/src/main/kotlin/swot/Swot.kt): `src/main/kotlin/swot/Swot.kt`

### Domain catalog

- [Institution domains](https://github.com/israarefaat/swot/tree/master/lib/domains): `lib/domains`
- [Allowed TLDs](https://github.com/israarefaat/swot/blob/master/lib/domains/tlds.txt): `lib/domains/tlds.txt`
- [Stoplist](https://github.com/israarefaat/swot/blob/master/lib/domains/stoplist.txt): `lib/domains/stoplist.txt`

### Catalog compilation

- [Domain compiler](https://github.com/israarefaat/swot/blob/master/src/main/kotlin/swot/Compiler.kt): `src/main/kotlin/swot/Compiler.kt`
- [Compiled domain list](https://github.com/israarefaat/swot/blob/master/src/main/kotlin/swot/Compiler.kt): `src/main/kotlin/swot/Compiler.kt`

### Other components

- **License applicant**

## Connections

- License applicant → Academic checks: submits email
- Academic checks → Domain parsing: parses input
- Domain parsing → Academic checks: returns parts
- Academic checks → Set matching: checks membership
- Academic checks → School-name lookup: looks up names
- School-name lookup → Institution domains: reads matching files
- Academic checks → Allowed TLDs: checks TLDs
- Academic checks → Stoplist: checks exclusions
- Academic checks → Eligibility result: returns result
- Domain compiler → Institution domains: walks files
- Domain compiler → Stoplist: loads entries
- Domain compiler → Allowed TLDs: loads entries
- Domain compiler → Set matching: filters domains
- Domain compiler → Compiled domain list: writes sorted output
