# amand4ngol/chemsphere architecture

> Architecture diagram of the GitHub repository amand4ngol/chemsphere, 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/amand4ngol/chemsphere
- Repository: https://github.com/amand4ngol/chemsphere

## Overview

ChemSphere is a Flutter chemistry-learning and exploration app. Users enter through the home dashboard and branch into reference, search, calculation, visualization, and air-quality experiences; the README explicitly describes formula search leading to compound details and location-based AQI exploration. The graph preserves these distinct product capabilities and the shared PubChem integration layer. The sampled source excerpts cover native launchers rather than Dart runtime wiring, so feature-to-provider and provider-to-service links are limited to documented integrations; uncertain call relationships are omitted.

Main entry points: [`lib/features/main_screen.dart`](https://github.com/amand4ngol/chemsphere/blob/main/lib/features/main_screen.dart) (Feature navigation), [`lib/features/aqi/provider/aqi_provider.dart`](https://github.com/amand4ngol/chemsphere/blob/main/lib/features/aqi/provider/aqi_provider.dart) (AQI state), [`lib/features/compounds/compound_searhc_screen.dart`](https://github.com/amand4ngol/chemsphere/blob/main/lib/features/compounds/compound_searhc_screen.dart) (Compound search), [`lib/providers/base_pubchem_provider.dart`](https://github.com/amand4ngol/chemsphere/blob/main/lib/providers/base_pubchem_provider.dart) (PubChem access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App navigation"]
  node_main["App entry<br/>[main.dart]"]
  node_home["Home dashboard<br/>[home_screen.dart]"]
  node_navigation["Feature navigation<br/>[main_screen.dart]"]
end

subgraph group_chem["Chemistry exploration"]
  node_elements["Periodic tables"]
  node_element_info["Element details"]
  node_compounds["Compound search"]
  node_compound_info["Compound details"]
  node_formula["Formula search"]
  node_drugs["Drug explorer"]
  node_molecules["Molecule viewer"]
  node_pubchem["PubChem access"]
  node_weight["Weight calculator"]
end

subgraph group_learn["Learning tools"]
  node_reactions["Reaction learning"]
  node_guide["Chemistry guide"]
  node_flashcards["Element flashcards"]
  node_bookmarks["Bookmarks"]
end

subgraph group_place["Air quality"]
  node_aqi["Air quality monitor"]
  node_aqi_data["AQI state<br/>[aqi_provider.dart]"]
  node_city_search["City search"]
end

node_user(("Learner"))
node_pubchem_api["PubChem API"]
node_wikipedia["Wikipedia"]
node_location["Device location"]
node_air_service["Air quality data"]

node_user -->|"opens"| node_main
node_main -->|"starts"| node_home
node_home -->|"offers features"| node_navigation
node_navigation -->|"opens"| node_elements
node_navigation -->|"opens"| node_compounds
node_navigation -->|"opens"| node_formula
node_navigation -->|"opens"| node_drugs
node_navigation -->|"opens"| node_molecules
node_navigation -->|"opens"| node_weight
node_navigation -->|"opens"| node_reactions
node_navigation -->|"opens"| node_guide
node_navigation -->|"opens"| node_flashcards
node_navigation -->|"opens"| node_bookmarks
node_navigation -->|"opens"| node_aqi
node_elements -->|"selects element"| node_element_info
node_formula -->|"finds compound"| node_compound_info
node_compounds -->|"opens result"| node_compound_info
node_compounds -->|"requests data"| node_pubchem
node_drugs -->|"requests data"| node_pubchem
node_pubchem -->|"queries"| node_pubchem_api
node_guide -.->|"fetches content"| node_wikipedia
node_aqi -->|"reads air data"| node_aqi_data
node_city_search -->|"requests city data"| node_aqi_data
node_aqi_data -->|"gets location"| node_location
node_aqi_data -->|"requests AQI"| node_air_service

click node_main "https://github.com/amand4ngol/chemsphere/blob/main/lib/main.dart"
click node_home "https://github.com/amand4ngol/chemsphere/blob/main/lib/features/home/home_screen.dart"
click node_navigation "https://github.com/amand4ngol/chemsphere/blob/main/lib/features/main_screen.dart"
click node_elements "https://github.com/amand4ngol/chemsphere/blob/main/lib/features/elements/screens/periodic_tablescreen/periodic_table_screen.dart"
click node_element_info "https://github.com/amand4ngol/chemsphere/blob/main/lib/features/elements/screens/element_detailscreen/element_detail_screen.dart"
click node_compounds "https://github.com/amand4ngol/chemsphere/blob/main/lib/features/compounds/compound_searhc_screen.dart"
click node_compound_info "https://github.com/amand4ngol/chemsphere/blob/main/lib/features/compounds/compound_details_screen.dart"
click node_formula "https://github.com/amand4ngol/chemsphere/blob/main/lib/features/formula/screen/formula_search_screen.dart"
click node_drugs "https://github.com/amand4ngol/chemsphere/blob/main/lib/features/drugs/drug_search_screen.dart"
click node_molecules "https://github.com/amand4ngol/chemsphere/blob/main/lib/features/molecules_viewer/screen/molecule_viewer_screen.dart"
click node_pubchem "https://github.com/amand4ngol/chemsphere/blob/main/lib/providers/base_pubchem_provider.dart"
click node_weight "https://github.com/amand4ngol/chemsphere/blob/main/lib/features/molecular_weight/screens/molecular_weight_screen.dart"
click node_reactions "https://github.com/amand4ngol/chemsphere/blob/main/lib/features/reactions/screen/reaction_screen.dart"
click node_guide "https://github.com/amand4ngol/chemsphere/blob/main/lib/features/chemistryguide/chemistry_guide_screen.dart"
click node_flashcards "https://github.com/amand4ngol/chemsphere/blob/main/lib/features/elements/screens/flashcard_screen/element_flashcard_screen.dart"
click node_bookmarks "https://github.com/amand4ngol/chemsphere/blob/main/lib/features/bookmarks/bookmark_screen.dart"
click node_aqi "https://github.com/amand4ngol/chemsphere/blob/main/lib/features/aqi/screen/aqi_info_screen.dart"
click node_aqi_data "https://github.com/amand4ngol/chemsphere/blob/main/lib/features/aqi/provider/aqi_provider.dart"
click node_city_search "https://github.com/amand4ngol/chemsphere/blob/main/lib/features/aqi/screen/city_search_screen.dart"

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_main,node_home,node_navigation toneBlue
class node_elements,node_element_info,node_compounds,node_compound_info,node_formula,node_drugs,node_molecules,node_pubchem,node_weight toneAmber
class node_reactions,node_guide,node_flashcards,node_bookmarks,node_pubchem_api toneMint
class node_aqi,node_aqi_data,node_city_search toneRose
class node_user,node_wikipedia,node_location,node_air_service toneIndigo
```

## Components

### App navigation

- [App entry](https://github.com/amand4ngol/chemsphere/blob/main/lib/main.dart): `lib/main.dart`
- [Home dashboard](https://github.com/amand4ngol/chemsphere/blob/main/lib/features/home/home_screen.dart): `lib/features/home/home_screen.dart`
- [Feature navigation](https://github.com/amand4ngol/chemsphere/blob/main/lib/features/main_screen.dart): `lib/features/main_screen.dart`

### Chemistry exploration

- [Periodic tables](https://github.com/amand4ngol/chemsphere/blob/main/lib/features/elements/screens/periodic_tablescreen/periodic_table_screen.dart): `lib/features/elements/screens/periodic_tablescreen/periodic_table_screen.dart`
- [Element details](https://github.com/amand4ngol/chemsphere/blob/main/lib/features/elements/screens/element_detailscreen/element_detail_screen.dart): `lib/features/elements/screens/element_detailscreen/element_detail_screen.dart`
- [Compound search](https://github.com/amand4ngol/chemsphere/blob/main/lib/features/compounds/compound_searhc_screen.dart): `lib/features/compounds/compound_searhc_screen.dart`
- [Compound details](https://github.com/amand4ngol/chemsphere/blob/main/lib/features/compounds/compound_details_screen.dart): `lib/features/compounds/compound_details_screen.dart`
- [Formula search](https://github.com/amand4ngol/chemsphere/blob/main/lib/features/formula/screen/formula_search_screen.dart): `lib/features/formula/screen/formula_search_screen.dart`
- [Drug explorer](https://github.com/amand4ngol/chemsphere/blob/main/lib/features/drugs/drug_search_screen.dart): `lib/features/drugs/drug_search_screen.dart`
- [Molecule viewer](https://github.com/amand4ngol/chemsphere/blob/main/lib/features/molecules_viewer/screen/molecule_viewer_screen.dart): `lib/features/molecules_viewer/screen/molecule_viewer_screen.dart`
- [PubChem access](https://github.com/amand4ngol/chemsphere/blob/main/lib/providers/base_pubchem_provider.dart): `lib/providers/base_pubchem_provider.dart`
- [Weight calculator](https://github.com/amand4ngol/chemsphere/blob/main/lib/features/molecular_weight/screens/molecular_weight_screen.dart): `lib/features/molecular_weight/screens/molecular_weight_screen.dart`

### Learning tools

- [Reaction learning](https://github.com/amand4ngol/chemsphere/blob/main/lib/features/reactions/screen/reaction_screen.dart): `lib/features/reactions/screen/reaction_screen.dart`
- [Chemistry guide](https://github.com/amand4ngol/chemsphere/blob/main/lib/features/chemistryguide/chemistry_guide_screen.dart): `lib/features/chemistryguide/chemistry_guide_screen.dart`
- [Element flashcards](https://github.com/amand4ngol/chemsphere/blob/main/lib/features/elements/screens/flashcard_screen/element_flashcard_screen.dart): `lib/features/elements/screens/flashcard_screen/element_flashcard_screen.dart`
- [Bookmarks](https://github.com/amand4ngol/chemsphere/blob/main/lib/features/bookmarks/bookmark_screen.dart): `lib/features/bookmarks/bookmark_screen.dart`

### Air quality

- [Air quality monitor](https://github.com/amand4ngol/chemsphere/blob/main/lib/features/aqi/screen/aqi_info_screen.dart): `lib/features/aqi/screen/aqi_info_screen.dart`
- [AQI state](https://github.com/amand4ngol/chemsphere/blob/main/lib/features/aqi/provider/aqi_provider.dart): `lib/features/aqi/provider/aqi_provider.dart`
- [City search](https://github.com/amand4ngol/chemsphere/blob/main/lib/features/aqi/screen/city_search_screen.dart): `lib/features/aqi/screen/city_search_screen.dart`

### Other components

- **Learner**
- **PubChem API**
- **Wikipedia**
- **Device location**
- **Air quality data**

## Connections

- Learner → App entry: opens
- App entry → Home dashboard: starts
- Home dashboard → Feature navigation: offers features
- Feature navigation → Periodic tables: opens
- Feature navigation → Compound search: opens
- Feature navigation → Formula search: opens
- Feature navigation → Drug explorer: opens
- Feature navigation → Molecule viewer: opens
- Feature navigation → Weight calculator: opens
- Feature navigation → Reaction learning: opens
- Feature navigation → Chemistry guide: opens
- Feature navigation → Element flashcards: opens
- Feature navigation → Bookmarks: opens
- Feature navigation → Air quality monitor: opens
- Periodic tables → Element details: selects element
- Formula search → Compound details: finds compound
- Compound search → Compound details: opens result
- Compound search → PubChem access: requests data
- Drug explorer → PubChem access: requests data
- PubChem access → PubChem API: queries
- Chemistry guide → Wikipedia: fetches content
- Air quality monitor → AQI state: reads air data
- City search → AQI state: requests city data
- AQI state → Device location: gets location
- AQI state → Air quality data: requests AQI
