# sajid-sys/fec-dld-virtual-lab architecture

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

- Interactive diagram: https://gitdiagram.com/sajid-sys/fec-dld-virtual-lab
- Repository: https://github.com/sajid-sys/fec-dld-virtual-lab

## Overview

FEC DLD Virtual Lab is a browser-based digital-logic lab bench. A student selects an experiment, places ICs and wires a circuit, changes switches, then observes LEDs or uses the checker against the experiment truth table; guided-build steps support wiring. The main runtime is split between the DOM-based interface in `js/app.js` and the no-DOM board model, simulator, experiment definitions and guide logic in `js/core.js`. The README documents capabilities beyond the sampled excerpts; links for those are included only where it explicitly describes the relationship.

Main entry points: [`js/core.js`](https://github.com/sajid-sys/fec-dld-virtual-lab/blob/main/js/core.js) (Circuit state), [`js/app.js`](https://github.com/sajid-sys/fec-dld-virtual-lab/blob/main/js/app.js) (Bench interface), [`index.html`](https://github.com/sajid-sys/fec-dld-virtual-lab/blob/main/index.html) (Lab page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Lab interface"]
  node_page["Lab page<br/>[index.html]"]
  node_bench["Bench interface<br/>[app.js]"]
  node_board["Board rendering<br/>[app.js]"]
  node_circuit_edit["Circuit editing<br/>[app.js]"]
  node_experiment_view["Experiment sheets<br/>[app.js]"]
  node_checker["Circuit checker<br/>[app.js]"]
  node_persistence[("Saved session<br/>[app.js]")]
  node_student_services["Trainer controls<br/>[app.js]"]
end

subgraph group_simulation["Circuit simulation"]
  node_geometry["Board geometry<br/>[core.js]"]
  node_ic_library["IC library<br/>[core.js]"]
  node_circuit_state["Circuit state<br/>[core.js]"]
  node_net_compiler["Net compiler<br/>[core.js]"]
  node_logic_engine["Logic simulator<br/>[core.js]"]
end

subgraph group_learning["Experiments and guidance"]
  node_experiments["Experiment definitions<br/>[core.js]"]
  node_solutions["Reference solutions<br/>[core.js]"]
  node_guide["Guided build<br/>[core.js]"]
end

node_student(("Student"))

node_student -->|"opens"| node_page
node_page -->|"presents"| node_bench
node_student -->|"wires and places"| node_circuit_edit
node_bench -->|"renders"| node_board
node_circuit_edit -.->|"edits"| node_circuit_state
node_board -->|"uses geometry"| node_geometry
node_circuit_state -->|"uses pinouts"| node_ic_library
node_circuit_state -->|"compiles"| node_net_compiler
node_net_compiler -->|"provides nets"| node_logic_engine
node_student_services -.->|"sets inputs"| node_logic_engine
node_experiments -->|"defines solutions"| node_solutions
node_solutions -->|"builds circuit"| node_circuit_state
node_experiments -->|"supplies sheets"| node_experiment_view
node_checker -->|"checks circuit"| node_logic_engine
node_checker -->|"compares truth table"| node_experiments
node_guide -->|"derives steps"| node_solutions
node_guide -->|"guides wiring"| node_student
node_bench -->|"saves session"| node_persistence
node_student -->|"operates"| node_student_services

click node_page "https://github.com/sajid-sys/fec-dld-virtual-lab/blob/main/index.html"
click node_bench "https://github.com/sajid-sys/fec-dld-virtual-lab/blob/main/js/app.js"
click node_board "https://github.com/sajid-sys/fec-dld-virtual-lab/blob/main/js/app.js"
click node_circuit_edit "https://github.com/sajid-sys/fec-dld-virtual-lab/blob/main/js/app.js"
click node_experiment_view "https://github.com/sajid-sys/fec-dld-virtual-lab/blob/main/js/app.js"
click node_checker "https://github.com/sajid-sys/fec-dld-virtual-lab/blob/main/js/app.js"
click node_persistence "https://github.com/sajid-sys/fec-dld-virtual-lab/blob/main/js/app.js"
click node_geometry "https://github.com/sajid-sys/fec-dld-virtual-lab/blob/main/js/core.js"
click node_ic_library "https://github.com/sajid-sys/fec-dld-virtual-lab/blob/main/js/core.js"
click node_circuit_state "https://github.com/sajid-sys/fec-dld-virtual-lab/blob/main/js/core.js"
click node_net_compiler "https://github.com/sajid-sys/fec-dld-virtual-lab/blob/main/js/core.js"
click node_logic_engine "https://github.com/sajid-sys/fec-dld-virtual-lab/blob/main/js/core.js"
click node_experiments "https://github.com/sajid-sys/fec-dld-virtual-lab/blob/main/js/core.js"
click node_solutions "https://github.com/sajid-sys/fec-dld-virtual-lab/blob/main/js/core.js"
click node_guide "https://github.com/sajid-sys/fec-dld-virtual-lab/blob/main/js/core.js"
click node_student_services "https://github.com/sajid-sys/fec-dld-virtual-lab/blob/main/js/app.js"

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_page,node_bench,node_board,node_circuit_edit,node_experiment_view,node_checker,node_persistence,node_student_services toneBlue
class node_geometry,node_ic_library,node_circuit_state,node_net_compiler,node_logic_engine toneAmber
class node_experiments,node_solutions,node_guide toneMint
class node_student toneIndigo
```

## Components

### Lab interface

- [Lab page](https://github.com/sajid-sys/fec-dld-virtual-lab/blob/main/index.html): `index.html`
- [Bench interface](https://github.com/sajid-sys/fec-dld-virtual-lab/blob/main/js/app.js): `js/app.js`
- [Board rendering](https://github.com/sajid-sys/fec-dld-virtual-lab/blob/main/js/app.js): `js/app.js`
- [Circuit editing](https://github.com/sajid-sys/fec-dld-virtual-lab/blob/main/js/app.js): `js/app.js`
- [Experiment sheets](https://github.com/sajid-sys/fec-dld-virtual-lab/blob/main/js/app.js): `js/app.js`
- [Circuit checker](https://github.com/sajid-sys/fec-dld-virtual-lab/blob/main/js/app.js): `js/app.js`
- [Saved session](https://github.com/sajid-sys/fec-dld-virtual-lab/blob/main/js/app.js): `js/app.js`
- [Trainer controls](https://github.com/sajid-sys/fec-dld-virtual-lab/blob/main/js/app.js): `js/app.js`

### Circuit simulation

- [Board geometry](https://github.com/sajid-sys/fec-dld-virtual-lab/blob/main/js/core.js): `js/core.js`
- [IC library](https://github.com/sajid-sys/fec-dld-virtual-lab/blob/main/js/core.js): `js/core.js`
- [Circuit state](https://github.com/sajid-sys/fec-dld-virtual-lab/blob/main/js/core.js): `js/core.js`
- [Net compiler](https://github.com/sajid-sys/fec-dld-virtual-lab/blob/main/js/core.js): `js/core.js`
- [Logic simulator](https://github.com/sajid-sys/fec-dld-virtual-lab/blob/main/js/core.js): `js/core.js`

### Experiments and guidance

- [Experiment definitions](https://github.com/sajid-sys/fec-dld-virtual-lab/blob/main/js/core.js): `js/core.js`
- [Reference solutions](https://github.com/sajid-sys/fec-dld-virtual-lab/blob/main/js/core.js): `js/core.js`
- [Guided build](https://github.com/sajid-sys/fec-dld-virtual-lab/blob/main/js/core.js): `js/core.js`

### Other components

- **Student**

## Connections

- Student → Lab page: opens (evidence: `README.md`)
- Lab page → Bench interface: presents (evidence: `README.md`)
- Student → Circuit editing: wires and places (evidence: `README.md`)
- Bench interface → Board rendering: renders (evidence: `js/app.js`)
- Circuit editing → Circuit state: edits
- Board rendering → Board geometry: uses geometry (evidence: `js/app.js`)
- Circuit state → IC library: uses pinouts (evidence: `js/core.js`)
- Circuit state → Net compiler: compiles (evidence: `js/core.js`)
- Net compiler → Logic simulator: provides nets (evidence: `js/core.js`)
- Trainer controls → Logic simulator: sets inputs
- Experiment definitions → Reference solutions: defines solutions (evidence: `js/core.js`)
- Reference solutions → Circuit state: builds circuit (evidence: `js/core.js`)
- Experiment definitions → Experiment sheets: supplies sheets (evidence: `README.md`)
- Circuit checker → Logic simulator: checks circuit (evidence: `README.md`)
- Circuit checker → Experiment definitions: compares truth table (evidence: `README.md`)
- Guided build → Reference solutions: derives steps (evidence: `js/core.js`)
- Guided build → Student: guides wiring (evidence: `README.md`)
- Bench interface → Saved session: saves session (evidence: `js/app.js`)
- Student → Trainer controls: operates (evidence: `README.md`)
