# ai-dictionary/superaitutor architecture

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

- Interactive diagram: https://gitdiagram.com/ai-dictionary/superaitutor
- Repository: https://github.com/ai-dictionary/superaitutor

## Overview

SuperAITutor is an education platform with a web service and a React Native WebView wrapper. The documented learner journey spans role-based onboarding, AI learning support, mentor discovery, exam preparation, and progress sharing. The sampled server shows Express routing, account creation, exam handling, security utilities, and Google Sheets-backed memory. README-described AI, mentoring, teacher, and parent capabilities are included, but their server-side wiring is not established by the excerpts; those relationships are therefore documented at the feature level rather than inferred as code calls.

Main entry points: [`index.js`](https://github.com/ai-dictionary/superaitutor/blob/main/index.js) (Express server), [`views/studentSignUp.ejs`](https://github.com/ai-dictionary/superaitutor/blob/main/views/studentSignUp.ejs) (Role onboarding), [`app/app/index.js`](https://github.com/ai-dictionary/superaitutor/blob/main/app/app/index.js) (Mobile wrapper), [`config/memory.ts`](https://github.com/ai-dictionary/superaitutor/blob/main/config/memory.ts) (User memory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client apps"]
  node_mobile["Mobile wrapper<br/>[index.js]"]
  node_mobile_runtime["Mobile system<br/>[setup-system.js]"]
end

subgraph group_web["Web experience"]
  node_web_server["Express server<br/>[index.js]"]
  node_web_views["Web pages"]
  node_web_scripts["Page interactions"]
  node_onboarding["Role onboarding<br/>[studentSignUp.ejs]"]
end

subgraph group_learning["Learning features"]
  node_ai_tutor["AI mentor<br/>[aiMentor.ejs]"]
  node_career_guidance["Career guidance<br/>[aiMentor.js]"]
  node_exam_prep["Exam preparation<br/>[exam.ejs]"]
  node_teacher_feeds["Teacher feeds<br/>[teacher.ejs]"]
  node_progress["Progress updates<br/>[profile.ejs]"]
end

subgraph group_platform["Platform services"]
  node_security["Security utilities<br/>[security.ts]"]
  node_hex["HEX utilities<br/>[hex.ts]"]
  node_memory["User memory<br/>[memory.ts]"]
  node_sheets[("Google Sheets")]
  node_env_config["Runtime configuration<br/>[env-variables.ts]"]
end

node_learner(("Learners"))
node_teachers(("Teachers"))
node_parents(("Parents"))

node_learner -->|"registers"| node_onboarding
node_teachers -->|"registers"| node_onboarding
node_learner -->|"asks questions"| node_ai_tutor
node_learner -->|"seeks guidance"| node_career_guidance
node_learner -->|"practices exams"| node_exam_prep
node_learner -->|"views updates"| node_teacher_feeds
node_teachers -->|"share resources"| node_teacher_feeds
node_parents -->|"views progress"| node_progress
node_mobile -->|"uses"| node_mobile_runtime
node_mobile -.->|"loads web app"| node_web_server
node_web_server -->|"renders signup"| node_onboarding
node_web_server -->|"creates account"| node_memory
node_web_server -->|"decodes token"| node_security
node_web_server -->|"checks hosting"| node_hex
node_memory -->|"reads and writes"| node_sheets
node_web_server -->|"loads settings"| node_env_config

click node_mobile "https://github.com/ai-dictionary/superaitutor/blob/main/app/app/index.js"
click node_mobile_runtime "https://github.com/ai-dictionary/superaitutor/blob/main/app/utils/setup-system.js"
click node_web_server "https://github.com/ai-dictionary/superaitutor/blob/main/index.js"
click node_web_views "https://github.com/ai-dictionary/superaitutor/tree/main/views"
click node_web_scripts "https://github.com/ai-dictionary/superaitutor/tree/main/assets/scripts"
click node_onboarding "https://github.com/ai-dictionary/superaitutor/blob/main/views/studentSignUp.ejs"
click node_ai_tutor "https://github.com/ai-dictionary/superaitutor/blob/main/views/templates/aiMentor.ejs"
click node_career_guidance "https://github.com/ai-dictionary/superaitutor/blob/main/assets/scripts/aiMentor.js"
click node_exam_prep "https://github.com/ai-dictionary/superaitutor/blob/main/views/templates/exam.ejs"
click node_teacher_feeds "https://github.com/ai-dictionary/superaitutor/blob/main/views/templates/teacher.ejs"
click node_progress "https://github.com/ai-dictionary/superaitutor/blob/main/views/templates/profile.ejs"
click node_security "https://github.com/ai-dictionary/superaitutor/blob/main/config/security.ts"
click node_hex "https://github.com/ai-dictionary/superaitutor/blob/main/config/hex.ts"
click node_memory "https://github.com/ai-dictionary/superaitutor/blob/main/config/memory.ts"
click node_env_config "https://github.com/ai-dictionary/superaitutor/blob/main/config/env-variables.ts"

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_mobile,node_mobile_runtime toneBlue
class node_web_server,node_web_views,node_web_scripts,node_onboarding toneAmber
class node_ai_tutor,node_career_guidance,node_exam_prep,node_teacher_feeds,node_progress toneMint
class node_security,node_hex,node_memory,node_sheets,node_env_config toneRose
class node_learner,node_teachers,node_parents toneIndigo
```

## Components

### Client apps

- [Mobile wrapper](https://github.com/ai-dictionary/superaitutor/blob/main/app/app/index.js): `app/app/index.js`
- [Mobile system](https://github.com/ai-dictionary/superaitutor/blob/main/app/utils/setup-system.js): `app/utils/setup-system.js`

### Web experience

- [Express server](https://github.com/ai-dictionary/superaitutor/blob/main/index.js): `index.js`
- [Web pages](https://github.com/ai-dictionary/superaitutor/tree/main/views): `views`
- [Page interactions](https://github.com/ai-dictionary/superaitutor/tree/main/assets/scripts): `assets/scripts`
- [Role onboarding](https://github.com/ai-dictionary/superaitutor/blob/main/views/studentSignUp.ejs): `views/studentSignUp.ejs`

### Learning features

- [AI mentor](https://github.com/ai-dictionary/superaitutor/blob/main/views/templates/aiMentor.ejs): `views/templates/aiMentor.ejs`
- [Career guidance](https://github.com/ai-dictionary/superaitutor/blob/main/assets/scripts/aiMentor.js): `assets/scripts/aiMentor.js`
- [Exam preparation](https://github.com/ai-dictionary/superaitutor/blob/main/views/templates/exam.ejs): `views/templates/exam.ejs`
- [Teacher feeds](https://github.com/ai-dictionary/superaitutor/blob/main/views/templates/teacher.ejs): `views/templates/teacher.ejs`
- [Progress updates](https://github.com/ai-dictionary/superaitutor/blob/main/views/templates/profile.ejs): `views/templates/profile.ejs`

### Platform services

- [Security utilities](https://github.com/ai-dictionary/superaitutor/blob/main/config/security.ts): `config/security.ts`
- [HEX utilities](https://github.com/ai-dictionary/superaitutor/blob/main/config/hex.ts): `config/hex.ts`
- [User memory](https://github.com/ai-dictionary/superaitutor/blob/main/config/memory.ts): `config/memory.ts`
- **Google Sheets**
- [Runtime configuration](https://github.com/ai-dictionary/superaitutor/blob/main/config/env-variables.ts): `config/env-variables.ts`

### Other components

- **Learners**
- **Teachers**
- **Parents**

## Connections

- Learners → Role onboarding: registers (evidence: `README.md`)
- Teachers → Role onboarding: registers (evidence: `README.md`)
- Learners → AI mentor: asks questions (evidence: `README.md`)
- Learners → Career guidance: seeks guidance (evidence: `README.md`)
- Learners → Exam preparation: practices exams (evidence: `README.md`)
- Learners → Teacher feeds: views updates (evidence: `README.md`)
- Teachers → Teacher feeds: share resources (evidence: `README.md`)
- Parents → Progress updates: views progress (evidence: `README.md`)
- Mobile wrapper → Mobile system: uses (evidence: `app/app/index.js`)
- Mobile wrapper → Express server: loads web app
- Express server → Role onboarding: renders signup (evidence: `index.js`)
- Express server → User memory: creates account (evidence: `index.js`)
- Express server → Security utilities: decodes token (evidence: `index.js`)
- Express server → HEX utilities: checks hosting (evidence: `index.js`)
- User memory → Google Sheets: reads and writes (evidence: `config/memory.ts`)
- Express server → Runtime configuration: loads settings (evidence: `index.js`)
