# lunarsheep00/shippingmanagement architecture

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

- Interactive diagram: https://gitdiagram.com/lunarsheep00/shippingmanagement
- Repository: https://github.com/lunarsheep00/shippingmanagement

## Overview

This is a Vue 3 and Express shipping-management platform. Users authenticate, then manage ships, cargo/orders, crew, routes/voyages/dispatches, track voyages, and review operational reports; frontend views call a REST API backed by MySQL. The graph preserves those documented capabilities. Several frontend-to-API and optional map relationships are documented or inferred from endpoint naming rather than demonstrated by sampled calls, so those links are dashed.

Main entry points: [`frontend/src/router/index.ts`](https://github.com/lunarsheep00/shippingmanagement/blob/main/frontend/src/router/index.ts) (App navigation), [`backend/src/index.ts`](https://github.com/lunarsheep00/shippingmanagement/blob/main/backend/src/index.ts) (Express API server), [`frontend/src/utils/api.ts`](https://github.com/lunarsheep00/shippingmanagement/blob/main/frontend/src/utils/api.ts) (REST client), [`backend/src/config/database.ts`](https://github.com/lunarsheep00/shippingmanagement/blob/main/backend/src/config/database.ts) (MySQL connection pool)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_router["App navigation<br/>[index.ts]"]
  node_login["Login and profile<br/>[Login.vue]"]
  node_authstore["Authentication state<br/>[auth.ts]"]
  node_api["REST client<br/>[api.ts]"]
end

subgraph group_operations["Shipping operations"]
  node_shipsui["Ship management<br/>[Ships.vue]"]
  node_cargoui["Cargo and orders<br/>[Cargos.vue]"]
  node_crewui["Crew management<br/>[Crews.vue]"]
  node_routeui["Routes and dispatch<br/>[Routes.vue]"]
end

subgraph group_insight["Tracking and analytics"]
  node_dashboard["Dashboard<br/>[Dashboard.vue]"]
  node_reportsui["Statistical reports<br/>[Reports.vue]"]
  node_trackingui["Trajectory visualization"]
  node_tracklogic["Track playback logic<br/>[useShipTrack.ts]"]
  node_amap["AMap rendering<br/>[useAMap.ts]"]
end

subgraph group_backend["API services"]
  node_server["Express API server<br/>[index.ts]"]
  node_authroutes["Authentication API<br/>[auth.ts]"]
  node_shiproutes["Ship API<br/>[ships.ts]"]
  node_cargoroutes["Cargo API<br/>[cargos.ts]"]
  node_crewroutes["Crew API<br/>[crews.ts]"]
  node_routeroutes["Route and voyage API<br/>[route.ts]"]
  node_reportroutes["Reports API<br/>[reports.ts]"]
  node_trackroutes["Tracking API<br/>[tracks.ts]"]
end

subgraph group_persistence["Persistence and access"]
  node_guard["JWT access control<br/>[auth.ts]"]
  node_pool["MySQL connection pool<br/>[database.ts]"]
end

node_user(("Shipping user"))
node_mysql[("MySQL database")]

node_user -->|"opens"| node_router
node_router -->|"routes to"| node_login
node_router -->|"routes to"| node_shipsui
node_router -->|"routes to"| node_cargoui
node_router -->|"routes to"| node_crewui
node_router -->|"routes to"| node_routeui
node_router -->|"routes to"| node_dashboard
node_router -->|"routes to"| node_reportsui
node_router -->|"routes to"| node_trackingui
node_login -->|"uses"| node_authstore
node_authstore -->|"calls"| node_api
node_shipsui -->|"calls"| node_api
node_cargoui -->|"calls"| node_api
node_crewui -->|"calls"| node_api
node_routeui -->|"calls"| node_api
node_dashboard -->|"calls"| node_api
node_reportsui -->|"calls"| node_api
node_trackingui -.->|"requests data"| node_api
node_trackingui -.->|"uses"| node_tracklogic
node_tracklogic -.->|"renders on"| node_amap
node_api -.->|"sends REST requests"| node_server
node_server -->|"mounts"| node_authroutes
node_server -->|"mounts"| node_shiproutes
node_server -->|"mounts"| node_cargoroutes
node_server -->|"mounts"| node_crewroutes
node_server -->|"mounts"| node_routeroutes
node_server -->|"mounts"| node_reportroutes
node_server -->|"mounts"| node_trackroutes
node_authroutes -->|"queries"| node_pool
node_shiproutes -->|"queries"| node_pool
node_cargoroutes -->|"queries"| node_pool
node_crewroutes -->|"queries"| node_pool
node_routeroutes -->|"queries"| node_pool
node_reportroutes -->|"queries"| node_pool
node_trackroutes -->|"queries"| node_pool
node_authroutes -->|"uses"| node_guard
node_shiproutes -->|"uses"| node_guard
node_cargoroutes -->|"uses"| node_guard
node_crewroutes -->|"uses"| node_guard
node_routeroutes -->|"uses"| node_guard
node_reportroutes -->|"uses"| node_guard
node_trackroutes -->|"uses"| node_guard
node_pool -->|"connects to"| node_mysql
node_user -.->|"views voyages"| node_amap

click node_router "https://github.com/lunarsheep00/shippingmanagement/blob/main/frontend/src/router/index.ts"
click node_login "https://github.com/lunarsheep00/shippingmanagement/blob/main/frontend/src/views/Login.vue"
click node_authstore "https://github.com/lunarsheep00/shippingmanagement/blob/main/frontend/src/stores/auth.ts"
click node_api "https://github.com/lunarsheep00/shippingmanagement/blob/main/frontend/src/utils/api.ts"
click node_shipsui "https://github.com/lunarsheep00/shippingmanagement/blob/main/frontend/src/views/Ships.vue"
click node_cargoui "https://github.com/lunarsheep00/shippingmanagement/blob/main/frontend/src/views/Cargos.vue"
click node_crewui "https://github.com/lunarsheep00/shippingmanagement/blob/main/frontend/src/views/Crews.vue"
click node_routeui "https://github.com/lunarsheep00/shippingmanagement/blob/main/frontend/src/views/Routes.vue"
click node_dashboard "https://github.com/lunarsheep00/shippingmanagement/blob/main/frontend/src/views/Dashboard.vue"
click node_reportsui "https://github.com/lunarsheep00/shippingmanagement/blob/main/frontend/src/views/Reports.vue"
click node_trackingui "https://github.com/lunarsheep00/shippingmanagement/blob/main/frontend/src/views/TrackVisualization.vue"
click node_tracklogic "https://github.com/lunarsheep00/shippingmanagement/blob/main/frontend/src/composables/useShipTrack.ts"
click node_amap "https://github.com/lunarsheep00/shippingmanagement/blob/main/frontend/src/composables/useAMap.ts"
click node_server "https://github.com/lunarsheep00/shippingmanagement/blob/main/backend/src/index.ts"
click node_authroutes "https://github.com/lunarsheep00/shippingmanagement/blob/main/backend/src/routes/auth.ts"
click node_shiproutes "https://github.com/lunarsheep00/shippingmanagement/blob/main/backend/src/routes/ships.ts"
click node_cargoroutes "https://github.com/lunarsheep00/shippingmanagement/blob/main/backend/src/routes/cargos.ts"
click node_crewroutes "https://github.com/lunarsheep00/shippingmanagement/blob/main/backend/src/routes/crews.ts"
click node_routeroutes "https://github.com/lunarsheep00/shippingmanagement/blob/main/backend/src/routes/route.ts"
click node_reportroutes "https://github.com/lunarsheep00/shippingmanagement/blob/main/backend/src/routes/reports.ts"
click node_trackroutes "https://github.com/lunarsheep00/shippingmanagement/blob/main/backend/src/routes/tracks.ts"
click node_guard "https://github.com/lunarsheep00/shippingmanagement/blob/main/backend/src/middleware/auth.ts"
click node_pool "https://github.com/lunarsheep00/shippingmanagement/blob/main/backend/src/config/database.ts"

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_router,node_login,node_authstore,node_api,node_user toneBlue
class node_shipsui,node_cargoui,node_crewui,node_routeui,node_mysql toneAmber
class node_dashboard,node_reportsui,node_trackingui,node_tracklogic,node_amap toneMint
class node_server,node_authroutes,node_shiproutes,node_cargoroutes,node_crewroutes,node_routeroutes,node_reportroutes,node_trackroutes toneRose
class node_guard,node_pool toneIndigo
```

## Components

### Web client

- [App navigation](https://github.com/lunarsheep00/shippingmanagement/blob/main/frontend/src/router/index.ts): `frontend/src/router/index.ts`
- [Login and profile](https://github.com/lunarsheep00/shippingmanagement/blob/main/frontend/src/views/Login.vue): `frontend/src/views/Login.vue`
- [Authentication state](https://github.com/lunarsheep00/shippingmanagement/blob/main/frontend/src/stores/auth.ts): `frontend/src/stores/auth.ts`
- [REST client](https://github.com/lunarsheep00/shippingmanagement/blob/main/frontend/src/utils/api.ts): `frontend/src/utils/api.ts`

### Shipping operations

- [Ship management](https://github.com/lunarsheep00/shippingmanagement/blob/main/frontend/src/views/Ships.vue): `frontend/src/views/Ships.vue`
- [Cargo and orders](https://github.com/lunarsheep00/shippingmanagement/blob/main/frontend/src/views/Cargos.vue): `frontend/src/views/Cargos.vue`
- [Crew management](https://github.com/lunarsheep00/shippingmanagement/blob/main/frontend/src/views/Crews.vue): `frontend/src/views/Crews.vue`
- [Routes and dispatch](https://github.com/lunarsheep00/shippingmanagement/blob/main/frontend/src/views/Routes.vue): `frontend/src/views/Routes.vue`

### Tracking and analytics

- [Dashboard](https://github.com/lunarsheep00/shippingmanagement/blob/main/frontend/src/views/Dashboard.vue): `frontend/src/views/Dashboard.vue`
- [Statistical reports](https://github.com/lunarsheep00/shippingmanagement/blob/main/frontend/src/views/Reports.vue): `frontend/src/views/Reports.vue`
- [Trajectory visualization](https://github.com/lunarsheep00/shippingmanagement/blob/main/frontend/src/views/TrackVisualization.vue): `frontend/src/views/TrackVisualization.vue`
- [Track playback logic](https://github.com/lunarsheep00/shippingmanagement/blob/main/frontend/src/composables/useShipTrack.ts): `frontend/src/composables/useShipTrack.ts`
- [AMap rendering](https://github.com/lunarsheep00/shippingmanagement/blob/main/frontend/src/composables/useAMap.ts): `frontend/src/composables/useAMap.ts`

### API services

- [Express API server](https://github.com/lunarsheep00/shippingmanagement/blob/main/backend/src/index.ts): `backend/src/index.ts`
- [Authentication API](https://github.com/lunarsheep00/shippingmanagement/blob/main/backend/src/routes/auth.ts): `backend/src/routes/auth.ts`
- [Ship API](https://github.com/lunarsheep00/shippingmanagement/blob/main/backend/src/routes/ships.ts): `backend/src/routes/ships.ts`
- [Cargo API](https://github.com/lunarsheep00/shippingmanagement/blob/main/backend/src/routes/cargos.ts): `backend/src/routes/cargos.ts`
- [Crew API](https://github.com/lunarsheep00/shippingmanagement/blob/main/backend/src/routes/crews.ts): `backend/src/routes/crews.ts`
- [Route and voyage API](https://github.com/lunarsheep00/shippingmanagement/blob/main/backend/src/routes/route.ts): `backend/src/routes/route.ts`
- [Reports API](https://github.com/lunarsheep00/shippingmanagement/blob/main/backend/src/routes/reports.ts): `backend/src/routes/reports.ts`
- [Tracking API](https://github.com/lunarsheep00/shippingmanagement/blob/main/backend/src/routes/tracks.ts): `backend/src/routes/tracks.ts`

### Persistence and access

- [JWT access control](https://github.com/lunarsheep00/shippingmanagement/blob/main/backend/src/middleware/auth.ts): `backend/src/middleware/auth.ts`
- [MySQL connection pool](https://github.com/lunarsheep00/shippingmanagement/blob/main/backend/src/config/database.ts): `backend/src/config/database.ts`

### Other components

- **Shipping user**
- **MySQL database**

## Connections

- Shipping user → App navigation: opens (evidence: `README.md`)
- App navigation → Login and profile: routes to (evidence: `frontend/src/router/index.ts`)
- App navigation → Ship management: routes to (evidence: `frontend/src/router/index.ts`)
- App navigation → Cargo and orders: routes to (evidence: `frontend/src/router/index.ts`)
- App navigation → Crew management: routes to (evidence: `frontend/src/router/index.ts`)
- App navigation → Routes and dispatch: routes to (evidence: `frontend/src/router/index.ts`)
- App navigation → Dashboard: routes to (evidence: `frontend/src/router/index.ts`)
- App navigation → Statistical reports: routes to (evidence: `frontend/src/router/index.ts`)
- App navigation → Trajectory visualization: routes to (evidence: `frontend/src/router/index.ts`)
- Login and profile → Authentication state: uses (evidence: `frontend/src/views/Login.vue`)
- Authentication state → REST client: calls (evidence: `frontend/src/stores/auth.ts`)
- Ship management → REST client: calls (evidence: `frontend/src/views/Ships.vue`)
- Cargo and orders → REST client: calls (evidence: `frontend/src/views/Cargos.vue`)
- Crew management → REST client: calls (evidence: `frontend/src/views/Crews.vue`)
- Routes and dispatch → REST client: calls (evidence: `frontend/src/views/Routes.vue`)
- Dashboard → REST client: calls (evidence: `frontend/src/views/Dashboard.vue`)
- Statistical reports → REST client: calls (evidence: `frontend/src/views/Reports.vue`)
- Trajectory visualization → REST client: requests data
- Trajectory visualization → Track playback logic: uses
- Track playback logic → AMap rendering: renders on
- REST client → Express API server: sends REST requests
- Express API server → Authentication API: mounts (evidence: `backend/src/index.ts`)
- Express API server → Ship API: mounts (evidence: `backend/src/index.ts`)
- Express API server → Cargo API: mounts (evidence: `backend/src/index.ts`)
- Express API server → Crew API: mounts (evidence: `backend/src/index.ts`)
- Express API server → Route and voyage API: mounts (evidence: `backend/src/index.ts`)
- Express API server → Reports API: mounts (evidence: `backend/src/index.ts`)
- Express API server → Tracking API: mounts (evidence: `backend/src/index.ts`)
- Authentication API → MySQL connection pool: queries (evidence: `backend/src/routes/auth.ts`)
- Ship API → MySQL connection pool: queries (evidence: `backend/src/routes/ships.ts`)
- Cargo API → MySQL connection pool: queries (evidence: `backend/src/routes/cargos.ts`)
- Crew API → MySQL connection pool: queries (evidence: `backend/src/routes/crews.ts`)
- Route and voyage API → MySQL connection pool: queries (evidence: `backend/src/routes/route.ts`)
- Reports API → MySQL connection pool: queries (evidence: `backend/src/routes/reports.ts`)
- Tracking API → MySQL connection pool: queries (evidence: `backend/src/routes/tracks.ts`)
- Authentication API → JWT access control: uses (evidence: `backend/src/routes/auth.ts`)
- Ship API → JWT access control: uses (evidence: `backend/src/routes/ships.ts`)
- Cargo API → JWT access control: uses (evidence: `backend/src/routes/cargos.ts`)
- Crew API → JWT access control: uses (evidence: `backend/src/routes/crews.ts`)
- Route and voyage API → JWT access control: uses (evidence: `backend/src/routes/route.ts`)
- Reports API → JWT access control: uses (evidence: `backend/src/routes/reports.ts`)
- Tracking API → JWT access control: uses (evidence: `backend/src/routes/tracks.ts`)
- MySQL connection pool → MySQL database: connects to (evidence: `backend/src/config/database.ts`)
- Shipping user → AMap rendering: views voyages (evidence: `README.md`)
