# ramanakilli69-spec/learnmate.ai architecture

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

- Interactive diagram: https://gitdiagram.com/ramanakilli69-spec/learnmate.ai
- Repository: https://github.com/ramanakilli69-spec/learnmate.ai

## Overview

LearnMate.ai is a student learning app for programming and mathematics. Its apparent workflow is account access, subject and topic study, quiz submission, and progress or recommendations; it also offers an AI tutor. The backend routes implement these learning and account stages, with SQLite persistence and password/session utilities. The HTML files indicate separate user screens, but their contents were not sampled, so frontend-to-API wiring is not verified. The README provides no capability details, and the AI provider relationship is visible in the backend excerpt.

Main entry points: [`database.py`](https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/database.py) (SQLite database), [`main.py`](https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/main.py) (Account and session routes), [`login.html`](https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/login.html) (Login screen), [`register.html`](https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/register.html) (Registration screen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Student screens"]
  node_login_screen["Login screen<br/>[login.html]"]
  node_register_screen["Registration screen<br/>[register.html]"]
  node_dashboard_screen["Dashboard<br/>[dashboard.html]"]
  node_subject_screen["Subject screen<br/>[subject.html]"]
  node_quiz_screen["Quiz screen<br/>[quiz.html]"]
  node_progress_screen["Progress screen<br/>[progress.html]"]
  node_tutor_screen["Tutor screen<br/>[tutor.html]"]
  node_home_screen["Home screen<br/>[index.html]"]
end

subgraph group_learning["Learning API"]
  node_catalog_api["Subjects and topics<br/>[main.py]"]
  node_quiz_api["Quiz marking<br/>[main.py]"]
  node_progress_api["Progress and suggestions<br/>[main.py]"]
  node_tutor_api["AI tutor route<br/>[main.py]"]
end

subgraph group_identity["Accounts and security"]
  node_auth_api["Account and session routes<br/>[main.py]"]
  node_security["Password and tokens<br/>[security.py]"]
end

subgraph group_storage["Persistence"]
  node_database_setup["Database setup<br/>[database.py]"]
  node_seed_data["Sample learning content<br/>[seed_data.py]"]
  node_sqlite[("SQLite database<br/>[database.py]")]
end

node_student(("Student"))
node_ai_service["AI completion service"]

node_student -.->|"uses"| node_login_screen
node_student -.->|"uses"| node_register_screen
node_student -.->|"uses"| node_dashboard_screen
node_student -.->|"uses"| node_subject_screen
node_student -.->|"uses"| node_quiz_screen
node_student -.->|"uses"| node_progress_screen
node_student -.->|"uses"| node_tutor_screen
node_student -.->|"uses"| node_home_screen
node_auth_api -->|"verifies credentials"| node_security
node_auth_api -->|"reads and writes"| node_sqlite
node_catalog_api -->|"reads"| node_sqlite
node_quiz_api -->|"reads and records"| node_sqlite
node_progress_api -->|"reads attempts"| node_sqlite
node_tutor_api -->|"requests answer"| node_ai_service
node_database_setup -->|"seeds when empty"| node_seed_data
node_database_setup -->|"creates schema"| node_sqlite

click node_login_screen "https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/login.html"
click node_register_screen "https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/register.html"
click node_dashboard_screen "https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/dashboard.html"
click node_subject_screen "https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/subject.html"
click node_quiz_screen "https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/quiz.html"
click node_progress_screen "https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/progress.html"
click node_tutor_screen "https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/tutor.html"
click node_home_screen "https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/index.html"
click node_auth_api "https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/main.py"
click node_security "https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/security.py"
click node_catalog_api "https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/main.py"
click node_quiz_api "https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/main.py"
click node_progress_api "https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/main.py"
click node_tutor_api "https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/main.py"
click node_database_setup "https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/database.py"
click node_seed_data "https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/seed_data.py"
click node_sqlite "https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/database.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_login_screen,node_register_screen,node_dashboard_screen,node_subject_screen,node_quiz_screen,node_progress_screen,node_tutor_screen,node_home_screen toneBlue
class node_catalog_api,node_quiz_api,node_progress_api,node_tutor_api toneAmber
class node_auth_api,node_security toneMint
class node_database_setup,node_seed_data,node_sqlite toneRose
class node_student,node_ai_service toneIndigo
```

## Components

### Student screens

- [Login screen](https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/login.html): `login.html`
- [Registration screen](https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/register.html): `register.html`
- [Dashboard](https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/dashboard.html): `dashboard.html`
- [Subject screen](https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/subject.html): `subject.html`
- [Quiz screen](https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/quiz.html): `quiz.html`
- [Progress screen](https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/progress.html): `progress.html`
- [Tutor screen](https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/tutor.html): `tutor.html`
- [Home screen](https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/index.html): `index.html`

### Learning API

- [Subjects and topics](https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/main.py): `main.py`
- [Quiz marking](https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/main.py): `main.py`
- [Progress and suggestions](https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/main.py): `main.py`
- [AI tutor route](https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/main.py): `main.py`

### Accounts and security

- [Account and session routes](https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/main.py): `main.py`
- [Password and tokens](https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/security.py): `security.py`

### Persistence

- [Database setup](https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/database.py): `database.py`
- [Sample learning content](https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/seed_data.py): `seed_data.py`
- [SQLite database](https://github.com/ramanakilli69-spec/learnmate.ai/blob/main/database.py): `database.py`

### Other components

- **Student**
- **AI completion service**

## Connections

- Student → Login screen: uses
- Student → Registration screen: uses
- Student → Dashboard: uses
- Student → Subject screen: uses
- Student → Quiz screen: uses
- Student → Progress screen: uses
- Student → Tutor screen: uses
- Student → Home screen: uses
- Account and session routes → Password and tokens: verifies credentials (evidence: `main.py`)
- Account and session routes → SQLite database: reads and writes (evidence: `main.py`)
- Subjects and topics → SQLite database: reads (evidence: `main.py`)
- Quiz marking → SQLite database: reads and records (evidence: `main.py`)
- Progress and suggestions → SQLite database: reads attempts (evidence: `main.py`)
- AI tutor route → AI completion service: requests answer (evidence: `main.py`)
- Database setup → Sample learning content: seeds when empty (evidence: `database.py`)
- Database setup → SQLite database: creates schema (evidence: `database.py`)
