# ds-ai-gate/dsai-gate architecture

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

- Interactive diagram: https://gitdiagram.com/ds-ai-gate/dsai-gate
- Repository: https://github.com/ds-ai-gate/dsai-gate

## Overview

#### Purpose and Entry Points
DSAI-GATE is a curated, syllabus-aligned learning repository for the GATE Data Science and AI exam. Its primary human entry point is `README.md`, which links topic guides and practice assets. Its deployable entry point is the syllabus-explorer application in `webapp/app.py`, built into a static GitHub Pages site.

#### Curriculum Content Layer
Topic-level Markdown files organize external links, notes, courses, and practice material by syllabus domain:
- `Probability-Statistics-Readme.md`
- `Machine-Learning-Readme.md`
- `Artificial-Intelligence-Readme.md`

These documents are the authoritative navigational content for the repository’s subject structure. `Resources.md` and `Topic_Resources/` supplement them with cross-topic materials and standalone conceptual notes.

#### Local Learning Assets
The repository stores study artifacts directly rather than serving data from a database or remote content API. Major asset groups are:
- `Data/` — topic folders, PDFs, cheat sheets, and indexes.
- `PYQ/` — official previous-year papers, answer keys, and `PYQ/SHA256SUMS` integrity metadata.
- `notebooks/` — executable/printable instructional notebooks across ML, probability, algebra, and algorithms.

Notebook content is both educational material and a reproducible-code boundary; examples include `notebooks/machine_learning/kmeans_from_scratch.ipynb` and `notebooks/probability/conditional_probability_and_bayes.ipynb`.

#### Static Explorer Application
`webapp/` is a Python-backed static-site generator, not a persistent web service:
- `webapp/app.py` is the application/export entry point.
- `webapp/content.py` derives explorer content from repository materials.
- `webapp/build.py` assembles the static export.
- `webapp/templates/index.html`, `webapp/static/app.js`, and `webapp/static/styles.css` define browser presentation and interactivity.

The flow is repository content → Python content/build stages → generated HTML/CSS/JS artifact → GitHub Pages. Dependencies are isolated in `webapp/requirements.txt`; no database, authentication layer, or server-side external service is indicated.

#### Content Generation and Validation
Supporting scripts provide repository-maintenance boundaries:
- `scripts/build_example_notebooks.py` builds example notebooks.
- `scripts/check_new_links.py` checks newly introduced links.
- `fix_links.py` supports link remediation.

The webapp has a direct test surface in `webapp/tests.py`; repository link-check behavior is covered by `scripts/test_check_new_links.py`. These controls protect a content-heavy repository where broken external references are a material quality risk.

#### Delivery Infrastructure
GitHub Actions is the runtime infrastructure:
- `.github/workflows/pages.yml` builds/tests relevant changes and publishes the static explorer to GitHub Pages on `main`.
- `.github/workflows/repository-checks.yml` provides repository validation.

The deployed external endpoint is GitHub Pages (`ds-ai-gate.github.io/dsai-gate/`). External dependencies are primarily linked educational resources, official GATE syllabus/paper sources, GitHub Actions, and GitHub Pages.

#### Maintenance Direction
Maintainer plans and operating constraints are documented separately from end-user curriculum:
- `docs/implementation_plan.md`
- `docs/webapp.md`
- `docs/agent.md`

This separates evolving product/deployment decisions from durable study content, while pull-request-based collaboration governs changes.

Main entry points: [`webapp/content.py`](https://github.com/ds-ai-gate/dsai-gate/blob/main/webapp/content.py) (Content derivation), [`.github/workflows/pages.yml`](https://github.com/ds-ai-gate/dsai-gate/blob/main/.github/workflows/pages.yml) (Pages workflow), [`webapp/build.py`](https://github.com/ds-ai-gate/dsai-gate/blob/main/webapp/build.py) (Static export builder), [`README.md`](https://github.com/ds-ai-gate/dsai-gate/blob/main/README.md) (Repository entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_curriculum["Curriculum"]
  node_readme["Repository entry<br/>Markdown index<br/>[README.md]"]
  node_topic_guides["Syllabus topic guides<br/>Markdown curriculum"]
  node_supplementary_resources["Supplementary resources<br/>Markdown and notes<br/>[Resources.md]"]
end

subgraph group_assets["Learning Assets"]
  node_study_data["Study data library<br/>PDFs and cheat sheets"]
  node_pyq_archive["Previous-year papers<br/>Papers and answer keys"]
  node_notebooks["Instructional notebooks<br/>Executable notebooks"]
end

subgraph group_explorer["Static Explorer"]
  node_app_entry["Explorer application<br/>Python entry point<br/>[app.py]"]
  node_content_derivation["Content derivation<br/>Python content layer<br/>[content.py]"]
  node_static_build["Static export builder<br/>Python build stage<br/>[build.py]"]
  node_browser_ui["Explorer browser UI<br/>HTML, JS, CSS<br/>[index.html]"]
end

subgraph group_automation["Build &amp; Delivery"]
  node_notebook_builder["Example notebook builder<br/>Maintenance script"]
  node_link_validation["Link validation<br/>Maintenance scripts<br/>[check_new_links.py]"]
  node_webapp_tests["Explorer tests<br/>Python tests<br/>[tests.py]"]
  node_pages_workflow{{"Pages workflow<br/>GitHub Actions<br/>[pages.yml]"}}
  node_repository_checks{{"Repository checks<br/>GitHub Actions"}}
end

node_github_pages(("GitHub Pages<br/>Static hosting"))
node_maintainer_docs["Maintainer guidance<br/>Planning documentation"]

node_readme -->|"links to"| node_topic_guides
node_readme -->|"links to"| node_supplementary_resources
node_topic_guides -->|"organizes"| node_study_data
node_topic_guides -->|"points learners to"| node_pyq_archive
node_topic_guides -->|"points learners to"| node_notebooks
node_supplementary_resources -.->|"supplements"| node_study_data
node_study_data -->|"source material"| node_content_derivation
node_pyq_archive -->|"source material"| node_content_derivation
node_notebooks -->|"source material"| node_content_derivation
node_topic_guides -->|"curriculum structure"| node_content_derivation
node_notebook_builder -->|"generates examples"| node_notebooks
node_app_entry -->|"uses"| node_content_derivation
node_content_derivation -->|"provides explorer content"| node_static_build
node_static_build -->|"renders static site"| node_browser_ui
node_link_validation -.->|"checks external links"| node_topic_guides
node_repository_checks -->|"runs validation"| node_link_validation
node_pages_workflow -->|"runs"| node_webapp_tests
node_pages_workflow -->|"builds"| node_static_build
node_pages_workflow -->|"publishes"| node_github_pages
node_maintainer_docs -.->|"documents deployment"| node_pages_workflow

click node_readme "https://github.com/ds-ai-gate/dsai-gate/blob/main/README.md"
click node_supplementary_resources "https://github.com/ds-ai-gate/dsai-gate/blob/main/Resources.md"
click node_app_entry "https://github.com/ds-ai-gate/dsai-gate/blob/main/webapp/app.py"
click node_content_derivation "https://github.com/ds-ai-gate/dsai-gate/blob/main/webapp/content.py"
click node_static_build "https://github.com/ds-ai-gate/dsai-gate/blob/main/webapp/build.py"
click node_browser_ui "https://github.com/ds-ai-gate/dsai-gate/blob/main/webapp/templates/index.html"
click node_notebook_builder "https://github.com/ds-ai-gate/dsai-gate/blob/main/scripts/build_example_notebooks.py"
click node_link_validation "https://github.com/ds-ai-gate/dsai-gate/blob/main/scripts/check_new_links.py"
click node_webapp_tests "https://github.com/ds-ai-gate/dsai-gate/blob/main/webapp/tests.py"
click node_pages_workflow "https://github.com/ds-ai-gate/dsai-gate/blob/main/.github/workflows/pages.yml"
click node_repository_checks "https://github.com/ds-ai-gate/dsai-gate/blob/main/.github/workflows/repository-checks.yml"
click node_maintainer_docs "https://github.com/ds-ai-gate/dsai-gate/blob/main/docs/implementation_plan.md"

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_readme,node_topic_guides,node_supplementary_resources toneBlue
class node_study_data,node_pyq_archive,node_notebooks toneAmber
class node_app_entry,node_content_derivation,node_static_build,node_browser_ui toneMint
class node_notebook_builder,node_link_validation,node_webapp_tests,node_pages_workflow,node_repository_checks toneRose
class node_github_pages,node_maintainer_docs toneNeutral
```

## Components

### Curriculum

- [Repository entry](https://github.com/ds-ai-gate/dsai-gate/blob/main/README.md): Markdown index · Primary human navigation entry point. · `README.md`
- **Syllabus topic guides**: Markdown curriculum · Authoritative subject navigation across probability, ML, and AI.
- [Supplementary resources](https://github.com/ds-ai-gate/dsai-gate/blob/main/Resources.md): Markdown and notes · `Resources.md`

### Learning Assets

- **Study data library**: PDFs and cheat sheets
- **Previous-year papers**: Papers and answer keys · Includes SHA-256 integrity metadata.
- **Instructional notebooks**: Executable notebooks · Reproducible learning examples across syllabus areas.

### Static Explorer

- [Explorer application](https://github.com/ds-ai-gate/dsai-gate/blob/main/webapp/app.py): Python entry point · `webapp/app.py`
- [Content derivation](https://github.com/ds-ai-gate/dsai-gate/blob/main/webapp/content.py): Python content layer · Builds explorer content from repository materials. · `webapp/content.py`
- [Static export builder](https://github.com/ds-ai-gate/dsai-gate/blob/main/webapp/build.py): Python build stage · `webapp/build.py`
- [Explorer browser UI](https://github.com/ds-ai-gate/dsai-gate/blob/main/webapp/templates/index.html): HTML, JS, CSS · `webapp/templates/index.html`

### Build & Delivery

- [Example notebook builder](https://github.com/ds-ai-gate/dsai-gate/blob/main/scripts/build_example_notebooks.py): Maintenance script · `scripts/build_example_notebooks.py`
- [Link validation](https://github.com/ds-ai-gate/dsai-gate/blob/main/scripts/check_new_links.py): Maintenance scripts · Checks new links and supports remediation. · `scripts/check_new_links.py`
- [Explorer tests](https://github.com/ds-ai-gate/dsai-gate/blob/main/webapp/tests.py): Python tests · `webapp/tests.py`
- [Pages workflow](https://github.com/ds-ai-gate/dsai-gate/blob/main/.github/workflows/pages.yml): GitHub Actions · Tests, builds, and publishes changes from main. · `.github/workflows/pages.yml`
- [Repository checks](https://github.com/ds-ai-gate/dsai-gate/blob/main/.github/workflows/repository-checks.yml): GitHub Actions · `.github/workflows/repository-checks.yml`

### Other components

- **GitHub Pages**: Static hosting · Public deployment endpoint.
- [Maintainer guidance](https://github.com/ds-ai-gate/dsai-gate/blob/main/docs/implementation_plan.md): Planning documentation · Separates operating decisions from learner curriculum. · `docs/implementation_plan.md`

## Connections

- Repository entry → Syllabus topic guides: links to
- Repository entry → Supplementary resources: links to
- Syllabus topic guides → Study data library: organizes
- Syllabus topic guides → Previous-year papers: points learners to
- Syllabus topic guides → Instructional notebooks: points learners to
- Supplementary resources → Study data library: supplements
- Study data library → Content derivation: source material
- Previous-year papers → Content derivation: source material
- Instructional notebooks → Content derivation: source material
- Syllabus topic guides → Content derivation: curriculum structure
- Example notebook builder → Instructional notebooks: generates examples
- Explorer application → Content derivation: uses
- Content derivation → Static export builder: provides explorer content
- Static export builder → Explorer browser UI: renders static site
- Link validation → Syllabus topic guides: checks external links
- Repository checks → Link validation: runs validation
- Pages workflow → Explorer tests: runs
- Pages workflow → Static export builder: builds
- Pages workflow → GitHub Pages: publishes
- Maintainer guidance → Pages workflow: documents deployment
