# acha-xwx/structify architecture

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

- Interactive diagram: https://gitdiagram.com/acha-xwx/structify
- Repository: https://github.com/acha-xwx/structify

## Overview

Data Structure Agent is a course-learning platform: a learner selects classroom or animation study, uses textbook-backed explanations and algorithm demonstrations, practices code, and can review progress. The production Vue client talks to the Spring API; the README identifies Node as a legacy compatibility service. The graph focuses on the documented product capabilities and sampled Spring/DSVP internals. Several unsampled subsystems are represented by their exact source directories; their links are documented or marked unverified rather than inferred from names.

Main entry points: [`backend/spring/src/main/java/com/feng/dsagent/chat/ChatService.java`](https://github.com/acha-xwx/structify/blob/master/backend/spring/src/main/java/com/feng/dsagent/chat/ChatService.java) (AI chat), [`frontend/src/admin/routes.ts`](https://github.com/acha-xwx/structify/blob/master/frontend/src/admin/routes.ts) (Admin console), [`frontend/src/user/routes.ts`](https://github.com/acha-xwx/structify/blob/master/frontend/src/user/routes.ts) (Study entry), [`backend/spring/src/main/java/com/feng/dsagent/animation`](https://github.com/acha-xwx/structify/tree/master/backend/spring/src/main/java/com/feng/dsagent/animation) (Algorithm animation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Learning clients"]
  node_vue["Vue application<br/>[main.ts]"]
  node_study["Study entry<br/>[routes.ts]"]
end

subgraph group_learning["Learning experiences"]
  node_classroom["Script classroom"]
  node_animation["Algorithm animation"]
  node_localengine["Local DSVP engine"]
  node_dsvp["Textbook simulator"]
  node_chat["AI chat<br/>[ChatService.java]"]
  node_compiler["Code compiler"]
  node_progress["Learning progress"]
  node_courseware["Courseware browser"]
end

subgraph group_platform["Learning services"]
  node_knowledge["Textbook retrieval"]
  node_model["Model API client"]
  node_auth["Authentication<br/>[AuthService.java]"]
  node_quota[("AI quota ledger")]
  node_legacy["Legacy Node API<br/>[server.js]"]
end

subgraph group_operations["Administration"]
  node_adminui["Admin console<br/>[routes.ts]"]
  node_reviews["Review queue<br/>[ReviewService.java]"]
  node_admin["Admin services<br/>[AdminService.java]"]
  node_configuration["Model mail sandbox config"]
end

node_learner(("Learner"))
node_modelservice["AI model service"]
node_piston["Piston sandbox"]
node_userdb[("Production database")]

node_learner -.->|"uses"| node_vue
node_vue -->|"routes to"| node_study
node_study -.->|"starts classroom"| node_classroom
node_study -.->|"starts study"| node_animation
node_learner -.->|"asks"| node_chat
node_chat -->|"retrieves evidence"| node_knowledge
node_chat -->|"requests answer"| node_model
node_model -.->|"calls"| node_modelservice
node_learner -.->|"requests demo"| node_animation
node_animation -.->|"simulates"| node_localengine
node_localengine -.->|"dispatches"| node_dsvp
node_learner -.->|"runs code"| node_compiler
node_compiler -.->|"executes code"| node_piston
node_learner -.->|"browses"| node_courseware
node_learner -.->|"views progress"| node_progress
node_learner -.->|"signs in"| node_auth
node_chat -.->|"uses quota"| node_quota
node_adminui -.->|"manages reviews"| node_reviews
node_adminui -.->|"manages users"| node_admin
node_adminui -.->|"configures services"| node_configuration
node_learner -.->|"legacy routes"| node_legacy
node_auth -.->|"persists accounts"| node_userdb
node_knowledge -.->|"loads corpus"| node_userdb
node_progress -.->|"stores progress"| node_userdb

click node_vue "https://github.com/acha-xwx/structify/blob/master/frontend/src/main.ts"
click node_study "https://github.com/acha-xwx/structify/blob/master/frontend/src/user/routes.ts"
click node_classroom "https://github.com/acha-xwx/structify/tree/master/backend/spring/src/main/java/com/feng/dsagent/classroom"
click node_animation "https://github.com/acha-xwx/structify/tree/master/backend/spring/src/main/java/com/feng/dsagent/animation"
click node_localengine "https://github.com/acha-xwx/structify/blob/master/backend/spring/src/main/java/com/feng/dsagent/animation/DsvpLocalEngine.java"
click node_dsvp "https://github.com/acha-xwx/structify/blob/master/backend/dsvp/engine/textbook-animation-engine.js"
click node_chat "https://github.com/acha-xwx/structify/blob/master/backend/spring/src/main/java/com/feng/dsagent/chat/ChatService.java"
click node_knowledge "https://github.com/acha-xwx/structify/blob/master/backend/spring/src/main/java/com/feng/dsagent/knowledge/KnowledgeSearchService.java"
click node_model "https://github.com/acha-xwx/structify/tree/master/backend/spring/src/main/java/com/feng/dsagent/model"
click node_compiler "https://github.com/acha-xwx/structify/tree/master/backend/spring/src/main/java/com/feng/dsagent/compiler"
click node_progress "https://github.com/acha-xwx/structify/tree/master/backend/spring/src/main/java/com/feng/dsagent/learning"
click node_courseware "https://github.com/acha-xwx/structify/tree/master/backend/spring/src/main/java/com/feng/dsagent/presentation"
click node_auth "https://github.com/acha-xwx/structify/blob/master/backend/spring/src/main/java/com/feng/dsagent/auth/AuthService.java"
click node_quota "https://github.com/acha-xwx/structify/blob/master/backend/spring/src/main/java/com/feng/dsagent/aiquota/AiQuotaLedgerService.java"
click node_adminui "https://github.com/acha-xwx/structify/blob/master/frontend/src/admin/routes.ts"
click node_reviews "https://github.com/acha-xwx/structify/blob/master/backend/spring/src/main/java/com/feng/dsagent/review/ReviewService.java"
click node_admin "https://github.com/acha-xwx/structify/blob/master/backend/spring/src/main/java/com/feng/dsagent/admin/AdminService.java"
click node_configuration "https://github.com/acha-xwx/structify/tree/master/backend/spring/src/main/java/com/feng/dsagent/modelconfig"
click node_legacy "https://github.com/acha-xwx/structify/blob/master/backend/node/server.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_vue,node_study toneBlue
class node_classroom,node_animation,node_localengine,node_dsvp,node_chat,node_compiler,node_progress,node_courseware,node_userdb toneAmber
class node_knowledge,node_model,node_auth,node_quota,node_legacy toneMint
class node_adminui,node_reviews,node_admin,node_configuration toneRose
class node_learner,node_modelservice,node_piston toneIndigo
```

## Components

### Learning clients

- [Vue application](https://github.com/acha-xwx/structify/blob/master/frontend/src/main.ts): `frontend/src/main.ts`
- [Study entry](https://github.com/acha-xwx/structify/blob/master/frontend/src/user/routes.ts): `frontend/src/user/routes.ts`

### Learning experiences

- [Script classroom](https://github.com/acha-xwx/structify/tree/master/backend/spring/src/main/java/com/feng/dsagent/classroom): `backend/spring/src/main/java/com/feng/dsagent/classroom`
- [Algorithm animation](https://github.com/acha-xwx/structify/tree/master/backend/spring/src/main/java/com/feng/dsagent/animation): `backend/spring/src/main/java/com/feng/dsagent/animation`
- [Local DSVP engine](https://github.com/acha-xwx/structify/blob/master/backend/spring/src/main/java/com/feng/dsagent/animation/DsvpLocalEngine.java): `backend/spring/src/main/java/com/feng/dsagent/animation/DsvpLocalEngine.java`
- [Textbook simulator](https://github.com/acha-xwx/structify/blob/master/backend/dsvp/engine/textbook-animation-engine.js): `backend/dsvp/engine/textbook-animation-engine.js`
- [AI chat](https://github.com/acha-xwx/structify/blob/master/backend/spring/src/main/java/com/feng/dsagent/chat/ChatService.java): `backend/spring/src/main/java/com/feng/dsagent/chat/ChatService.java`
- [Code compiler](https://github.com/acha-xwx/structify/tree/master/backend/spring/src/main/java/com/feng/dsagent/compiler): `backend/spring/src/main/java/com/feng/dsagent/compiler`
- [Learning progress](https://github.com/acha-xwx/structify/tree/master/backend/spring/src/main/java/com/feng/dsagent/learning): `backend/spring/src/main/java/com/feng/dsagent/learning`
- [Courseware browser](https://github.com/acha-xwx/structify/tree/master/backend/spring/src/main/java/com/feng/dsagent/presentation): `backend/spring/src/main/java/com/feng/dsagent/presentation`

### Learning services

- [Textbook retrieval](https://github.com/acha-xwx/structify/blob/master/backend/spring/src/main/java/com/feng/dsagent/knowledge/KnowledgeSearchService.java): `backend/spring/src/main/java/com/feng/dsagent/knowledge/KnowledgeSearchService.java`
- [Model API client](https://github.com/acha-xwx/structify/tree/master/backend/spring/src/main/java/com/feng/dsagent/model): `backend/spring/src/main/java/com/feng/dsagent/model`
- [Authentication](https://github.com/acha-xwx/structify/blob/master/backend/spring/src/main/java/com/feng/dsagent/auth/AuthService.java): `backend/spring/src/main/java/com/feng/dsagent/auth/AuthService.java`
- [AI quota ledger](https://github.com/acha-xwx/structify/blob/master/backend/spring/src/main/java/com/feng/dsagent/aiquota/AiQuotaLedgerService.java): `backend/spring/src/main/java/com/feng/dsagent/aiquota/AiQuotaLedgerService.java`
- [Legacy Node API](https://github.com/acha-xwx/structify/blob/master/backend/node/server.js): `backend/node/server.js`

### Administration

- [Admin console](https://github.com/acha-xwx/structify/blob/master/frontend/src/admin/routes.ts): `frontend/src/admin/routes.ts`
- [Review queue](https://github.com/acha-xwx/structify/blob/master/backend/spring/src/main/java/com/feng/dsagent/review/ReviewService.java): `backend/spring/src/main/java/com/feng/dsagent/review/ReviewService.java`
- [Admin services](https://github.com/acha-xwx/structify/blob/master/backend/spring/src/main/java/com/feng/dsagent/admin/AdminService.java): `backend/spring/src/main/java/com/feng/dsagent/admin/AdminService.java`
- [Model mail sandbox config](https://github.com/acha-xwx/structify/tree/master/backend/spring/src/main/java/com/feng/dsagent/modelconfig): `backend/spring/src/main/java/com/feng/dsagent/modelconfig`

### Other components

- **Learner**
- **AI model service**
- **Piston sandbox**
- **Production database**

## Connections

- Learner → Vue application: uses (evidence: `README.md`)
- Vue application → Study entry: routes to (evidence: `frontend/src/user/routes.ts`)
- Study entry → Script classroom: starts classroom (evidence: `README.md`)
- Study entry → Algorithm animation: starts study (evidence: `README.md`)
- Learner → AI chat: asks (evidence: `README.md`)
- AI chat → Textbook retrieval: retrieves evidence (evidence: `backend/spring/src/main/java/com/feng/dsagent/chat/ChatService.java`)
- AI chat → Model API client: requests answer (evidence: `backend/spring/src/main/java/com/feng/dsagent/chat/ChatService.java`)
- Model API client → AI model service: calls (evidence: `README.md`)
- Learner → Algorithm animation: requests demo (evidence: `README.md`)
- Algorithm animation → Local DSVP engine: simulates (evidence: `README.md`)
- Local DSVP engine → Textbook simulator: dispatches (evidence: `README.md`)
- Learner → Code compiler: runs code (evidence: `README.md`)
- Code compiler → Piston sandbox: executes code (evidence: `README.md`)
- Learner → Courseware browser: browses (evidence: `README.md`)
- Learner → Learning progress: views progress (evidence: `README.md`)
- Learner → Authentication: signs in (evidence: `README.md`)
- AI chat → AI quota ledger: uses quota (evidence: `README.md`)
- Admin console → Review queue: manages reviews (evidence: `README.md`)
- Admin console → Admin services: manages users (evidence: `README.md`)
- Admin console → Model mail sandbox config: configures services (evidence: `README.md`)
- Learner → Legacy Node API: legacy routes (evidence: `README.md`)
- Authentication → Production database: persists accounts (evidence: `README.md`)
- Textbook retrieval → Production database: loads corpus (evidence: `README.md`)
- Learning progress → Production database: stores progress (evidence: `README.md`)
