# rbwnb/so-ai-edu architecture

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

- Interactive diagram: https://gitdiagram.com/rbwnb/so-ai-edu
- Repository: https://github.com/rbwnb/so-ai-edu

## Overview

Ocean Academy is a Vue/Spring marine-life education platform for learners and administrators. Learners browse species, use AI identification and knowledge Q&A, participate in observation posts, take quizzes, and earn or redeem points; administrators manage content, users, roles, and operations. The frontend calls backend APIs, while the backend provides domain endpoints and persistence. The RAG path is evidenced in sampled controller and service code; other capability links reflect the README and module tree, whose implementation details were not sampled.

Main entry points: [`frontend/src/utils/http.js`](https://github.com/rbwnb/so-ai-edu/blob/master/frontend/src/utils/http.js) (HTTP client), [`frontend/src/router/index.js`](https://github.com/rbwnb/so-ai-edu/blob/master/frontend/src/router/index.js) (Routes and layouts), [`backend/src/main/java/com/gdou/marine/service/impl/RagQaServiceImpl.java`](https://github.com/rbwnb/so-ai-edu/blob/master/backend/src/main/java/com/gdou/marine/service/impl/RagQaServiceImpl.java) (RAG orchestration), [`backend/src/main/java/com/gdou/marine/controller/RagController.java`](https://github.com/rbwnb/so-ai-edu/blob/master/backend/src/main/java/com/gdou/marine/controller/RagController.java) (RAG and documents)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Learner experience"]
  node_webapp["Vue application<br/>[main.js]"]
  node_router["Routes and layouts<br/>[index.js]"]
  node_http["HTTP client<br/>[http.js]"]
  node_speciesview["Species browsing<br/>[Index.vue]"]
  node_quizview["Quiz and review<br/>[Index.vue]"]
  node_communityview["Observation community<br/>[Index.vue]"]
  node_ragview["RAG chat<br/>[RagChatWindow.vue]"]
end

subgraph group_domain["Education and community"]
  node_speciesapi["Species endpoints<br/>[species.js]"]
  node_speciescontroller["Species API"]
  node_quizapi["Quiz endpoints<br/>[quiz.js]"]
  node_examcontroller["Quiz and exam APIs"]
  node_observationcontroller["Observation API"]
  node_pointscontroller["Points and shop"]
  node_highlight["Community highlights"]
end

subgraph group_ai["AI knowledge services"]
  node_identify["AI identification"]
  node_ragapi["RAG endpoints<br/>[rag.js]"]
  node_ragcontroller["RAG and documents<br/>[RagController.java]"]
  node_ragservice["RAG orchestration"]
  node_vectorstore[("Redis vector store")]
  node_llm["AI model services<br/>[SaaLLMConfig.java]"]
end

subgraph group_admin["Administration"]
  node_adminui["Admin console<br/>[AdminLayout.vue]"]
  node_adminapi["Knowledge management<br/>[knowledge.js]"]
  node_admincontroller["User and role APIs"]
end

subgraph group_platform["Backend platform"]
  node_security["JWT and RBAC"]
  node_mysql[("MySQL records")]
end

node_learner(("Learner"))

node_learner -->|"uses"| node_webapp
node_webapp -->|"renders routes"| node_router
node_router -->|"routes to"| node_speciesview
node_router -->|"routes to"| node_quizview
node_router -->|"routes to"| node_communityview
node_speciesview -->|"requests data"| node_speciesapi
node_speciesapi -->|"sends requests"| node_http
node_http -->|"calls API"| node_speciescontroller
node_quizview -->|"requests quizzes"| node_quizapi
node_quizapi -->|"sends requests"| node_http
node_http -->|"calls API"| node_examcontroller
node_communityview -->|"uses API"| node_http
node_http -->|"calls API"| node_observationcontroller
node_learner -->|"asks questions"| node_ragview
node_ragview -->|"loads chat data"| node_ragapi
node_ragapi -->|"sends requests"| node_http
node_http -->|"calls API"| node_ragcontroller
node_ragcontroller -->|"delegates Q&amp;A"| node_ragservice
node_ragservice -->|"retrieves context"| node_vectorstore
node_ragservice -->|"requests responses"| node_llm
node_ragservice -->|"stores conversation"| node_mysql
node_adminui -->|"manages documents"| node_adminapi
node_adminapi -->|"sends requests"| node_http
node_http -->|"calls API"| node_ragcontroller
node_adminui -->|"manages accounts"| node_admincontroller
node_pointscontroller -->|"reads and writes"| node_mysql
node_observationcontroller -->|"reads and writes"| node_mysql
node_security -->|"authenticates requests"| node_http
node_highlight -->|"generates copy"| node_llm
node_highlight -->|"reads posts and sends notices"| node_mysql

click node_webapp "https://github.com/rbwnb/so-ai-edu/blob/master/frontend/src/main.js"
click node_router "https://github.com/rbwnb/so-ai-edu/blob/master/frontend/src/router/index.js"
click node_http "https://github.com/rbwnb/so-ai-edu/blob/master/frontend/src/utils/http.js"
click node_speciesview "https://github.com/rbwnb/so-ai-edu/blob/master/frontend/src/views/edu/encyclopedia/Index.vue"
click node_quizview "https://github.com/rbwnb/so-ai-edu/blob/master/frontend/src/views/edu/quiz/Index.vue"
click node_communityview "https://github.com/rbwnb/so-ai-edu/blob/master/frontend/src/views/edu/obs-community/Index.vue"
click node_ragview "https://github.com/rbwnb/so-ai-edu/blob/master/frontend/src/components/RagChatWindow.vue"
click node_speciesapi "https://github.com/rbwnb/so-ai-edu/blob/master/frontend/src/api/species.js"
click node_speciescontroller "https://github.com/rbwnb/so-ai-edu/blob/master/backend/src/main/java/com/gdou/marine/controller/SpeciesController.java"
click node_quizapi "https://github.com/rbwnb/so-ai-edu/blob/master/frontend/src/api/quiz.js"
click node_examcontroller "https://github.com/rbwnb/so-ai-edu/blob/master/backend/src/main/java/com/gdou/marine/controller/ExamController.java"
click node_observationcontroller "https://github.com/rbwnb/so-ai-edu/blob/master/backend/src/main/java/com/gdou/marine/controller/UserObservationController.java"
click node_pointscontroller "https://github.com/rbwnb/so-ai-edu/blob/master/backend/src/main/java/com/gdou/marine/controller/PointsController.java"
click node_identify "https://github.com/rbwnb/so-ai-edu/blob/master/backend/src/main/java/com/gdou/marine/controller/VisualController.java"
click node_ragapi "https://github.com/rbwnb/so-ai-edu/blob/master/frontend/src/api/rag.js"
click node_ragcontroller "https://github.com/rbwnb/so-ai-edu/blob/master/backend/src/main/java/com/gdou/marine/controller/RagController.java"
click node_ragservice "https://github.com/rbwnb/so-ai-edu/blob/master/backend/src/main/java/com/gdou/marine/service/impl/RagQaServiceImpl.java"
click node_vectorstore "https://github.com/rbwnb/so-ai-edu/blob/master/backend/src/main/java/com/gdou/marine/config/RedisVectorStore.java"
click node_adminui "https://github.com/rbwnb/so-ai-edu/blob/master/frontend/src/layout/AdminLayout.vue"
click node_adminapi "https://github.com/rbwnb/so-ai-edu/blob/master/frontend/src/api/knowledge.js"
click node_admincontroller "https://github.com/rbwnb/so-ai-edu/blob/master/backend/src/main/java/com/gdou/marine/controller/SysUserController.java"
click node_security "https://github.com/rbwnb/so-ai-edu/blob/master/backend/src/main/java/com/gdou/marine/config/SecurityConfig.java"
click node_highlight "https://github.com/rbwnb/so-ai-edu/blob/master/backend/src/main/java/com/gdou/marine/service/HighlightBroadcastService.java"
click node_llm "https://github.com/rbwnb/so-ai-edu/blob/master/backend/src/main/java/com/gdou/marine/config/SaaLLMConfig.java"

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_webapp,node_router,node_http,node_speciesview,node_quizview,node_communityview,node_ragview toneBlue
class node_speciesapi,node_speciescontroller,node_quizapi,node_examcontroller,node_observationcontroller,node_pointscontroller,node_highlight toneAmber
class node_identify,node_ragapi,node_ragcontroller,node_ragservice,node_vectorstore,node_llm toneMint
class node_adminui,node_adminapi,node_admincontroller toneRose
class node_security,node_mysql,node_learner toneIndigo
```

## Components

### Learner experience

- [Vue application](https://github.com/rbwnb/so-ai-edu/blob/master/frontend/src/main.js): `frontend/src/main.js`
- [Routes and layouts](https://github.com/rbwnb/so-ai-edu/blob/master/frontend/src/router/index.js): `frontend/src/router/index.js`
- [HTTP client](https://github.com/rbwnb/so-ai-edu/blob/master/frontend/src/utils/http.js): `frontend/src/utils/http.js`
- [Species browsing](https://github.com/rbwnb/so-ai-edu/blob/master/frontend/src/views/edu/encyclopedia/Index.vue): `frontend/src/views/edu/encyclopedia/Index.vue`
- [Quiz and review](https://github.com/rbwnb/so-ai-edu/blob/master/frontend/src/views/edu/quiz/Index.vue): `frontend/src/views/edu/quiz/Index.vue`
- [Observation community](https://github.com/rbwnb/so-ai-edu/blob/master/frontend/src/views/edu/obs-community/Index.vue): `frontend/src/views/edu/obs-community/Index.vue`
- [RAG chat](https://github.com/rbwnb/so-ai-edu/blob/master/frontend/src/components/RagChatWindow.vue): `frontend/src/components/RagChatWindow.vue`

### Education and community

- [Species endpoints](https://github.com/rbwnb/so-ai-edu/blob/master/frontend/src/api/species.js): `frontend/src/api/species.js`
- [Species API](https://github.com/rbwnb/so-ai-edu/blob/master/backend/src/main/java/com/gdou/marine/controller/SpeciesController.java): `backend/src/main/java/com/gdou/marine/controller/SpeciesController.java`
- [Quiz endpoints](https://github.com/rbwnb/so-ai-edu/blob/master/frontend/src/api/quiz.js): `frontend/src/api/quiz.js`
- [Quiz and exam APIs](https://github.com/rbwnb/so-ai-edu/blob/master/backend/src/main/java/com/gdou/marine/controller/ExamController.java): `backend/src/main/java/com/gdou/marine/controller/ExamController.java`
- [Observation API](https://github.com/rbwnb/so-ai-edu/blob/master/backend/src/main/java/com/gdou/marine/controller/UserObservationController.java): `backend/src/main/java/com/gdou/marine/controller/UserObservationController.java`
- [Points and shop](https://github.com/rbwnb/so-ai-edu/blob/master/backend/src/main/java/com/gdou/marine/controller/PointsController.java): `backend/src/main/java/com/gdou/marine/controller/PointsController.java`
- [Community highlights](https://github.com/rbwnb/so-ai-edu/blob/master/backend/src/main/java/com/gdou/marine/service/HighlightBroadcastService.java): `backend/src/main/java/com/gdou/marine/service/HighlightBroadcastService.java`

### AI knowledge services

- [AI identification](https://github.com/rbwnb/so-ai-edu/blob/master/backend/src/main/java/com/gdou/marine/controller/VisualController.java): `backend/src/main/java/com/gdou/marine/controller/VisualController.java`
- [RAG endpoints](https://github.com/rbwnb/so-ai-edu/blob/master/frontend/src/api/rag.js): `frontend/src/api/rag.js`
- [RAG and documents](https://github.com/rbwnb/so-ai-edu/blob/master/backend/src/main/java/com/gdou/marine/controller/RagController.java): `backend/src/main/java/com/gdou/marine/controller/RagController.java`
- [RAG orchestration](https://github.com/rbwnb/so-ai-edu/blob/master/backend/src/main/java/com/gdou/marine/service/impl/RagQaServiceImpl.java): `backend/src/main/java/com/gdou/marine/service/impl/RagQaServiceImpl.java`
- [Redis vector store](https://github.com/rbwnb/so-ai-edu/blob/master/backend/src/main/java/com/gdou/marine/config/RedisVectorStore.java): `backend/src/main/java/com/gdou/marine/config/RedisVectorStore.java`
- [AI model services](https://github.com/rbwnb/so-ai-edu/blob/master/backend/src/main/java/com/gdou/marine/config/SaaLLMConfig.java): `backend/src/main/java/com/gdou/marine/config/SaaLLMConfig.java`

### Administration

- [Admin console](https://github.com/rbwnb/so-ai-edu/blob/master/frontend/src/layout/AdminLayout.vue): `frontend/src/layout/AdminLayout.vue`
- [Knowledge management](https://github.com/rbwnb/so-ai-edu/blob/master/frontend/src/api/knowledge.js): `frontend/src/api/knowledge.js`
- [User and role APIs](https://github.com/rbwnb/so-ai-edu/blob/master/backend/src/main/java/com/gdou/marine/controller/SysUserController.java): `backend/src/main/java/com/gdou/marine/controller/SysUserController.java`

### Backend platform

- [JWT and RBAC](https://github.com/rbwnb/so-ai-edu/blob/master/backend/src/main/java/com/gdou/marine/config/SecurityConfig.java): `backend/src/main/java/com/gdou/marine/config/SecurityConfig.java`
- **MySQL records**

### Other components

- **Learner**

## Connections

- Learner → Vue application: uses
- Vue application → Routes and layouts: renders routes
- Routes and layouts → Species browsing: routes to
- Routes and layouts → Quiz and review: routes to
- Routes and layouts → Observation community: routes to
- Species browsing → Species endpoints: requests data
- Species endpoints → HTTP client: sends requests
- HTTP client → Species API: calls API
- Quiz and review → Quiz endpoints: requests quizzes
- Quiz endpoints → HTTP client: sends requests
- HTTP client → Quiz and exam APIs: calls API
- Observation community → HTTP client: uses API
- HTTP client → Observation API: calls API
- Learner → RAG chat: asks questions
- RAG chat → RAG endpoints: loads chat data
- RAG endpoints → HTTP client: sends requests
- HTTP client → RAG and documents: calls API
- RAG and documents → RAG orchestration: delegates Q&A
- RAG orchestration → Redis vector store: retrieves context
- RAG orchestration → AI model services: requests responses
- RAG orchestration → MySQL records: stores conversation
- Admin console → Knowledge management: manages documents
- Knowledge management → HTTP client: sends requests
- HTTP client → RAG and documents: calls API
- Admin console → User and role APIs: manages accounts
- Points and shop → MySQL records: reads and writes
- Observation API → MySQL records: reads and writes
- JWT and RBAC → HTTP client: authenticates requests
- Community highlights → AI model services: generates copy
- Community highlights → MySQL records: reads posts and sends notices
