Skip to main content

Quant-Net API

Web dashboard and REST API for the Quant-Net quantum networking platform. Provides real-time monitoring of network agents, experiment management, calibration tracking, and topology visualization through a browser-based interface backed by a FastAPI server.

Prerequisites

Tool Version Purpose
Python ≥ 3.10 API server runtime
Node.js ≥ 18 JavaScript bundling (development only)
MongoDB ≥ 6.0 Data persistence (via quantnet-mq)
MQTT Broker Mosquitto or compatible Real-time messaging with WebSocket support

Quick Start

# 1. Install Python dependencies
pip install -r requirements.txt

# 2. Install JS build tools and bundle the frontend
npm install
npm run build

# 3. Start the server
python main.py

The dashboard is available at http://localhost:8081.

Configuration

The server reads its configuration from a quantnet.cfg INI file. It searches the following paths in order:

  1. ${QUANTNET_HOME}/etc/quantnet.cfg
  2. ${VIRTUAL_ENV}/etc/quantnet.cfg
  3. /opt/quantnet/etc/quantnet.cfg

If no configuration file is found, the server starts with default values.

Configuration File Format

[mq]
host = 127.0.0.1          # MQTT broker host
port = 1883                # MQTT broker port
ws_host = 127.0.0.1        # MQTT WebSocket host (for browser connections)
ws_port = 8080              # MQTT WebSocket port
mongo_host = 127.0.0.1     # MongoDB host
mongo_port = 27017          # MongoDB port
rpc_server_topic = ...     # RPC server topic (optional)
rpc_client_topic = ...     # RPC client topic (optional)
path = ...                 # MQTT path prefix (optional)

[main]
request_types = spgRequest,egpRequest,bsmRequest   # Known experiment request types

[schemas]
path = /path/to/schemas    # JSON schema directory (optional)

Configuration Parameters

Section Key Default Description
mq host 127.0.0.1 MQTT broker hostname
mq port 1883 MQTT broker port
mq ws_host 127.0.0.1 WebSocket host for browser MQTT connections
mq ws_port 8080 WebSocket port for browser MQTT connections
mq mongo_host 127.0.0.1 MongoDB hostname
mq mongo_port 27017 MongoDB port
mq rpc_server_topic — AMQP/MQTT topic for RPC server
mq rpc_client_topic — AMQP/MQTT topic for RPC client
mq path — MQTT path prefix
main request_types spgRequest, egpRequest, bsmRequest Comma-separated list of known experiment request types
schemas path — Path to JSON schema files for validation

Server Options

python main.py [--host HOST] [--port PORT]
Flag Default Description
--host 0.0.0.0 Network interface to bind
--port 8081 HTTP port for the dashboard and API

The server runs with auto-reload enabled by default (via uvicorn).

JavaScript Build

The frontend is bundled with esbuild from ES module source files into a single minified bundle.

Build Commands

npm run build    # Production build — minified with source map
npm run watch    # Development — auto-rebuild on file changes

Build Output

static/js/dist/bundle.min.js        # Minified application bundle (~57kb)
static/js/dist/bundle.min.js.map    # Source map for debugging

Important: The JS bundle must be built before starting the server. The static/js/dist/ directory is git-ignored, so npm run build must be run after cloning the repository.

Source Structure

static/js/
├── main.js                          # esbuild entry point
├── app.js                           # App bootstrap class
├── core/
│   ├── EventBus.js                  # Pub/sub event system
│   ├── ApiClient.js                 # REST API client
│   └── MqttClient.js               # MQTT WebSocket client
├── utils/
│   └── formatters.js                # UI helpers and HTML formatters
├── models/
│   ├── AgentStore.js                # Agent state management
│   ├── CalibrationStore.js          # Calibration data store
│   └── ExperimentStore.js           # Experiment data store
├── components/
│   ├── AgentTable.js                # Agent table with heartbeat tracking
│   ├── CalibrationTable.js          # Calibration results table
│   ├── ExperimentTable.js           # Experiment results table
│   ├── DebugPanel.js                # MQTT message debug panel
│   ├── TopologyGraph.js             # vis.js network topology
│   ├── modals/
│   │   ├── AgentModal.js            # Agent details and calibration viewer
│   │   ├── CalibrationDetailsModal.js
│   │   ├── CalibrationFormModal.js   # Calibration submission form
│   │   ├── EgpModal.js              # Entanglement generation form
│   │   ├── ExperimentModal.js       # Experiment details viewer
│   │   ├── PingModal.js             # Agent ping form
│   │   └── SpgModal.js              # Single photon / BSM experiment form
│   └── charts/
│       ├── BsmChart.js              # BSM tracking scatter chart
│       ├── CalibrationChart.js      # Per-task calibration charts
│       ├── DataChart.js             # Time-series data chart
│       ├── HistogramChart.js        # Normal distribution histogram
│       ├── HomChart.js              # HOM coincidence chart
│       ├── PolTrackingChart.js      # Polarization tracking chart
│       └── TimeTaggerChart.js       # Wavepacket and collection rate charts
└── (vendor libs)                    # bootstrap, chart.js, vis-network, paho-mqtt

REST API

The API is mounted at /api and documented via OpenAPI. When the server is running, interactive docs are available at:

  • Swagger UI: http://localhost:8081/docs
  • ReDoc: http://localhost:8081/redoc

Key Endpoints

Method Path Description
GET /api/node List all agents or get a specific agent by ID
GET /api/topology Get the network topology graph
POST /api/pingpong Send ping requests to remote agents
POST /api/calibrate Start a calibration process
GET /api/calibration Get calibration results
GET /api/experiments List experiments with optional filters
GET /api/tasks Get agent task results
POST /api/bsm Start a BSM experiment
POST /api/spg Start single photon generation
POST /api/egp Start entanglement generation

Authentication

The dashboard supports optional cookie-based authentication via fastapi-login. Default credentials:

Username Password
admin admin
  • / — Public dashboard (no login required)
  • /private — Authenticated dashboard
  • /login — POST login form
  • /logout — Clear session

Docker

DOCKER_BUILDKIT=1 docker build \
  --secret id=GH_TOKEN,src=<(echo $GH_TOKEN) \
  -f docker/Dockerfile .

The Docker image clones the required private repositories (quant-net-mq, quant-net-plugins, quant-net-server) during build using a GitHub token. The container runs python main.py as its entrypoint.

Environment Variables

Variable Description
QUANTNET_HOME Base directory for configuration files
QUANTNET_ENTRYPOINT_DELAY Seconds to wait before starting (for dependency readiness)
QUANTNET_ENTRYPOINT_QUIET_LOGS Suppress entrypoint log messages

License

See LICENSE and COPYRIGHT.

Metadata

Release files for quantnet-api 1.1.0.post3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for quantnet-api 1.1.0.post3
File Size Uploaded Provenance Actions
quantnet_api-1.1.0.post3.tar.gz 653.1 kB Without provenance Details for quantnet_api-1.1.0.post3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for quantnet-api 1.1.0.post3
File Interpreter ABI Platform Actions
quantnet_api-1.1.0.post3-py3-none-any.whl Python 3 none any Details for quantnet_api-1.1.0.post3-py3-none-any.whl

Total release size: 1.3 MB

Release files / quantnet_api-1.1.0.post3.tar.gz

Download URL quantnet_api-1.1.0.post3.tar.gz
Size 653.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6f247c24e75eb1542ca1a423859db031d9daa9445bd648866c3f4c34ec7cee7a
BLAKE2b-256 checksum
How to use checksums
4c92fe72c3cef011b733600851e0667d141d0bfc53a9c562a90a844269e452d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / quantnet_api-1.1.0.post3-py3-none-any.whl

Download URL quantnet_api-1.1.0.post3-py3-none-any.whl
Size 671.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2a35ba0001a7d423dc3a32859c5b799be803b8c888f0fd59730239a186ca7700
BLAKE2b-256 checksum
How to use checksums
1f70fb8d31dcdae0615ec73bdfd5092c63e3b400157553e1a506766d48e56e5b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Security for quantnet-api 1.1.0.post3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page