# snmiitb-bit/molecoapp architecture

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

- Interactive diagram: https://gitdiagram.com/snmiitb-bit/molecoapp
- Repository: https://github.com/snmiitb-bit/molecoapp

## Overview

This repository is a collection of experimental chemistry utilities rather than one integrated application. Its main workflow is entering chemical identifiers in an interactive search app, optionally in a semicolon-delimited batch, and viewing chemical records and structure-card output. Separate scripts resolve chemical names or CAS numbers into rendered structures, while another standalone utility searches PubMed. The main app exists in several substantial versions. Edges reflect only relationships visible in excerpts; unsampled wiring is omitted.

Main entry points: [`molway_app.py`](https://github.com/snmiitb-bit/molecoapp/blob/main/molway_app.py) (Search App), [`generate_grid3.py`](https://github.com/snmiitb-bit/molecoapp/blob/main/generate_grid3.py) (CAS Resolver), [`molway_app-checkpoint.py`](https://github.com/snmiitb-bit/molecoapp/blob/main/molway_app-checkpoint.py) (Checkpoint App), [`molway_app_v1.py`](https://github.com/snmiitb-bit/molecoapp/blob/main/molway_app_v1.py) (Search App v1)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_chem_search["Chemical Search Apps"]
  node_app_main["Search App<br/>[molway_app.py]"]
  node_app_checkpoint["Checkpoint App"]
  node_app_v1["Search App v1<br/>[molway_app_v1.py]"]
end

subgraph group_structure_tools["Structure Tools"]
  node_grid_basic["Structure Demo<br/>[generate_grid1.py]"]
  node_grid_names["Name Renderer<br/>[generate_grid.py]"]
  node_grid_cli["Grid Generator<br/>[generate_grid2.py]"]
  node_grid_cas["CAS Resolver<br/>[generate_grid3.py]"]
end

subgraph group_literature["Literature Search"]
  node_app_v2["PubMed App<br/>[molway_app_v2.py]"]
end

node_chemist(("Chemist"))
node_epa[("EPA CompTox")]
node_pubchem[("PubChem")]
node_nih[("NIH Resolver")]
node_opsin[("OPSIN")]
node_ncbi[("NCBI Entrez")]

node_chemist -->|"enters queries"| node_app_main
node_app_main -->|"searches identifiers"| node_epa
node_app_main -->|"queries compounds"| node_pubchem
node_chemist -.->|"enters queries"| node_app_checkpoint
node_app_checkpoint -->|"searches identifiers"| node_epa
node_chemist -.->|"enters queries"| node_app_v1
node_app_v1 -->|"searches identifiers"| node_epa
node_chemist -->|"provides examples"| node_grid_basic
node_chemist -->|"enters names"| node_grid_names
node_grid_names -->|"resolves names"| node_opsin
node_chemist -->|"enters names"| node_grid_cli
node_grid_cli -->|"resolves names"| node_opsin
node_chemist -->|"enters CAS numbers"| node_grid_cas
node_grid_cas -->|"resolves CAS"| node_nih
node_grid_cas -->|"fetches titles"| node_pubchem
node_chemist -->|"enters search terms"| node_app_v2
node_app_v2 -->|"searches literature"| node_ncbi

click node_app_main "https://github.com/snmiitb-bit/molecoapp/blob/main/molway_app.py"
click node_app_checkpoint "https://github.com/snmiitb-bit/molecoapp/blob/main/molway_app-checkpoint.py"
click node_app_v1 "https://github.com/snmiitb-bit/molecoapp/blob/main/molway_app_v1.py"
click node_app_v2 "https://github.com/snmiitb-bit/molecoapp/blob/main/molway_app_v2.py"
click node_grid_basic "https://github.com/snmiitb-bit/molecoapp/blob/main/generate_grid1.py"
click node_grid_names "https://github.com/snmiitb-bit/molecoapp/blob/main/generate_grid.py"
click node_grid_cli "https://github.com/snmiitb-bit/molecoapp/blob/main/generate_grid2.py"
click node_grid_cas "https://github.com/snmiitb-bit/molecoapp/blob/main/generate_grid3.py"

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_app_main,node_app_checkpoint,node_app_v1 toneBlue
class node_grid_basic,node_grid_names,node_grid_cli,node_grid_cas,node_epa,node_pubchem,node_nih,node_opsin,node_ncbi toneAmber
class node_app_v2 toneMint
class node_chemist toneIndigo
```

## Components

### Chemical Search Apps

- [Search App](https://github.com/snmiitb-bit/molecoapp/blob/main/molway_app.py): `molway_app.py`
- [Checkpoint App](https://github.com/snmiitb-bit/molecoapp/blob/main/molway_app-checkpoint.py): `molway_app-checkpoint.py`
- [Search App v1](https://github.com/snmiitb-bit/molecoapp/blob/main/molway_app_v1.py): `molway_app_v1.py`

### Structure Tools

- [Structure Demo](https://github.com/snmiitb-bit/molecoapp/blob/main/generate_grid1.py): `generate_grid1.py`
- [Name Renderer](https://github.com/snmiitb-bit/molecoapp/blob/main/generate_grid.py): `generate_grid.py`
- [Grid Generator](https://github.com/snmiitb-bit/molecoapp/blob/main/generate_grid2.py): `generate_grid2.py`
- [CAS Resolver](https://github.com/snmiitb-bit/molecoapp/blob/main/generate_grid3.py): `generate_grid3.py`

### Literature Search

- [PubMed App](https://github.com/snmiitb-bit/molecoapp/blob/main/molway_app_v2.py): `molway_app_v2.py`

### Other components

- **Chemist**
- **EPA CompTox**
- **PubChem**
- **NIH Resolver**
- **OPSIN**
- **NCBI Entrez**

## Connections

- Chemist → Search App: enters queries (evidence: `molway_app.py`)
- Search App → EPA CompTox: searches identifiers (evidence: `molway_app.py`)
- Search App → PubChem: queries compounds (evidence: `molway_app.py`)
- Chemist → Checkpoint App: enters queries
- Checkpoint App → EPA CompTox: searches identifiers (evidence: `molway_app-checkpoint.py`)
- Chemist → Search App v1: enters queries
- Search App v1 → EPA CompTox: searches identifiers (evidence: `molway_app_v1.py`)
- Chemist → Structure Demo: provides examples (evidence: `generate_grid1.py`)
- Chemist → Name Renderer: enters names (evidence: `generate_grid.py`)
- Name Renderer → OPSIN: resolves names (evidence: `generate_grid.py`)
- Chemist → Grid Generator: enters names (evidence: `generate_grid2.py`)
- Grid Generator → OPSIN: resolves names (evidence: `generate_grid2.py`)
- Chemist → CAS Resolver: enters CAS numbers (evidence: `generate_grid3.py`)
- CAS Resolver → NIH Resolver: resolves CAS (evidence: `generate_grid3.py`)
- CAS Resolver → PubChem: fetches titles (evidence: `generate_grid3.py`)
- Chemist → PubMed App: enters search terms (evidence: `molway_app_v2.py`)
- PubMed App → NCBI Entrez: searches literature (evidence: `molway_app_v2.py`)
