# amanmauryas/cognitivelab architecture

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

- Interactive diagram: https://gitdiagram.com/amanmauryas/cognitivelab
- Repository: https://github.com/amanmauryas/cognitivelab

## Overview

This is a Flask psychometrics web app centered on participant registration or login, a Stroop assessment, and stored results that participants can review in their profiles. Admins can inspect results and manage users. The app configures the database and registers the assessment and admin blueprints; models persist users, sessions, and trials. The Stroop route and client implementation are represented from the file tree, but their behavior was not sampled, so their internal relationships are not asserted.

Main entry points: [`app.py`](https://github.com/amanmauryas/cognitivelab/blob/main/app.py) (App routes), [`core/admin.py`](https://github.com/amanmauryas/cognitivelab/blob/main/core/admin.py) (Admin routes), [`tests/stroop/routes.py`](https://github.com/amanmauryas/cognitivelab/blob/main/tests/stroop/routes.py) (Stroop routes), [`tests/stroop/templates/index.html`](https://github.com/amanmauryas/cognitivelab/blob/main/tests/stroop/templates/index.html) (Assessment page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["App routes<br/>[app.py]"]
  node_templates["Web templates"]
end

subgraph group_assessment["Stroop assessment"]
  node_stroop_routes["Stroop routes<br/>[routes.py]"]
  node_stroop_ui["Stroop interface<br/>[stroop.js]"]
  node_stroop_page["Assessment page<br/>[index.html]"]
end

subgraph group_storage["Persistence"]
  node_models[("User and test records<br/>[database.py]")]
end

subgraph group_administration["Administration"]
  node_admin_routes["Admin routes<br/>[admin.py]"]
end

node_participant(("Participant"))
node_admin_actor(("Administrator"))

node_participant -->|"uses"| node_app
node_admin_actor -->|"uses"| node_app
node_app -->|"reads and writes"| node_models
node_app -->|"registers blueprint"| node_stroop_routes
node_app -->|"registers blueprint"| node_admin_routes
node_app -->|"renders"| node_templates
node_app -->|"redirects to assessment"| node_stroop_routes
node_admin_routes -->|"reads and writes"| node_models
node_admin_routes -->|"renders"| node_templates
node_stroop_routes -.-> node_stroop_page
node_stroop_page -.-> node_stroop_ui

click node_app "https://github.com/amanmauryas/cognitivelab/blob/main/app.py"
click node_templates "https://github.com/amanmauryas/cognitivelab/tree/main/templates"
click node_stroop_routes "https://github.com/amanmauryas/cognitivelab/blob/main/tests/stroop/routes.py"
click node_stroop_ui "https://github.com/amanmauryas/cognitivelab/blob/main/tests/stroop/static/stroop.js"
click node_stroop_page "https://github.com/amanmauryas/cognitivelab/blob/main/tests/stroop/templates/index.html"
click node_models "https://github.com/amanmauryas/cognitivelab/blob/main/core/database.py"
click node_admin_routes "https://github.com/amanmauryas/cognitivelab/blob/main/core/admin.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,node_templates toneBlue
class node_stroop_routes,node_stroop_ui,node_stroop_page toneAmber
class node_models toneMint
class node_admin_routes toneRose
class node_participant,node_admin_actor toneIndigo
```

## Components

### Web application

- [App routes](https://github.com/amanmauryas/cognitivelab/blob/main/app.py): `app.py`
- [Web templates](https://github.com/amanmauryas/cognitivelab/tree/main/templates): `templates`

### Stroop assessment

- [Stroop routes](https://github.com/amanmauryas/cognitivelab/blob/main/tests/stroop/routes.py): `tests/stroop/routes.py`
- [Stroop interface](https://github.com/amanmauryas/cognitivelab/blob/main/tests/stroop/static/stroop.js): `tests/stroop/static/stroop.js`
- [Assessment page](https://github.com/amanmauryas/cognitivelab/blob/main/tests/stroop/templates/index.html): `tests/stroop/templates/index.html`

### Persistence

- [User and test records](https://github.com/amanmauryas/cognitivelab/blob/main/core/database.py): `core/database.py`

### Administration

- [Admin routes](https://github.com/amanmauryas/cognitivelab/blob/main/core/admin.py): `core/admin.py`

### Other components

- **Participant**
- **Administrator**

## Connections

- Participant → App routes: uses
- Administrator → App routes: uses
- App routes → User and test records: reads and writes (evidence: `app.py`)
- App routes → Stroop routes: registers blueprint (evidence: `app.py`)
- App routes → Admin routes: registers blueprint (evidence: `app.py`)
- App routes → Web templates: renders (evidence: `app.py`)
- App routes → Stroop routes: redirects to assessment (evidence: `app.py`)
- Admin routes → User and test records: reads and writes (evidence: `core/admin.py`)
- Admin routes → Web templates: renders (evidence: `core/admin.py`)
- Stroop routes → Assessment page
- Assessment page → Stroop interface
