# learnware-lamda/beimingwu architecture

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

- Interactive diagram: https://gitdiagram.com/learnware-lamda/beimingwu
- Repository: https://github.com/learnware-lamda/beimingwu

## Overview

Beimingwu is a learnware dock: developers submit models with specifications, and users search for and reuse suitable learnwares. The main web app supports requirement entry, search results, submission, account features, and learnware details; a separate admin app exposes management views. The backend provides API routes, database operations, and a learnware engine. README capabilities include specification generation, quality inspection, semantic/statistical search, heterogeneous matching, and local deployment. Some processing subsystems are documented but not sampled, so uncertain internal wiring is omitted.

Main entry points: [`frontend/packages/main/src/request/index.ts`](https://github.com/learnware-lamda/beimingwu/blob/main/frontend/packages/main/src/request/index.ts) (Main API client), [`backend/context.py`](https://github.com/learnware-lamda/beimingwu/blob/main/backend/context.py) (Runtime context), [`backend/restful/engine.py`](https://github.com/learnware-lamda/beimingwu/blob/main/backend/restful/engine.py) (Learnware API), [`backend/lib/engine.py`](https://github.com/learnware-lamda/beimingwu/blob/main/backend/lib/engine.py) (Search and validation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Web interfaces"]
  node_search_ui["Search and reuse<br/>[Search.vue]"]
  node_submit_ui["Submit learnware<br/>[Submit.vue]"]
  node_detail_ui["Learnware details"]
  node_account_ui["Account features<br/>[ClientToken.vue]"]
  node_admin_ui["Admin console<br/>[Users.vue]"]
  node_main_requests["Main API client<br/>[index.ts]"]
  node_admin_requests["Admin API client<br/>[fetchex.ts]"]
end

subgraph group_api["Backend APIs"]
  node_auth_api["Authentication API<br/>[auth.py]"]
  node_user_api["User API<br/>[user.py]"]
  node_dataset_api["Dataset API<br/>[datasets.py]"]
  node_engine_api["Learnware API<br/>[engine.py]"]
  node_admin_api["Admin API<br/>[admin.py]"]
end

subgraph group_core["Learnware processing"]
  node_engine["Search and validation<br/>[engine.py]"]
  node_market["Learnware market"]
  node_inspection["Quality inspection<br/>[engine.py]"]
end

subgraph group_state["State and storage"]
  node_database_ops["Domain data operations"]
  node_database[("Backend database<br/>[sqlalchemy.py]")]
  node_context["Runtime context<br/>[context.py]"]
  node_redis["Redis services<br/>[redis_utils.py]"]
end

node_user(("Learnware user"))
node_developer(("Model developer"))
node_admin(("System admin"))

node_user -->|"enter requirements"| node_search_ui
node_user -->|"inspect results"| node_detail_ui
node_developer -->|"submit model"| node_submit_ui
node_admin -->|"manage system"| node_admin_ui
node_search_ui -->|"request search"| node_main_requests
node_submit_ui -->|"send submission"| node_main_requests
node_detail_ui -->|"request details"| node_main_requests
node_account_ui -->|"manage tokens"| node_main_requests
node_main_requests -->|"call endpoints"| node_engine_api
node_main_requests -->|"call endpoints"| node_auth_api
node_main_requests -->|"call endpoints"| node_user_api
node_main_requests -->|"call endpoints"| node_dataset_api
node_admin_ui -->|"manage records"| node_admin_requests
node_admin_requests -->|"call endpoints"| node_admin_api
node_engine_api -->|"access runtime"| node_context
node_engine_api -->|"read metadata"| node_database_ops
node_engine_api -->|"resolve download tokens"| node_redis
node_context -->|"initialize store"| node_database
node_context -->|"initialize market"| node_market
node_context -->|"configure engine"| node_engine
node_engine -->|"validate uploads"| node_inspection
node_engine -->|"search learnwares"| node_market
node_database_ops -->|"use database handle"| node_context

click node_search_ui "https://github.com/learnware-lamda/beimingwu/blob/main/frontend/packages/main/src/views/Search.vue"
click node_submit_ui "https://github.com/learnware-lamda/beimingwu/blob/main/frontend/packages/main/src/views/Submit.vue"
click node_detail_ui "https://github.com/learnware-lamda/beimingwu/blob/main/frontend/packages/main/src/views/LearnwareDetail.vue"
click node_account_ui "https://github.com/learnware-lamda/beimingwu/blob/main/frontend/packages/main/src/views/ClientToken.vue"
click node_admin_ui "https://github.com/learnware-lamda/beimingwu/blob/main/frontend/packages/admin/src/views/Users.vue"
click node_main_requests "https://github.com/learnware-lamda/beimingwu/blob/main/frontend/packages/main/src/request/index.ts"
click node_admin_requests "https://github.com/learnware-lamda/beimingwu/blob/main/frontend/packages/admin/src/utils/fetchex.ts"
click node_auth_api "https://github.com/learnware-lamda/beimingwu/blob/main/backend/restful/auth.py"
click node_user_api "https://github.com/learnware-lamda/beimingwu/blob/main/backend/restful/user.py"
click node_dataset_api "https://github.com/learnware-lamda/beimingwu/blob/main/backend/restful/datasets.py"
click node_engine_api "https://github.com/learnware-lamda/beimingwu/blob/main/backend/restful/engine.py"
click node_admin_api "https://github.com/learnware-lamda/beimingwu/blob/main/backend/restful/admin.py"
click node_engine "https://github.com/learnware-lamda/beimingwu/blob/main/backend/lib/engine.py"
click node_inspection "https://github.com/learnware-lamda/beimingwu/blob/main/backend/lib/engine.py"
click node_database_ops "https://github.com/learnware-lamda/beimingwu/blob/main/backend/lib/database_operations.py"
click node_database "https://github.com/learnware-lamda/beimingwu/blob/main/backend/database/sqlalchemy.py"
click node_context "https://github.com/learnware-lamda/beimingwu/blob/main/backend/context.py"
click node_redis "https://github.com/learnware-lamda/beimingwu/blob/main/backend/lib/redis_utils.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_search_ui,node_submit_ui,node_detail_ui,node_account_ui,node_admin_ui,node_main_requests,node_admin_requests,node_user toneBlue
class node_auth_api,node_user_api,node_dataset_api,node_engine_api,node_admin_api toneAmber
class node_engine,node_market,node_inspection toneMint
class node_database_ops,node_database,node_context,node_redis toneRose
class node_developer,node_admin toneIndigo
```

## Components

### Web interfaces

- [Search and reuse](https://github.com/learnware-lamda/beimingwu/blob/main/frontend/packages/main/src/views/Search.vue): `frontend/packages/main/src/views/Search.vue`
- [Submit learnware](https://github.com/learnware-lamda/beimingwu/blob/main/frontend/packages/main/src/views/Submit.vue): `frontend/packages/main/src/views/Submit.vue`
- [Learnware details](https://github.com/learnware-lamda/beimingwu/blob/main/frontend/packages/main/src/views/LearnwareDetail.vue): `frontend/packages/main/src/views/LearnwareDetail.vue`
- [Account features](https://github.com/learnware-lamda/beimingwu/blob/main/frontend/packages/main/src/views/ClientToken.vue): `frontend/packages/main/src/views/ClientToken.vue`
- [Admin console](https://github.com/learnware-lamda/beimingwu/blob/main/frontend/packages/admin/src/views/Users.vue): `frontend/packages/admin/src/views/Users.vue`
- [Main API client](https://github.com/learnware-lamda/beimingwu/blob/main/frontend/packages/main/src/request/index.ts): `frontend/packages/main/src/request/index.ts`
- [Admin API client](https://github.com/learnware-lamda/beimingwu/blob/main/frontend/packages/admin/src/utils/fetchex.ts): `frontend/packages/admin/src/utils/fetchex.ts`

### Backend APIs

- [Authentication API](https://github.com/learnware-lamda/beimingwu/blob/main/backend/restful/auth.py): `backend/restful/auth.py`
- [User API](https://github.com/learnware-lamda/beimingwu/blob/main/backend/restful/user.py): `backend/restful/user.py`
- [Dataset API](https://github.com/learnware-lamda/beimingwu/blob/main/backend/restful/datasets.py): `backend/restful/datasets.py`
- [Learnware API](https://github.com/learnware-lamda/beimingwu/blob/main/backend/restful/engine.py): `backend/restful/engine.py`
- [Admin API](https://github.com/learnware-lamda/beimingwu/blob/main/backend/restful/admin.py): `backend/restful/admin.py`

### Learnware processing

- [Search and validation](https://github.com/learnware-lamda/beimingwu/blob/main/backend/lib/engine.py): `backend/lib/engine.py`
- **Learnware market**
- [Quality inspection](https://github.com/learnware-lamda/beimingwu/blob/main/backend/lib/engine.py): `backend/lib/engine.py`

### State and storage

- [Domain data operations](https://github.com/learnware-lamda/beimingwu/blob/main/backend/lib/database_operations.py): `backend/lib/database_operations.py`
- [Backend database](https://github.com/learnware-lamda/beimingwu/blob/main/backend/database/sqlalchemy.py): `backend/database/sqlalchemy.py`
- [Runtime context](https://github.com/learnware-lamda/beimingwu/blob/main/backend/context.py): `backend/context.py`
- [Redis services](https://github.com/learnware-lamda/beimingwu/blob/main/backend/lib/redis_utils.py): `backend/lib/redis_utils.py`

### Other components

- **Learnware user**
- **Model developer**
- **System admin**

## Connections

- Learnware user → Search and reuse: enter requirements
- Learnware user → Learnware details: inspect results
- Model developer → Submit learnware: submit model
- System admin → Admin console: manage system
- Search and reuse → Main API client: request search
- Submit learnware → Main API client: send submission
- Learnware details → Main API client: request details
- Account features → Main API client: manage tokens
- Main API client → Learnware API: call endpoints
- Main API client → Authentication API: call endpoints
- Main API client → User API: call endpoints
- Main API client → Dataset API: call endpoints
- Admin console → Admin API client: manage records
- Admin API client → Admin API: call endpoints
- Learnware API → Runtime context: access runtime
- Learnware API → Domain data operations: read metadata
- Learnware API → Redis services: resolve download tokens
- Runtime context → Backend database: initialize store
- Runtime context → Learnware market: initialize market
- Runtime context → Search and validation: configure engine
- Search and validation → Quality inspection: validate uploads
- Search and validation → Learnware market: search learnwares
- Domain data operations → Runtime context: use database handle
