# sinjie2008/foundational-electronics-core-systems architecture

> Architecture diagram of the GitHub repository sinjie2008/foundational-electronics-core-systems, 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/sinjie2008/foundational-electronics-core-systems
- Repository: https://github.com/sinjie2008/foundational-electronics-core-systems

## Overview

This PHP application provides catalog administration and product/specification discovery, plus LaTeX and Typst document generation. The main user workflow is to browse or search catalog data, select products or series, and generate a PDF from a managed template; administrative APIs also manage catalog imports, exports, history, and restoration. The graph reflects sampled endpoint-to-service calls where visible and documented capabilities indicated by the tree. Several routes and the README were not available in source excerpts, so uncertain internal wiring is omitted.

Main entry points: [`app/Typst/TypstService.php`](https://github.com/sinjie2008/foundational-electronics-core-systems/blob/main/app/Typst/TypstService.php) (Typst service), [`app/Catalog/CatalogService.php`](https://github.com/sinjie2008/foundational-electronics-core-systems/blob/main/app/Catalog/CatalogService.php) (Catalog queries), [`app/Latex/LatexService.php`](https://github.com/sinjie2008/foundational-electronics-core-systems/blob/main/app/Latex/LatexService.php) (LaTeX service), [`catalog.php`](https://github.com/sinjie2008/foundational-electronics-core-systems/blob/main/catalog.php) (Catalog API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_catalog["Catalog management"]
  node_catalog_ui["Catalog interface<br/>[catalog.php]"]
  node_catalog_api["Catalog API<br/>[catalog.php]"]
  node_catalog_routes["Catalog routes"]
  node_catalog_service["Catalog queries<br/>[CatalogService.php]"]
  node_catalog_search_route["Catalog search route<br/>[search.php]"]
  node_hierarchy_route["Catalog hierarchy route<br/>[hierarchy.php]"]
  node_search_route["Catalog search route<br/>[search.php]"]
end

subgraph group_discovery["Specification search"]
  node_spec_routes["Spec search routes"]
  node_spec_service["Spec search queries"]
end

subgraph group_documents["Document generation"]
  node_latex_routes["LaTeX routes"]
  node_latex_service["LaTeX service<br/>[LatexService.php]"]
  node_typst_routes["Typst routes"]
  node_typst_service["Typst service<br/>[TypstService.php]"]
  node_latex_api_routes["LaTeX API routes"]
end

subgraph group_support["Application support"]
  node_bootstrap["App bootstrap<br/>[bootstrap.php]"]
  node_request["Request helper<br/>[Request.php]"]
  node_config["App configuration<br/>[app.php]"]
end

node_user(("Catalog user"))
node_db[("MySQL database")]
node_latex_engine["LaTeX compiler"]
node_typst_engine["Typst compiler"]
node_pdf_storage[("Generated PDFs")]

node_user -->|"uses"| node_catalog_ui
node_catalog_ui -->|"requests"| node_catalog_api
node_catalog_routes -.->|"routes"| node_catalog_api
node_catalog_search_route -->|"calls"| node_catalog_service
node_search_route -->|"calls"| node_catalog_service
node_hierarchy_route -.->|"queries"| node_catalog_service
node_spec_routes -.->|"queries"| node_spec_service
node_catalog_service -->|"queries"| node_db
node_spec_service -->|"queries"| node_db
node_catalog_api -.->|"manages catalog"| node_db
node_user -->|"searches"| node_spec_routes
node_user -->|"manages templates"| node_latex_routes
node_latex_routes -->|"calls"| node_latex_service
node_latex_service -->|"loads series"| node_catalog_service
node_latex_service -->|"reads/writes"| node_db
node_latex_service -->|"compiles"| node_latex_engine
node_latex_service -->|"stores PDF"| node_pdf_storage
node_user -->|"manages documents"| node_typst_routes
node_typst_routes -->|"calls"| node_typst_service
node_typst_service -->|"loads series"| node_catalog_service
node_typst_service -->|"reads/writes"| node_db
node_typst_service -->|"compiles"| node_typst_engine
node_typst_service -->|"stores PDF"| node_pdf_storage
node_latex_api_routes -.->|"calls"| node_typst_service
node_catalog_api -.->|"loads"| node_bootstrap
node_catalog_search_route -->|"reads request"| node_request
node_typst_routes -.->|"configures"| node_config

click node_catalog_ui "https://github.com/sinjie2008/foundational-electronics-core-systems/blob/main/public/catalog.php"
click node_catalog_api "https://github.com/sinjie2008/foundational-electronics-core-systems/blob/main/catalog.php"
click node_catalog_routes "https://github.com/sinjie2008/foundational-electronics-core-systems/tree/main/public/api/catalog"
click node_catalog_service "https://github.com/sinjie2008/foundational-electronics-core-systems/blob/main/app/Catalog/CatalogService.php"
click node_catalog_search_route "https://github.com/sinjie2008/foundational-electronics-core-systems/blob/main/public/api/catalog/search.php"
click node_spec_routes "https://github.com/sinjie2008/foundational-electronics-core-systems/tree/main/api/spec-search"
click node_spec_service "https://github.com/sinjie2008/foundational-electronics-core-systems/blob/main/app/SpecSearch/SpecSearchService.php"
click node_hierarchy_route "https://github.com/sinjie2008/foundational-electronics-core-systems/blob/main/api/catalog/hierarchy.php"
click node_search_route "https://github.com/sinjie2008/foundational-electronics-core-systems/blob/main/api/catalog/search.php"
click node_latex_routes "https://github.com/sinjie2008/foundational-electronics-core-systems/tree/main/public/api/latex"
click node_latex_service "https://github.com/sinjie2008/foundational-electronics-core-systems/blob/main/app/Latex/LatexService.php"
click node_typst_routes "https://github.com/sinjie2008/foundational-electronics-core-systems/tree/main/public/api/typst"
click node_typst_service "https://github.com/sinjie2008/foundational-electronics-core-systems/blob/main/app/Typst/TypstService.php"
click node_latex_api_routes "https://github.com/sinjie2008/foundational-electronics-core-systems/tree/main/api/typst"
click node_bootstrap "https://github.com/sinjie2008/foundational-electronics-core-systems/blob/main/app/bootstrap.php"
click node_request "https://github.com/sinjie2008/foundational-electronics-core-systems/blob/main/app/Support/Request.php"
click node_config "https://github.com/sinjie2008/foundational-electronics-core-systems/blob/main/config/app.php"

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_catalog_ui,node_catalog_api,node_catalog_routes,node_catalog_service,node_catalog_search_route,node_hierarchy_route,node_search_route,node_user toneBlue
class node_spec_routes,node_spec_service,node_db,node_pdf_storage toneAmber
class node_latex_routes,node_latex_service,node_typst_routes,node_typst_service,node_latex_api_routes toneMint
class node_bootstrap,node_request,node_config toneRose
class node_latex_engine,node_typst_engine toneIndigo
```

## Components

### Catalog management

- [Catalog interface](https://github.com/sinjie2008/foundational-electronics-core-systems/blob/main/public/catalog.php): `public/catalog.php`
- [Catalog API](https://github.com/sinjie2008/foundational-electronics-core-systems/blob/main/catalog.php): `catalog.php`
- [Catalog routes](https://github.com/sinjie2008/foundational-electronics-core-systems/tree/main/public/api/catalog): `public/api/catalog`
- [Catalog queries](https://github.com/sinjie2008/foundational-electronics-core-systems/blob/main/app/Catalog/CatalogService.php): `app/Catalog/CatalogService.php`
- [Catalog search route](https://github.com/sinjie2008/foundational-electronics-core-systems/blob/main/public/api/catalog/search.php): `public/api/catalog/search.php`
- [Catalog hierarchy route](https://github.com/sinjie2008/foundational-electronics-core-systems/blob/main/api/catalog/hierarchy.php): `api/catalog/hierarchy.php`
- [Catalog search route](https://github.com/sinjie2008/foundational-electronics-core-systems/blob/main/api/catalog/search.php): `api/catalog/search.php`

### Specification search

- [Spec search routes](https://github.com/sinjie2008/foundational-electronics-core-systems/tree/main/api/spec-search): `api/spec-search`
- [Spec search queries](https://github.com/sinjie2008/foundational-electronics-core-systems/blob/main/app/SpecSearch/SpecSearchService.php): `app/SpecSearch/SpecSearchService.php`

### Document generation

- [LaTeX routes](https://github.com/sinjie2008/foundational-electronics-core-systems/tree/main/public/api/latex): `public/api/latex`
- [LaTeX service](https://github.com/sinjie2008/foundational-electronics-core-systems/blob/main/app/Latex/LatexService.php): `app/Latex/LatexService.php`
- [Typst routes](https://github.com/sinjie2008/foundational-electronics-core-systems/tree/main/public/api/typst): `public/api/typst`
- [Typst service](https://github.com/sinjie2008/foundational-electronics-core-systems/blob/main/app/Typst/TypstService.php): `app/Typst/TypstService.php`
- [LaTeX API routes](https://github.com/sinjie2008/foundational-electronics-core-systems/tree/main/api/typst): `api/typst`

### Application support

- [App bootstrap](https://github.com/sinjie2008/foundational-electronics-core-systems/blob/main/app/bootstrap.php): `app/bootstrap.php`
- [Request helper](https://github.com/sinjie2008/foundational-electronics-core-systems/blob/main/app/Support/Request.php): `app/Support/Request.php`
- [App configuration](https://github.com/sinjie2008/foundational-electronics-core-systems/blob/main/config/app.php): `config/app.php`

### Other components

- **Catalog user**
- **MySQL database**
- **LaTeX compiler**
- **Typst compiler**
- **Generated PDFs**

## Connections

- Catalog user → Catalog interface: uses
- Catalog interface → Catalog API: requests
- Catalog routes → Catalog API: routes
- Catalog search route → Catalog queries: calls
- Catalog search route → Catalog queries: calls
- Catalog hierarchy route → Catalog queries: queries
- Spec search routes → Spec search queries: queries
- Catalog queries → MySQL database: queries
- Spec search queries → MySQL database: queries
- Catalog API → MySQL database: manages catalog
- Catalog user → Spec search routes: searches
- Catalog user → LaTeX routes: manages templates
- LaTeX routes → LaTeX service: calls
- LaTeX service → Catalog queries: loads series
- LaTeX service → MySQL database: reads/writes
- LaTeX service → LaTeX compiler: compiles
- LaTeX service → Generated PDFs: stores PDF
- Catalog user → Typst routes: manages documents
- Typst routes → Typst service: calls
- Typst service → Catalog queries: loads series
- Typst service → MySQL database: reads/writes
- Typst service → Typst compiler: compiles
- Typst service → Generated PDFs: stores PDF
- LaTeX API routes → Typst service: calls
- Catalog API → App bootstrap: loads
- Catalog search route → Request helper: reads request
- Typst routes → App configuration: configures
