# command-shift/command_shift architecture

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

- Interactive diagram: https://gitdiagram.com/command-shift/command_shift
- Repository: https://github.com/command-shift/command_shift

## Overview

command_shift is a web app for managing a care facility’s nurse roster, bed census, shift assignments, and patient-bed notes. Administrators issue commands in the admin client; it requests roster and bed data or submits changes and assignments to the Express server. The server routes requests to nurse, bed, cookie, and session handlers; nurse records are stored in MongoDB. Assignment results are displayed to administrators, while a separate nurse client and assignment-retrieval routes support the nurse-facing workflow. The nurse client’s request behavior is not shown in the sampled source, so its connection is marked unverified.

Main entry points: [`Server/server.js`](https://github.com/command-shift/command_shift/blob/master/Server/server.js) (Express routes), [`Client/Admin_client/app.jsx`](https://github.com/command-shift/command_shift/blob/master/Client/Admin_client/app.jsx) (Admin command app), [`Client/Admin_client/Components/glossaryClick.jsx`](https://github.com/command-shift/command_shift/blob/master/Client/Admin_client/Components/glossaryClick.jsx) (Glossary toggle), [`Client/Admin_client/Components/assign.jsx`](https://github.com/command-shift/command_shift/blob/master/Client/Admin_client/Components/assign.jsx) (Assignment view)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_admin["Admin client"]
  node_admin_app["Admin command app<br/>[app.jsx]"]
  node_command_input["Command input<br/>[input.jsx]"]
  node_glossary_toggle["Glossary toggle<br/>[glossaryClick.jsx]"]
  node_glossary["Command glossary<br/>[glossary.jsx]"]
  node_nurse_list["Nurse selector<br/>[nurses.jsx]"]
  node_bed_display["Census display<br/>[display.jsx]"]
  node_assignment_view["Assignment view<br/>[assign.jsx]"]
  node_assignment_run["Bed run view<br/>[run.jsx]"]
end

subgraph group_api["Server API"]
  node_express_api["Express routes<br/>[server.js]"]
  node_bed_controller["Bed operations<br/>[BedCtrl.js]"]
  node_bed_model["Bed model<br/>[BedMdl.js]"]
end

subgraph group_nurse["Nurse records"]
  node_nurse_controller["Nurse operations<br/>[nurseCtrl.js]"]
  node_nurse_model[("Nurse records<br/>[nurseMdl.js]")]
end

subgraph group_shift["Nurse access"]
  node_cookie_controller["Cookie handling<br/>[CookieCtrl.js]"]
  node_session_controller["Session handling<br/>[SessionCtrl.js]"]
  node_session_model["Session model<br/>[SessionMdl.js]"]
  node_nurse_app["Nurse client<br/>[app.jsx]"]
end

node_mongo[("MongoDB")]

node_admin_app -->|"renders"| node_command_input
node_admin_app -->|"renders"| node_glossary_toggle
node_glossary_toggle -->|"renders"| node_glossary
node_admin_app -->|"renders"| node_nurse_list
node_admin_app -->|"renders"| node_bed_display
node_admin_app -->|"renders"| node_assignment_view
node_assignment_view -->|"renders"| node_assignment_run
node_admin_app -->|"requests"| node_express_api
node_express_api -->|"routes nurse requests"| node_nurse_controller
node_express_api -->|"routes bed requests"| node_bed_controller
node_express_api -->|"invokes"| node_cookie_controller
node_express_api -->|"invokes"| node_session_controller
node_nurse_controller -->|"queries and updates"| node_nurse_model
node_nurse_model -->|"connects"| node_mongo
node_express_api -->|"serves nurse page"| node_nurse_app
node_nurse_app -.->|"requests assignments"| node_express_api

click node_admin_app "https://github.com/command-shift/command_shift/blob/master/Client/Admin_client/app.jsx"
click node_command_input "https://github.com/command-shift/command_shift/blob/master/Client/Admin_client/Components/input.jsx"
click node_glossary_toggle "https://github.com/command-shift/command_shift/blob/master/Client/Admin_client/Components/glossaryClick.jsx"
click node_glossary "https://github.com/command-shift/command_shift/blob/master/Client/Admin_client/Components/glossary.jsx"
click node_nurse_list "https://github.com/command-shift/command_shift/blob/master/Client/Admin_client/Components/nurses.jsx"
click node_bed_display "https://github.com/command-shift/command_shift/blob/master/Client/Admin_client/Components/display.jsx"
click node_assignment_view "https://github.com/command-shift/command_shift/blob/master/Client/Admin_client/Components/assign.jsx"
click node_assignment_run "https://github.com/command-shift/command_shift/blob/master/Client/Admin_client/Components/run.jsx"
click node_express_api "https://github.com/command-shift/command_shift/blob/master/Server/server.js"
click node_bed_controller "https://github.com/command-shift/command_shift/blob/master/Server/Bed/BedCtrl.js"
click node_bed_model "https://github.com/command-shift/command_shift/blob/master/Server/Bed/BedMdl.js"
click node_nurse_controller "https://github.com/command-shift/command_shift/blob/master/Server/Nurse/nurseCtrl.js"
click node_nurse_model "https://github.com/command-shift/command_shift/blob/master/Server/Nurse/nurseMdl.js"
click node_cookie_controller "https://github.com/command-shift/command_shift/blob/master/Server/Cookie/CookieCtrl.js"
click node_session_controller "https://github.com/command-shift/command_shift/blob/master/Server/Session/SessionCtrl.js"
click node_session_model "https://github.com/command-shift/command_shift/blob/master/Server/Session/SessionMdl.js"
click node_nurse_app "https://github.com/command-shift/command_shift/blob/master/Client/Nurse_client/app.jsx"

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_admin_app,node_command_input,node_glossary_toggle,node_glossary,node_nurse_list,node_bed_display,node_assignment_view,node_assignment_run toneBlue
class node_express_api,node_bed_controller,node_bed_model,node_mongo toneAmber
class node_nurse_controller,node_nurse_model toneMint
class node_cookie_controller,node_session_controller,node_session_model,node_nurse_app toneRose
```

## Components

### Admin client

- [Admin command app](https://github.com/command-shift/command_shift/blob/master/Client/Admin_client/app.jsx): `Client/Admin_client/app.jsx`
- [Command input](https://github.com/command-shift/command_shift/blob/master/Client/Admin_client/Components/input.jsx): `Client/Admin_client/Components/input.jsx`
- [Glossary toggle](https://github.com/command-shift/command_shift/blob/master/Client/Admin_client/Components/glossaryClick.jsx): `Client/Admin_client/Components/glossaryClick.jsx`
- [Command glossary](https://github.com/command-shift/command_shift/blob/master/Client/Admin_client/Components/glossary.jsx): `Client/Admin_client/Components/glossary.jsx`
- [Nurse selector](https://github.com/command-shift/command_shift/blob/master/Client/Admin_client/Components/nurses.jsx): `Client/Admin_client/Components/nurses.jsx`
- [Census display](https://github.com/command-shift/command_shift/blob/master/Client/Admin_client/Components/display.jsx): `Client/Admin_client/Components/display.jsx`
- [Assignment view](https://github.com/command-shift/command_shift/blob/master/Client/Admin_client/Components/assign.jsx): `Client/Admin_client/Components/assign.jsx`
- [Bed run view](https://github.com/command-shift/command_shift/blob/master/Client/Admin_client/Components/run.jsx): `Client/Admin_client/Components/run.jsx`

### Server API

- [Express routes](https://github.com/command-shift/command_shift/blob/master/Server/server.js): `Server/server.js`
- [Bed operations](https://github.com/command-shift/command_shift/blob/master/Server/Bed/BedCtrl.js): `Server/Bed/BedCtrl.js`
- [Bed model](https://github.com/command-shift/command_shift/blob/master/Server/Bed/BedMdl.js): `Server/Bed/BedMdl.js`

### Nurse records

- [Nurse operations](https://github.com/command-shift/command_shift/blob/master/Server/Nurse/nurseCtrl.js): `Server/Nurse/nurseCtrl.js`
- [Nurse records](https://github.com/command-shift/command_shift/blob/master/Server/Nurse/nurseMdl.js): `Server/Nurse/nurseMdl.js`

### Nurse access

- [Cookie handling](https://github.com/command-shift/command_shift/blob/master/Server/Cookie/CookieCtrl.js): `Server/Cookie/CookieCtrl.js`
- [Session handling](https://github.com/command-shift/command_shift/blob/master/Server/Session/SessionCtrl.js): `Server/Session/SessionCtrl.js`
- [Session model](https://github.com/command-shift/command_shift/blob/master/Server/Session/SessionMdl.js): `Server/Session/SessionMdl.js`
- [Nurse client](https://github.com/command-shift/command_shift/blob/master/Client/Nurse_client/app.jsx): `Client/Nurse_client/app.jsx`

### Other components

- **MongoDB**

## Connections

- Admin command app → Command input: renders (evidence: `Client/Admin_client/app.jsx`)
- Admin command app → Glossary toggle: renders (evidence: `Client/Admin_client/app.jsx`)
- Glossary toggle → Command glossary: renders (evidence: `Client/Admin_client/Components/glossaryClick.jsx`)
- Admin command app → Nurse selector: renders (evidence: `Client/Admin_client/app.jsx`)
- Admin command app → Census display: renders (evidence: `Client/Admin_client/app.jsx`)
- Admin command app → Assignment view: renders (evidence: `Client/Admin_client/app.jsx`)
- Assignment view → Bed run view: renders (evidence: `Client/Admin_client/Components/assign.jsx`)
- Admin command app → Express routes: requests (evidence: `Client/Admin_client/app.jsx`)
- Express routes → Nurse operations: routes nurse requests (evidence: `Server/server.js`)
- Express routes → Bed operations: routes bed requests (evidence: `Server/server.js`)
- Express routes → Cookie handling: invokes (evidence: `Server/server.js`)
- Express routes → Session handling: invokes (evidence: `Server/server.js`)
- Nurse operations → Nurse records: queries and updates (evidence: `Server/Nurse/nurseCtrl.js`)
- Nurse records → MongoDB: connects (evidence: `Server/Nurse/nurseMdl.js`)
- Express routes → Nurse client: serves nurse page (evidence: `Server/server.js`)
- Nurse client → Express routes: requests assignments
