# primer3-org/primer3plus architecture

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

- Interactive diagram: https://gitdiagram.com/primer3-org/primer3plus
- Repository: https://github.com/primer3-org/primer3plus

## Overview

Primer3Plus is a browser-based interface for designing and evaluating PCR primers with Primer3. Users enter sequence and settings, submit a design request, and review returned primer candidates; the client also supports comparison, genome-browser-related workflows, prefold calculations, and primer-library management. The Flask server mediates requests to Primer3 and related command-line tools, serves settings and statistics, and records run data. The main client/server and statistics links are visible in excerpts; several documented or tree-indicated features are represented without speculative internal call chains.

Main entry points: [`server/server.py`](https://github.com/primer3-org/primer3plus/blob/main/server/server.py) (Flask API), [`client/src/static/js/primer3plus.js`](https://github.com/primer3-org/primer3plus/blob/main/client/src/static/js/primer3plus.js) (Primer design UI), [`log`](https://github.com/primer3-org/primer3plus/tree/main/log) (Run logs), [`client/src/static/js/primer3manager.js`](https://github.com/primer3-org/primer3plus/blob/main/client/src/static/js/primer3manager.js) (Primer library manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Primer3Plus client"]
  node_webui["Primer design UI<br/>[primer3plus.js]"]
  node_results["Primer results<br/>[primer3plus.js]"]
  node_compare["Result comparison<br/>[primer3plus.js]"]
  node_genome["Genome workflows<br/>[primer3plus.js]"]
  node_prefold["Prefold workflow<br/>[primer3plus.js]"]
  node_manager["Primer library manager<br/>[primer3manager.js]"]
  node_zip["ZIP generation<br/>[jszip.js]"]
end

subgraph group_server["Analysis server"]
  node_server["Flask API<br/>[server.py]"]
end

subgraph group_resources["Settings and data"]
  node_settings["Design settings"]
  node_mispriming["Mispriming libraries"]
end

subgraph group_reporting["Run reporting"]
  node_runlogs[("Run logs")]
  node_statistics["Statistics view"]
  node_logsummary["Log summarizers<br/>[logSum.py]"]
  node_joinsums["Summary joiner<br/>[joinSumFiles.py]"]
end

node_user(("Researcher"))
node_primer3["Primer3 engine"]
node_unafold["UNAFold tool"]

node_user -->|"enters sequence"| node_webui
node_webui -->|"requests settings"| node_server
node_webui -->|"submits design"| node_server
node_server -->|"loads settings"| node_settings
node_server -->|"runs design"| node_primer3
node_server -->|"configures libraries"| node_mispriming
node_server -->|"returns results"| node_results
node_webui -->|"renders results"| node_results
node_user -->|"compares files"| node_compare
node_user -->|"loads genome data"| node_genome
node_user -->|"requests prefold"| node_prefold
node_server -->|"runs folding"| node_unafold
node_user -->|"manages primers"| node_manager
node_manager -->|"creates RDML archive"| node_zip
node_server -->|"records runs"| node_runlogs
node_statistics -->|"requests statistics"| node_server
node_server -->|"returns statistics"| node_statistics
node_logsummary -->|"summarizes logs"| node_runlogs
node_joinsums -->|"reads summaries"| node_runlogs

click node_webui "https://github.com/primer3-org/primer3plus/blob/main/client/src/static/js/primer3plus.js"
click node_results "https://github.com/primer3-org/primer3plus/blob/main/client/src/static/js/primer3plus.js"
click node_compare "https://github.com/primer3-org/primer3plus/blob/main/client/src/static/js/primer3plus.js"
click node_genome "https://github.com/primer3-org/primer3plus/blob/main/client/src/static/js/primer3plus.js"
click node_prefold "https://github.com/primer3-org/primer3plus/blob/main/client/src/static/js/primer3plus.js"
click node_manager "https://github.com/primer3-org/primer3plus/blob/main/client/src/static/js/primer3manager.js"
click node_zip "https://github.com/primer3-org/primer3plus/blob/main/client/src/static/js/jszip.js"
click node_server "https://github.com/primer3-org/primer3plus/blob/main/server/server.py"
click node_settings "https://github.com/primer3-org/primer3plus/tree/main/server/settings_files"
click node_mispriming "https://github.com/primer3-org/primer3plus/tree/main/server/mispriming_lib"
click node_runlogs "https://github.com/primer3-org/primer3plus/tree/main/log"
click node_statistics "https://github.com/primer3-org/primer3plus/blob/main/client/src/static/js/primer3statistics.js"
click node_logsummary "https://github.com/primer3-org/primer3plus/blob/main/server/logSum.py"
click node_joinsums "https://github.com/primer3-org/primer3plus/blob/main/server/joinSumFiles.py"

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_webui,node_results,node_compare,node_genome,node_prefold,node_manager,node_zip toneBlue
class node_server toneAmber
class node_settings,node_mispriming toneMint
class node_runlogs,node_statistics,node_logsummary,node_joinsums toneRose
class node_user,node_primer3,node_unafold toneIndigo
```

## Components

### Primer3Plus client

- [Primer design UI](https://github.com/primer3-org/primer3plus/blob/main/client/src/static/js/primer3plus.js): `client/src/static/js/primer3plus.js`
- [Primer results](https://github.com/primer3-org/primer3plus/blob/main/client/src/static/js/primer3plus.js): `client/src/static/js/primer3plus.js`
- [Result comparison](https://github.com/primer3-org/primer3plus/blob/main/client/src/static/js/primer3plus.js): `client/src/static/js/primer3plus.js`
- [Genome workflows](https://github.com/primer3-org/primer3plus/blob/main/client/src/static/js/primer3plus.js): `client/src/static/js/primer3plus.js`
- [Prefold workflow](https://github.com/primer3-org/primer3plus/blob/main/client/src/static/js/primer3plus.js): `client/src/static/js/primer3plus.js`
- [Primer library manager](https://github.com/primer3-org/primer3plus/blob/main/client/src/static/js/primer3manager.js): `client/src/static/js/primer3manager.js`
- [ZIP generation](https://github.com/primer3-org/primer3plus/blob/main/client/src/static/js/jszip.js): `client/src/static/js/jszip.js`

### Analysis server

- [Flask API](https://github.com/primer3-org/primer3plus/blob/main/server/server.py): `server/server.py`

### Settings and data

- [Design settings](https://github.com/primer3-org/primer3plus/tree/main/server/settings_files): `server/settings_files`
- [Mispriming libraries](https://github.com/primer3-org/primer3plus/tree/main/server/mispriming_lib): `server/mispriming_lib`

### Run reporting

- [Run logs](https://github.com/primer3-org/primer3plus/tree/main/log): `log`
- [Statistics view](https://github.com/primer3-org/primer3plus/blob/main/client/src/static/js/primer3statistics.js): `client/src/static/js/primer3statistics.js`
- [Log summarizers](https://github.com/primer3-org/primer3plus/blob/main/server/logSum.py): `server/logSum.py`
- [Summary joiner](https://github.com/primer3-org/primer3plus/blob/main/server/joinSumFiles.py): `server/joinSumFiles.py`

### Other components

- **Researcher**
- **Primer3 engine**
- **UNAFold tool**

## Connections

- Researcher → Primer design UI: enters sequence (evidence: `client/src/static/js/primer3plus.js`)
- Primer design UI → Flask API: requests settings (evidence: `client/src/static/js/primer3plus.js`)
- Primer design UI → Flask API: submits design (evidence: `client/src/static/js/primer3plus.js`)
- Flask API → Design settings: loads settings
- Flask API → Primer3 engine: runs design (evidence: `README.md`)
- Flask API → Mispriming libraries: configures libraries (evidence: `server/server.py`)
- Flask API → Primer results: returns results (evidence: `client/src/static/js/primer3plus.js`)
- Primer design UI → Primer results: renders results (evidence: `client/src/static/js/primer3plus.js`)
- Researcher → Result comparison: compares files (evidence: `client/src/static/js/primer3plus.js`)
- Researcher → Genome workflows: loads genome data (evidence: `client/src/static/js/primer3plus.js`)
- Researcher → Prefold workflow: requests prefold
- Flask API → UNAFold tool: runs folding (evidence: `server/server.py`)
- Researcher → Primer library manager: manages primers (evidence: `client/src/static/js/primer3manager.js`)
- Primer library manager → ZIP generation: creates RDML archive (evidence: `client/src/static/js/primer3manager.js`)
- Flask API → Run logs: records runs (evidence: `server/server.py`)
- Statistics view → Flask API: requests statistics (evidence: `client/src/static/js/primer3statistics.js`)
- Flask API → Statistics view: returns statistics (evidence: `client/src/static/js/primer3statistics.js`)
- Log summarizers → Run logs: summarizes logs (evidence: `server/logSum.py`)
- Summary joiner → Run logs: reads summaries (evidence: `server/joinSumFiles.py`)
