# nflsdq/logiclab2 architecture

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

- Interactive diagram: https://gitdiagram.com/nflsdq/logiclab2
- Repository: https://github.com/nflsdq/logiclab2

## Overview

LogicLab Vision is a mobile learning app for digital logic gates. Users can enter binary inputs and choose a gate manually, or scan inputs and a gate with the camera; both routes lead to a result screen that calculates the output and displays a truth table. Separate learning screens explain gate basics, symbols, and truth tables. The model utility loads bundled TensorFlow models for image recognition. Connections reflect the shown navigation and calls; unsampled screen behavior is not inferred.

Main entry points: [`App.tsx`](https://github.com/nflsdq/logiclab2/blob/main/App.tsx) (App Router), [`components/Home.tsx`](https://github.com/nflsdq/logiclab2/blob/main/components/Home.tsx) (Home), [`utils/tensorflowModel.ts`](https://github.com/nflsdq/logiclab2/blob/main/utils/tensorflowModel.ts) (Model Inference), [`components/ManualInputScreen.tsx`](https://github.com/nflsdq/logiclab2/blob/main/components/ManualInputScreen.tsx) (Manual Inputs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App Navigation"]
  node_home["Home<br/>[Home.tsx]"]
  node_router["App Router<br/>[App.tsx]"]
end

subgraph group_workflow["Gate Evaluation"]
  node_manual["Manual Inputs"]
  node_scan["Camera Scan<br/>[ScanScreen.tsx]"]
  node_gate_logic["Gate Logic<br/>[logicGates.ts]"]
  node_result["Result View<br/>[ResultScreen.tsx]"]
end

subgraph group_learning["Learning Content"]
  node_learn["Learning Topics<br/>[LearnScreen.tsx]"]
  node_basics["Gate Basics"]
  node_tables["Truth Tables"]
  node_symbols["Gate Symbols"]
end

subgraph group_recognition["Image Recognition"]
  node_model_service["Model Inference<br/>[tensorflowModel.ts]"]
  node_input_model["Input Model<br/>[model.json]"]
  node_gate_model["Gate Model<br/>[model.json]"]
end

node_home -->|"navigates via"| node_router
node_router -->|"registers"| node_home
node_router -->|"registers"| node_scan
node_router -->|"registers"| node_manual
node_router -->|"registers"| node_result
node_router -->|"registers"| node_learn
node_router -->|"registers"| node_basics
node_router -->|"registers"| node_tables
node_router -->|"registers"| node_symbols
node_home -->|"opens"| node_scan
node_home -->|"opens"| node_manual
node_home -->|"opens"| node_learn
node_manual -->|"uses"| node_gate_logic
node_result -->|"calculates with"| node_gate_logic
node_scan -->|"predicts with"| node_model_service
node_model_service -->|"loads"| node_input_model
node_model_service -->|"loads"| node_gate_model

click node_home "https://github.com/nflsdq/logiclab2/blob/main/components/Home.tsx"
click node_router "https://github.com/nflsdq/logiclab2/blob/main/App.tsx"
click node_manual "https://github.com/nflsdq/logiclab2/blob/main/components/ManualInputScreen.tsx"
click node_scan "https://github.com/nflsdq/logiclab2/blob/main/components/ScanScreen.tsx"
click node_gate_logic "https://github.com/nflsdq/logiclab2/blob/main/utils/logicGates.ts"
click node_result "https://github.com/nflsdq/logiclab2/blob/main/components/ResultScreen.tsx"
click node_learn "https://github.com/nflsdq/logiclab2/blob/main/components/LearnScreen.tsx"
click node_basics "https://github.com/nflsdq/logiclab2/blob/main/components/BasicLogicGatesScreen.tsx"
click node_tables "https://github.com/nflsdq/logiclab2/blob/main/components/TruthTablesScreen.tsx"
click node_symbols "https://github.com/nflsdq/logiclab2/blob/main/components/LogicGateSymbolsScreen.tsx"
click node_model_service "https://github.com/nflsdq/logiclab2/blob/main/utils/tensorflowModel.ts"
click node_input_model "https://github.com/nflsdq/logiclab2/blob/main/assets/models/input-model/model.json"
click node_gate_model "https://github.com/nflsdq/logiclab2/blob/main/assets/models/gate-model/model.json"

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_home,node_router toneBlue
class node_manual,node_scan,node_gate_logic,node_result toneAmber
class node_learn,node_basics,node_tables,node_symbols toneMint
class node_model_service,node_input_model,node_gate_model toneRose
```

## Components

### App Navigation

- [Home](https://github.com/nflsdq/logiclab2/blob/main/components/Home.tsx): `components/Home.tsx`
- [App Router](https://github.com/nflsdq/logiclab2/blob/main/App.tsx): `App.tsx`

### Gate Evaluation

- [Manual Inputs](https://github.com/nflsdq/logiclab2/blob/main/components/ManualInputScreen.tsx): `components/ManualInputScreen.tsx`
- [Camera Scan](https://github.com/nflsdq/logiclab2/blob/main/components/ScanScreen.tsx): `components/ScanScreen.tsx`
- [Gate Logic](https://github.com/nflsdq/logiclab2/blob/main/utils/logicGates.ts): `utils/logicGates.ts`
- [Result View](https://github.com/nflsdq/logiclab2/blob/main/components/ResultScreen.tsx): `components/ResultScreen.tsx`

### Learning Content

- [Learning Topics](https://github.com/nflsdq/logiclab2/blob/main/components/LearnScreen.tsx): `components/LearnScreen.tsx`
- [Gate Basics](https://github.com/nflsdq/logiclab2/blob/main/components/BasicLogicGatesScreen.tsx): `components/BasicLogicGatesScreen.tsx`
- [Truth Tables](https://github.com/nflsdq/logiclab2/blob/main/components/TruthTablesScreen.tsx): `components/TruthTablesScreen.tsx`
- [Gate Symbols](https://github.com/nflsdq/logiclab2/blob/main/components/LogicGateSymbolsScreen.tsx): `components/LogicGateSymbolsScreen.tsx`

### Image Recognition

- [Model Inference](https://github.com/nflsdq/logiclab2/blob/main/utils/tensorflowModel.ts): `utils/tensorflowModel.ts`
- [Input Model](https://github.com/nflsdq/logiclab2/blob/main/assets/models/input-model/model.json): `assets/models/input-model/model.json`
- [Gate Model](https://github.com/nflsdq/logiclab2/blob/main/assets/models/gate-model/model.json): `assets/models/gate-model/model.json`

## Connections

- Home → App Router: navigates via (evidence: `components/Home.tsx`)
- App Router → Home: registers (evidence: `App.tsx`)
- App Router → Camera Scan: registers (evidence: `App.tsx`)
- App Router → Manual Inputs: registers (evidence: `App.tsx`)
- App Router → Result View: registers (evidence: `App.tsx`)
- App Router → Learning Topics: registers (evidence: `App.tsx`)
- App Router → Gate Basics: registers (evidence: `App.tsx`)
- App Router → Truth Tables: registers (evidence: `App.tsx`)
- App Router → Gate Symbols: registers (evidence: `App.tsx`)
- Home → Camera Scan: opens (evidence: `components/Home.tsx`)
- Home → Manual Inputs: opens (evidence: `components/Home.tsx`)
- Home → Learning Topics: opens (evidence: `components/Home.tsx`)
- Manual Inputs → Gate Logic: uses (evidence: `components/ManualInputScreen.tsx`)
- Result View → Gate Logic: calculates with (evidence: `components/ResultScreen.tsx`)
- Camera Scan → Model Inference: predicts with (evidence: `components/ScanScreen.tsx`)
- Model Inference → Input Model: loads (evidence: `utils/tensorflowModel.ts`)
- Model Inference → Gate Model: loads (evidence: `utils/tensorflowModel.ts`)
