# yconghua/grad-studio architecture

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

- Interactive diagram: https://gitdiagram.com/yconghua/grad-studio
- Repository: https://github.com/yconghua/grad-studio

## Overview

grad-studio is an offline-first Electron desktop platform for research-group administration and collaboration. The main workflow is role-based login and group selection, then daily work across meetings, projects/tasks, logs/reports, literature/knowledge, degree milestones, and outcomes; mentors and group administrators review and comment, while super administrators manage users/groups and inspect platform-wide data. Renderer requests cross the preload/IPC boundary into services and repositories backed by MySQL. The README documents these domain capabilities, but not every feature handler was sampled, so some internal connections are omitted rather than inferred.

Main entry points: [`src/pages`](https://github.com/yconghua/grad-studio/tree/main/src/pages) (Research workspaces), [`src/router/index.js`](https://github.com/yconghua/grad-studio/blob/main/src/router/index.js) (Role routing), [`electron/ipc/index.js`](https://github.com/yconghua/grad-studio/blob/main/electron/ipc/index.js) (IPC dispatch), [`electron/db/repositories/BaseRepository.js`](https://github.com/yconghua/grad-studio/blob/main/electron/db/repositories/BaseRepository.js) (Repository base)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Desktop client"]
  node_login["Login and setup<br/>[LoginView.vue]"]
  node_router["Role routing<br/>[index.js]"]
  node_layout["Role navigation<br/>[HomeLayout.vue]"]
  node_groupcontext["Group context<br/>[useGroupContext.js]"]
  node_session["Local session<br/>[useSession.js]"]
  node_pages["Research workspaces"]
  node_api["Renderer API<br/>[index.js]"]
  node_preload["Secure bridge<br/>[preload.js]"]
end

subgraph group_backend["Application services"]
  node_main["Electron runtime<br/>[main.js]"]
  node_ipc["IPC dispatch<br/>[index.js]"]
  node_authsvc["Identity service<br/>[authService.js]"]
  node_services["Domain services"]
  node_searchsvc["Global search<br/>[searchService.js]"]
end

subgraph group_domain["Research workflows"]
  node_admin["Group and user admin"]
  node_meetings["Meetings and reports"]
  node_projects["Projects and tasks"]
  node_progress["Logs and weekly reviews"]
  node_literature["Literature and knowledge"]
  node_degree["Degree milestones"]
  node_outcomes["Research outcomes"]
  node_chat["Group communication"]
  node_overview["Platform overview"]
end

subgraph group_data["Persistence"]
  node_connection["DB connection<br/>[connection.js]"]
  node_repository["Repository base<br/>[BaseRepository.js]"]
  node_db[("MySQL database")]
end

node_actor(("Research staff"))

node_actor -->|"signs in"| node_login
node_login -->|"enters app"| node_router
node_router -->|"checks session"| node_session
node_router -->|"loads groups"| node_groupcontext
node_router -->|"routes to"| node_layout
node_layout -->|"renders workspace"| node_pages
node_groupcontext -->|"requests groups"| node_api
node_pages -->|"requests data"| node_api
node_api -->|"invokes bridge"| node_preload
node_preload -.->|"sends IPC"| node_ipc
node_main -->|"registers routes"| node_ipc
node_ipc -->|"dispatches auth"| node_authsvc
node_ipc -.->|"dispatches domain calls"| node_services
node_authsvc -->|"queries users"| node_repository
node_services -.->|"uses repositories"| node_repository
node_repository -->|"acquires connection"| node_connection
node_connection -->|"executes SQL"| node_db
node_services -.->|"includes search"| node_searchsvc
node_searchsvc -->|"queries search data"| node_repository
node_pages -.->|"includes administration"| node_admin
node_pages -.->|"includes"| node_meetings
node_pages -.->|"includes"| node_projects
node_pages -.->|"includes"| node_progress
node_pages -.->|"includes"| node_literature
node_pages -.->|"includes"| node_degree
node_pages -.->|"includes"| node_outcomes
node_pages -.->|"includes"| node_chat
node_pages -.->|"includes"| node_overview

click node_login "https://github.com/yconghua/grad-studio/blob/main/src/pages/auth/LoginView.vue"
click node_router "https://github.com/yconghua/grad-studio/blob/main/src/router/index.js"
click node_layout "https://github.com/yconghua/grad-studio/blob/main/src/layouts/HomeLayout.vue"
click node_groupcontext "https://github.com/yconghua/grad-studio/blob/main/src/composables/useGroupContext.js"
click node_session "https://github.com/yconghua/grad-studio/blob/main/src/composables/useSession.js"
click node_pages "https://github.com/yconghua/grad-studio/tree/main/src/pages"
click node_api "https://github.com/yconghua/grad-studio/blob/main/src/api/index.js"
click node_preload "https://github.com/yconghua/grad-studio/blob/main/electron/preload.js"
click node_main "https://github.com/yconghua/grad-studio/blob/main/electron/main.js"
click node_ipc "https://github.com/yconghua/grad-studio/blob/main/electron/ipc/index.js"
click node_authsvc "https://github.com/yconghua/grad-studio/blob/main/electron/services/authService.js"
click node_services "https://github.com/yconghua/grad-studio/tree/main/electron/services"
click node_searchsvc "https://github.com/yconghua/grad-studio/blob/main/electron/services/searchService.js"
click node_connection "https://github.com/yconghua/grad-studio/blob/main/electron/db/connection.js"
click node_repository "https://github.com/yconghua/grad-studio/blob/main/electron/db/repositories/BaseRepository.js"
click node_admin "https://github.com/yconghua/grad-studio/tree/main/src/pages/platform"
click node_meetings "https://github.com/yconghua/grad-studio/tree/main/src/pages/meeting"
click node_projects "https://github.com/yconghua/grad-studio/tree/main/src/pages/subject"
click node_progress "https://github.com/yconghua/grad-studio/tree/main/src/pages/research-record"
click node_literature "https://github.com/yconghua/grad-studio/tree/main/src/pages/literature"
click node_degree "https://github.com/yconghua/grad-studio/tree/main/src/pages/degree"
click node_outcomes "https://github.com/yconghua/grad-studio/tree/main/src/pages/achievement"
click node_chat "https://github.com/yconghua/grad-studio/tree/main/src/pages/chat"
click node_overview "https://github.com/yconghua/grad-studio/tree/main/src/pages/platform/overview"

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,node_router,node_layout,node_groupcontext,node_session,node_pages,node_api,node_preload toneBlue
class node_main,node_ipc,node_authsvc,node_services,node_searchsvc toneAmber
class node_admin,node_meetings,node_projects,node_progress,node_literature,node_degree,node_outcomes,node_chat,node_overview toneMint
class node_connection,node_repository,node_db toneRose
class node_actor toneIndigo
```

## Components

### Desktop client

- [Login and setup](https://github.com/yconghua/grad-studio/blob/main/src/pages/auth/LoginView.vue): `src/pages/auth/LoginView.vue`
- [Role routing](https://github.com/yconghua/grad-studio/blob/main/src/router/index.js): `src/router/index.js`
- [Role navigation](https://github.com/yconghua/grad-studio/blob/main/src/layouts/HomeLayout.vue): `src/layouts/HomeLayout.vue`
- [Group context](https://github.com/yconghua/grad-studio/blob/main/src/composables/useGroupContext.js): `src/composables/useGroupContext.js`
- [Local session](https://github.com/yconghua/grad-studio/blob/main/src/composables/useSession.js): `src/composables/useSession.js`
- [Research workspaces](https://github.com/yconghua/grad-studio/tree/main/src/pages): `src/pages`
- [Renderer API](https://github.com/yconghua/grad-studio/blob/main/src/api/index.js): `src/api/index.js`
- [Secure bridge](https://github.com/yconghua/grad-studio/blob/main/electron/preload.js): `electron/preload.js`

### Application services

- [Electron runtime](https://github.com/yconghua/grad-studio/blob/main/electron/main.js): `electron/main.js`
- [IPC dispatch](https://github.com/yconghua/grad-studio/blob/main/electron/ipc/index.js): `electron/ipc/index.js`
- [Identity service](https://github.com/yconghua/grad-studio/blob/main/electron/services/authService.js): `electron/services/authService.js`
- [Domain services](https://github.com/yconghua/grad-studio/tree/main/electron/services): `electron/services`
- [Global search](https://github.com/yconghua/grad-studio/blob/main/electron/services/searchService.js): `electron/services/searchService.js`

### Research workflows

- [Group and user admin](https://github.com/yconghua/grad-studio/tree/main/src/pages/platform): `src/pages/platform`
- [Meetings and reports](https://github.com/yconghua/grad-studio/tree/main/src/pages/meeting): `src/pages/meeting`
- [Projects and tasks](https://github.com/yconghua/grad-studio/tree/main/src/pages/subject): `src/pages/subject`
- [Logs and weekly reviews](https://github.com/yconghua/grad-studio/tree/main/src/pages/research-record): `src/pages/research-record`
- [Literature and knowledge](https://github.com/yconghua/grad-studio/tree/main/src/pages/literature): `src/pages/literature`
- [Degree milestones](https://github.com/yconghua/grad-studio/tree/main/src/pages/degree): `src/pages/degree`
- [Research outcomes](https://github.com/yconghua/grad-studio/tree/main/src/pages/achievement): `src/pages/achievement`
- [Group communication](https://github.com/yconghua/grad-studio/tree/main/src/pages/chat): `src/pages/chat`
- [Platform overview](https://github.com/yconghua/grad-studio/tree/main/src/pages/platform/overview): `src/pages/platform/overview`

### Persistence

- [DB connection](https://github.com/yconghua/grad-studio/blob/main/electron/db/connection.js): `electron/db/connection.js`
- [Repository base](https://github.com/yconghua/grad-studio/blob/main/electron/db/repositories/BaseRepository.js): `electron/db/repositories/BaseRepository.js`
- **MySQL database**

### Other components

- **Research staff**

## Connections

- Research staff → Login and setup: signs in (evidence: `README.md`)
- Login and setup → Role routing: enters app (evidence: `src/router/index.js`)
- Role routing → Local session: checks session (evidence: `src/router/index.js`)
- Role routing → Group context: loads groups (evidence: `src/router/index.js`)
- Role routing → Role navigation: routes to (evidence: `src/router/index.js`)
- Role navigation → Research workspaces: renders workspace
- Group context → Renderer API: requests groups (evidence: `src/composables/useGroupContext.js`)
- Research workspaces → Renderer API: requests data (evidence: `src/api/index.js`)
- Renderer API → Secure bridge: invokes bridge (evidence: `src/api/index.js`)
- Secure bridge → IPC dispatch: sends IPC
- Electron runtime → IPC dispatch: registers routes (evidence: `electron/main.js`)
- IPC dispatch → Identity service: dispatches auth
- IPC dispatch → Domain services: dispatches domain calls
- Identity service → Repository base: queries users (evidence: `electron/services/authService.js`)
- Domain services → Repository base: uses repositories
- Repository base → DB connection: acquires connection (evidence: `electron/db/repositories/BaseRepository.js`)
- DB connection → MySQL database: executes SQL (evidence: `electron/db/connection.js`)
- Domain services → Global search: includes search (evidence: `electron/services/searchService.js`)
- Global search → Repository base: queries search data
- Research workspaces → Group and user admin: includes administration
- Research workspaces → Meetings and reports: includes
- Research workspaces → Projects and tasks: includes
- Research workspaces → Logs and weekly reviews: includes
- Research workspaces → Literature and knowledge: includes
- Research workspaces → Degree milestones: includes
- Research workspaces → Research outcomes: includes
- Research workspaces → Group communication: includes
- Research workspaces → Platform overview: includes
