# k-techpro/cognicode architecture

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

- Interactive diagram: https://gitdiagram.com/k-techpro/cognicode
- Repository: https://github.com/k-techpro/cognicode

## Overview

CogniCode is a Flask-based coding-learning platform: learners log in, choose a learning area, work through coding exercises, receive attempt-dependent guidance, and can view learning analytics. The tree contains two app/template/static trees; both app files are listed as core modules, so the graph distinguishes the root demo implementation from the CogniCode implementation. The CogniCode excerpt is incomplete, and analytics wiring and several route relationships are therefore not inferred beyond the README.

Main entry points: [`CogniCode/app.py`](https://github.com/k-techpro/cognicode/blob/main/CogniCode/app.py) (Learning catalog), [`app.py`](https://github.com/k-techpro/cognicode/blob/main/app.py) (Learning catalog), [`CogniCode/templates/problem.html`](https://github.com/k-techpro/cognicode/blob/main/CogniCode/templates/problem.html) (Problem page), [`templates/problem.html`](https://github.com/k-techpro/cognicode/blob/main/templates/problem.html) (Problem page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cogni["CogniCode app"]
  node_cog_routes["CogniCode routes<br/>[app.py]"]
  node_cog_login["Demo login<br/>[app.py]"]
  node_cog_catalog["Learning catalog<br/>[app.py]"]
  node_cog_exercises["Exercise runner<br/>[app.py]"]
  node_cog_adaptive["Adaptive guidance<br/>[app.py]"]
  node_cog_similar["Similar questions<br/>[app.py]"]
  node_cog_analytics["Analytics route<br/>[app.py]"]
end

subgraph group_rootapp["Root demo app"]
  node_root_routes["Root routes<br/>[app.py]"]
  node_root_login["Demo login<br/>[app.py]"]
  node_root_catalog["Learning catalog<br/>[app.py]"]
  node_root_exercises["Exercise runner<br/>[app.py]"]
  node_root_adaptive["Adaptive guidance<br/>[app.py]"]
  node_root_analytics["Analytics route<br/>[app.py]"]
end

subgraph group_views["Page templates"]
  node_cog_auth_view["Login page<br/>[auth.html]"]
  node_cog_home_view["Home page<br/>[home.html]"]
  node_cog_level_view["Level page<br/>[level.html]"]
  node_cog_course_view["Course page<br/>[course.html]"]
  node_cog_problem_view["Problem page<br/>[problem.html]"]
  node_cog_similar_view["Similar page<br/>[similar.html]"]
  node_cog_analytics_view["Analytics page<br/>[analytics.html]"]
  node_root_auth_view["Login page<br/>[auth.html]"]
  node_root_home_view["Home page<br/>[home.html]"]
  node_root_level_view["Level page<br/>[level.html]"]
  node_root_course_view["Course page<br/>[course.html]"]
  node_root_problem_view["Problem page<br/>[problem.html]"]
  node_root_analytics_view["Analytics page<br/>[analytics.html]"]
end

subgraph group_frontend["Browser analytics"]
  node_root_analytics_js["Analytics calculations<br/>[analytics.js]"]
  node_cog_analytics_js["Analytics calculations<br/>[analytics.js]"]
end

node_learner(("Learner"))

node_learner -->|"submits credentials"| node_cog_login
node_cog_login -->|"renders"| node_cog_auth_view
node_cog_login -->|"redirects valid login"| node_cog_catalog
node_cog_catalog -->|"renders"| node_cog_home_view
node_cog_catalog -.->|"serves levels"| node_cog_level_view
node_cog_catalog -.->|"serves courses"| node_cog_course_view
node_cog_catalog -.->|"starts questions"| node_cog_exercises
node_cog_exercises -.->|"renders"| node_cog_problem_view
node_cog_exercises -->|"updates attempts"| node_cog_adaptive
node_cog_adaptive -.->|"shows guidance"| node_cog_problem_view
node_cog_adaptive -.->|"offers after attempts"| node_cog_similar
node_cog_similar -->|"renders"| node_cog_similar_view
node_cog_analytics -.->|"renders"| node_cog_analytics_view
node_learner -->|"submits credentials"| node_root_login
node_root_login -->|"renders"| node_root_auth_view
node_root_login -->|"redirects valid login"| node_root_catalog
node_root_catalog -->|"renders"| node_root_home_view
node_root_catalog -->|"renders"| node_root_level_view
node_root_catalog -->|"renders"| node_root_course_view
node_root_catalog -.->|"opens questions"| node_root_exercises
node_root_exercises -->|"renders"| node_root_problem_view
node_root_exercises -->|"updates attempts"| node_root_adaptive
node_root_adaptive -->|"shows guidance"| node_root_problem_view
node_root_analytics -->|"renders"| node_root_analytics_view

click node_cog_routes "https://github.com/k-techpro/cognicode/blob/main/CogniCode/app.py"
click node_cog_login "https://github.com/k-techpro/cognicode/blob/main/CogniCode/app.py"
click node_cog_catalog "https://github.com/k-techpro/cognicode/blob/main/CogniCode/app.py"
click node_cog_exercises "https://github.com/k-techpro/cognicode/blob/main/CogniCode/app.py"
click node_cog_adaptive "https://github.com/k-techpro/cognicode/blob/main/CogniCode/app.py"
click node_cog_similar "https://github.com/k-techpro/cognicode/blob/main/CogniCode/app.py"
click node_cog_analytics "https://github.com/k-techpro/cognicode/blob/main/CogniCode/app.py"
click node_root_routes "https://github.com/k-techpro/cognicode/blob/main/app.py"
click node_root_login "https://github.com/k-techpro/cognicode/blob/main/app.py"
click node_root_catalog "https://github.com/k-techpro/cognicode/blob/main/app.py"
click node_root_exercises "https://github.com/k-techpro/cognicode/blob/main/app.py"
click node_root_adaptive "https://github.com/k-techpro/cognicode/blob/main/app.py"
click node_root_analytics "https://github.com/k-techpro/cognicode/blob/main/app.py"
click node_cog_auth_view "https://github.com/k-techpro/cognicode/blob/main/CogniCode/templates/auth.html"
click node_cog_home_view "https://github.com/k-techpro/cognicode/blob/main/CogniCode/templates/home.html"
click node_cog_level_view "https://github.com/k-techpro/cognicode/blob/main/CogniCode/templates/level.html"
click node_cog_course_view "https://github.com/k-techpro/cognicode/blob/main/CogniCode/templates/course.html"
click node_cog_problem_view "https://github.com/k-techpro/cognicode/blob/main/CogniCode/templates/problem.html"
click node_cog_similar_view "https://github.com/k-techpro/cognicode/blob/main/CogniCode/templates/similar.html"
click node_cog_analytics_view "https://github.com/k-techpro/cognicode/blob/main/CogniCode/templates/analytics.html"
click node_root_auth_view "https://github.com/k-techpro/cognicode/blob/main/templates/auth.html"
click node_root_home_view "https://github.com/k-techpro/cognicode/blob/main/templates/home.html"
click node_root_level_view "https://github.com/k-techpro/cognicode/blob/main/templates/level.html"
click node_root_course_view "https://github.com/k-techpro/cognicode/blob/main/templates/course.html"
click node_root_problem_view "https://github.com/k-techpro/cognicode/blob/main/templates/problem.html"
click node_root_analytics_view "https://github.com/k-techpro/cognicode/blob/main/templates/analytics.html"
click node_root_analytics_js "https://github.com/k-techpro/cognicode/blob/main/static/js/analytics.js"
click node_cog_analytics_js "https://github.com/k-techpro/cognicode/blob/main/CogniCode/static/js/analytics.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_cog_routes,node_cog_login,node_cog_catalog,node_cog_exercises,node_cog_adaptive,node_cog_similar,node_cog_analytics toneBlue
class node_root_routes,node_root_login,node_root_catalog,node_root_exercises,node_root_adaptive,node_root_analytics toneAmber
class node_cog_auth_view,node_cog_home_view,node_cog_level_view,node_cog_course_view,node_cog_problem_view,node_cog_similar_view,node_cog_analytics_view,node_root_auth_view,node_root_home_view,node_root_level_view,node_root_course_view,node_root_problem_view,node_root_analytics_view toneMint
class node_root_analytics_js,node_cog_analytics_js toneRose
class node_learner toneIndigo
```

## Components

### CogniCode app

- [CogniCode routes](https://github.com/k-techpro/cognicode/blob/main/CogniCode/app.py): `CogniCode/app.py`
- [Demo login](https://github.com/k-techpro/cognicode/blob/main/CogniCode/app.py): `CogniCode/app.py`
- [Learning catalog](https://github.com/k-techpro/cognicode/blob/main/CogniCode/app.py): `CogniCode/app.py`
- [Exercise runner](https://github.com/k-techpro/cognicode/blob/main/CogniCode/app.py): `CogniCode/app.py`
- [Adaptive guidance](https://github.com/k-techpro/cognicode/blob/main/CogniCode/app.py): `CogniCode/app.py`
- [Similar questions](https://github.com/k-techpro/cognicode/blob/main/CogniCode/app.py): `CogniCode/app.py`
- [Analytics route](https://github.com/k-techpro/cognicode/blob/main/CogniCode/app.py): `CogniCode/app.py`

### Root demo app

- [Root routes](https://github.com/k-techpro/cognicode/blob/main/app.py): `app.py`
- [Demo login](https://github.com/k-techpro/cognicode/blob/main/app.py): `app.py`
- [Learning catalog](https://github.com/k-techpro/cognicode/blob/main/app.py): `app.py`
- [Exercise runner](https://github.com/k-techpro/cognicode/blob/main/app.py): `app.py`
- [Adaptive guidance](https://github.com/k-techpro/cognicode/blob/main/app.py): `app.py`
- [Analytics route](https://github.com/k-techpro/cognicode/blob/main/app.py): `app.py`

### Page templates

- [Login page](https://github.com/k-techpro/cognicode/blob/main/CogniCode/templates/auth.html): `CogniCode/templates/auth.html`
- [Home page](https://github.com/k-techpro/cognicode/blob/main/CogniCode/templates/home.html): `CogniCode/templates/home.html`
- [Level page](https://github.com/k-techpro/cognicode/blob/main/CogniCode/templates/level.html): `CogniCode/templates/level.html`
- [Course page](https://github.com/k-techpro/cognicode/blob/main/CogniCode/templates/course.html): `CogniCode/templates/course.html`
- [Problem page](https://github.com/k-techpro/cognicode/blob/main/CogniCode/templates/problem.html): `CogniCode/templates/problem.html`
- [Similar page](https://github.com/k-techpro/cognicode/blob/main/CogniCode/templates/similar.html): `CogniCode/templates/similar.html`
- [Analytics page](https://github.com/k-techpro/cognicode/blob/main/CogniCode/templates/analytics.html): `CogniCode/templates/analytics.html`
- [Login page](https://github.com/k-techpro/cognicode/blob/main/templates/auth.html): `templates/auth.html`
- [Home page](https://github.com/k-techpro/cognicode/blob/main/templates/home.html): `templates/home.html`
- [Level page](https://github.com/k-techpro/cognicode/blob/main/templates/level.html): `templates/level.html`
- [Course page](https://github.com/k-techpro/cognicode/blob/main/templates/course.html): `templates/course.html`
- [Problem page](https://github.com/k-techpro/cognicode/blob/main/templates/problem.html): `templates/problem.html`
- [Analytics page](https://github.com/k-techpro/cognicode/blob/main/templates/analytics.html): `templates/analytics.html`

### Browser analytics

- [Analytics calculations](https://github.com/k-techpro/cognicode/blob/main/static/js/analytics.js): `static/js/analytics.js`
- [Analytics calculations](https://github.com/k-techpro/cognicode/blob/main/CogniCode/static/js/analytics.js): `CogniCode/static/js/analytics.js`

### Other components

- **Learner**

## Connections

- Learner → Demo login: submits credentials (evidence: `CogniCode/app.py`)
- Demo login → Login page: renders (evidence: `CogniCode/app.py`)
- Demo login → Learning catalog: redirects valid login (evidence: `CogniCode/app.py`)
- Learning catalog → Home page: renders (evidence: `CogniCode/app.py`)
- Learning catalog → Level page: serves levels (evidence: `README.md`)
- Learning catalog → Course page: serves courses (evidence: `README.md`)
- Learning catalog → Exercise runner: starts questions (evidence: `README.md`)
- Exercise runner → Problem page: renders (evidence: `CogniCode/app.py`)
- Exercise runner → Adaptive guidance: updates attempts (evidence: `CogniCode/app.py`)
- Adaptive guidance → Problem page: shows guidance (evidence: `README.md`)
- Adaptive guidance → Similar questions: offers after attempts (evidence: `README.md`)
- Similar questions → Similar page: renders (evidence: `CogniCode/app.py`)
- Analytics route → Analytics page: renders (evidence: `README.md`)
- Learner → Demo login: submits credentials (evidence: `app.py`)
- Demo login → Login page: renders (evidence: `app.py`)
- Demo login → Learning catalog: redirects valid login (evidence: `app.py`)
- Learning catalog → Home page: renders (evidence: `app.py`)
- Learning catalog → Level page: renders (evidence: `app.py`)
- Learning catalog → Course page: renders (evidence: `app.py`)
- Learning catalog → Exercise runner: opens questions (evidence: `README.md`)
- Exercise runner → Problem page: renders (evidence: `app.py`)
- Exercise runner → Adaptive guidance: updates attempts (evidence: `app.py`)
- Adaptive guidance → Problem page: shows guidance (evidence: `app.py`)
- Analytics route → Analytics page: renders (evidence: `app.py`)
