# deveshp-web/focusfriends-llmintegration architecture

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

- Interactive diagram: https://gitdiagram.com/deveshp-web/focusfriends-llmintegration
- Repository: https://github.com/deveshp-web/focusfriends-llmintegration

## Overview

This repository contains a standalone student-emotion pattern flagger, not a documented dashboard or full application. Its visible workflow is to read student emotion logs and classroom context, detect and summarize patterns into alert, watch, and positive channels, then prepare classroom-oriented insight artifacts. The script’s excerpts show timestamp parsing, detection, summarization, and output-path setup, but omit parts of main; output-writing relationships are therefore marked unverified. The README adds no product detail, and no broader user-facing workflow is established.

Main entry points: [`detect_patterns.py`](https://github.com/deveshp-web/focusfriends-llmintegration/blob/main/detect_patterns.py) (Pattern flagger), [`students.jsonl`](https://github.com/deveshp-web/focusfriends-llmintegration/blob/main/students.jsonl) (Student logs), [`classrooms.jsonl`](https://github.com/deveshp-web/focusfriends-llmintegration/blob/main/classrooms.jsonl) (Classroom records), [`insights.jsonl`](https://github.com/deveshp-web/focusfriends-llmintegration/blob/main/insights.jsonl) (Insights)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_analysis["Pattern analysis"]
  node_runner["Pattern flagger<br/>[detect_patterns.py]"]
end

subgraph group_data["JSONL data"]
  node_students[("Student logs<br/>[students.jsonl]")]
  node_classrooms[("Classroom records<br/>[classrooms.jsonl]")]
  node_insights[("Insights<br/>[insights.jsonl]")]
  node_classroom_flags[("Classroom flags")]
  node_insights_meta[("Insight metadata<br/>[insights_meta.json]")]
  node_judge_cases[("Judge cases<br/>[judge_cases.jsonl]")]
end

node_runner -->|"reads logs"| node_students
node_runner -->|"loads context"| node_classrooms
node_runner -.->|"prepares output"| node_insights
node_runner -.->|"prepares output"| node_classroom_flags
node_runner -.->|"prepares output"| node_insights_meta
node_runner -.->|"sets output path"| node_judge_cases

click node_runner "https://github.com/deveshp-web/focusfriends-llmintegration/blob/main/detect_patterns.py"
click node_students "https://github.com/deveshp-web/focusfriends-llmintegration/blob/main/students.jsonl"
click node_classrooms "https://github.com/deveshp-web/focusfriends-llmintegration/blob/main/classrooms.jsonl"
click node_insights "https://github.com/deveshp-web/focusfriends-llmintegration/blob/main/insights.jsonl"
click node_classroom_flags "https://github.com/deveshp-web/focusfriends-llmintegration/blob/main/flagged_by_classroom.jsonl"
click node_insights_meta "https://github.com/deveshp-web/focusfriends-llmintegration/blob/main/insights_meta.json"
click node_judge_cases "https://github.com/deveshp-web/focusfriends-llmintegration/blob/main/judge_cases.jsonl"

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_runner toneBlue
class node_students,node_classrooms,node_insights,node_classroom_flags,node_insights_meta,node_judge_cases toneAmber
```

## Components

### Pattern analysis

- [Pattern flagger](https://github.com/deveshp-web/focusfriends-llmintegration/blob/main/detect_patterns.py): `detect_patterns.py`

### JSONL data

- [Student logs](https://github.com/deveshp-web/focusfriends-llmintegration/blob/main/students.jsonl): `students.jsonl`
- [Classroom records](https://github.com/deveshp-web/focusfriends-llmintegration/blob/main/classrooms.jsonl): `classrooms.jsonl`
- [Insights](https://github.com/deveshp-web/focusfriends-llmintegration/blob/main/insights.jsonl): `insights.jsonl`
- [Classroom flags](https://github.com/deveshp-web/focusfriends-llmintegration/blob/main/flagged_by_classroom.jsonl): `flagged_by_classroom.jsonl`
- [Insight metadata](https://github.com/deveshp-web/focusfriends-llmintegration/blob/main/insights_meta.json): `insights_meta.json`
- [Judge cases](https://github.com/deveshp-web/focusfriends-llmintegration/blob/main/judge_cases.jsonl): `judge_cases.jsonl`

## Connections

- Pattern flagger → Student logs: reads logs (evidence: `detect_patterns.py`)
- Pattern flagger → Classroom records: loads context (evidence: `detect_patterns.py`)
- Pattern flagger → Insights: prepares output
- Pattern flagger → Classroom flags: prepares output
- Pattern flagger → Insight metadata: prepares output
- Pattern flagger → Judge cases: sets output path
