Skip to main content
Ctrl K

NAPMIX – Nuclear, Astro, and Particle Metadata Integration for eXperiments

NAPMIX is a web-based platform for creating, managing and publishing experimental metadata in nuclear, astroparticle and particle physics. It provides a cross-domain metadata schema, REST APIs, JSON export and governance workflows to support FAIR research data.

11
contributors
Get started
397 commitsLast commit ≈ 1 week ago1 star2 forks

Cite this software

Description

NAPMIX Project Overview

The Nuclear, Astro, and Particle Metadata Integration for eXperiments (NAPMIX) project develops a cross-domain metadata schema and generator for datasets tailored for experimental Nuclear, Astro, and Particle Physics (NAP) communities. Its React frontend and Django backend support scientific metadata entry, project governance, snapshots and JSON/XML metadata exports.

The core of NAPMIX is the ‘nodal’ multi-layered structure, allowing the schema to be enriched with multiple domains while preserving common overlaps, enhancing FAIR principles (Findable, Accessible, Interoperable, and Reusable) of data and other digital research objects.

Project Partners

GSI, FAIR, GANIL, HUN-REN ATOMKI, KIT, LATR-IST, US-CNA, UAM, DESY, TU Darmstadt, HZDR.

The authors acknowledge the OSCARS project, which has received funding from the European Commission’s Horizon Europe Research and Innovation programme under grant agreement No. 101129751.


Choose your installation path

Your situationFollow
Try NAPMIX with a new, empty local databaseA. Local quick start below
New public installation on a prepared serverB. Production below
Existing managed Docker installationC. Managed upgrade below
Older installation without deployment markersD. Legacy adoption below

Already have data/configuration? Do not repeat a new-install sequence. Keep its existing project name, Compose files, .env, secrets and volumes. A different Compose project selects different database/state volumes and can make your data appear missing.

Prerequisites and source

These commands use a POSIX shell (sh) and Linux containers:

  • Linux: a Docker-supported distribution such as Ubuntu/Debian, with Docker Engine and the Compose plugin. Linux x86-64 is the verified deployment platform. Image CPU requirements also matter: older processors or virtual CPU models may fail with CPU does not support x86-64-v2. Check CPU compatibility before initializing data.
  • macOS: Docker Desktop and Terminal. Windows: Docker Desktop with WSL2 integration, then run all commands in your WSL Linux terminal, preferably with the checkout in the WSL filesystem. Native PowerShell is not a supported shell for these scripts. macOS/WSL2 are documented paths, not tested platforms in this milestone.
  • Git and access to the NAPMIX repository; Docker Engine 27+ and Compose plugin 2.24.4+ (docker compose, not the old docker-compose program).
  • Your shell must be able to access the running Docker daemon. Follow Docker's platform permissions instructions; do not make the Docker socket world-writable.
  • Budget 8 GB RAM and 20 GB free disk for a comfortable initial build; allow more for records/backups. These are planning estimates, not measured minimums. With Docker Desktop, allocate sufficient memory/disk to its VM. No host Python, Node, npm or MySQL installation is required.
  • Networks requiring an outbound proxy need separate Docker daemon, build and application settings; shell proxy variables alone are insufficient. See proxy configuration.

Install from the official instructions: Git, Docker Engine, Docker Desktop, Windows/WSL2, Compose plugin. Check these before continuing; docker info must reach the daemon:

git --version
docker version
docker compose version
docker info

Choose a source version: obtain a published, maintainer-approved deployment tag or full commit SHA and check its pipeline result. A pushed feature branch is not automatically an approved release or part of main. Replace replace-with-published-ref below with the approved reference; do not assume the default branch contains a particular deployment change.

DEPLOYMENT_REF='replace-with-published-ref'
git clone --no-checkout https://codebase.helmholtz.cloud/napmix/napmix-metadata.git napmix-metadata
cd napmix-metadata
git checkout --detach "$DEPLOYMENT_REF"
test -f deploy/local.sh

A detached checkout is deliberate: it pins an installation to an approved version. Stay in this repository directory for the remaining commands.

A. New local installation — try NAPMIX

Use a new checkout with no existing .env, secrets or installation. This starts MySQL, Django, React/Caddy and the notification worker in separate persistent Docker volumes. Only loopback port 18080 is published; leave it free.

Run this block. It refuses to overwrite .env, generates new private keys only for this new installation, builds the images and waits for startup. The final command asks for your own administrator username/email/password:

(
  set -eu
  (set -C; cat .env.example > .env)
  sh deploy/create-secrets.sh
  sh deploy/local.sh up --build -d --wait
  sh deploy/local.sh exec backend python manage.py createsuperuser
)

The first build may take several minutes. There is no default administrator or password. Open NAPMIX and sign in with the account you just created; Django admin is available separately. Django admin uses a separate login session and requires an active staff account; the initial superuser can use both interfaces.

localhost means the computer running your browser. If Docker runs on a remote server, this local setup remains bound to that server's loopback interface. From a terminal on your own computer, replace USER@SERVER with your SSH destination and keep this tunnel open while using the local URLs above:

ssh -N -L 18080:127.0.0.1:18080 USER@SERVER

For access by other computers without an SSH tunnel, use a reviewed HTTPS deployment; see private-network HTTPS.

Confirm startup:

sh deploy/local.sh ps -a
sh deploy/local.sh logs --tail=50 release backend proxy notifications
sh deploy/local.sh exec backend python manage.py deployment_check --http

Expected: DB and backend healthy; proxy and notifications running; the one-shot release service Exited (0). The readiness command succeeds and API health returns {"status":"ready"}. A running container alone is not proof that the site works: open the URL too.

Fresh installation automatically migrates and loads 3,312 reference rows, including 3,181 isotopes across 22 tables. Do not import SQL manually. Its bootstrap identity cannot log in and has no administrative privileges. An optional post-initialization check creates zero rows and preserves customizations:

sh deploy/local.sh exec backend python manage.py seed_references

Stop and resume the same installation, without deleting data:

sh deploy/local.sh stop
sh deploy/local.sh up -d --wait

Always use sh deploy/local.sh for this local installation, including logs, backups and upgrades. It fixes the project to napmix-local, loads the base + HTTP files, forces localhost and works when invoked by absolute path from another directory. It ignores ambient production COMPOSE_PROJECT_NAME/COMPOSE_FILE selection. It never creates secrets, resets data or removes volumes automatically. For an already differently named local installation, see project selection before use.

B. New production installation — prepared server

Use a separate new checkout on your server. The illustrative hostname napmix.example.org must be replaced with a hostname you control. In .env set NAPMIX_DOMAIN to that hostname without https://, a port or a path. Create its DNS A record pointing to the server's public IPv4 address; add AAAA only if IPv6 actually reaches it. Allow inbound TCP 80 and 443 through the host/cloud firewalls and any NAT. No other service may occupy those ports. Caddy obtains and renews public HTTPS certificates automatically when DNS/reachability are correct.

First create new configuration/secrets (new installs only):

(
  set -eu
  (set -C; cat .env.example > .env)
  sh deploy/create-secrets.sh
)

Edit .env as described above, then run:

docker compose --env-file .env -p napmix-prod -f docker-compose.yml up --build -d --wait
docker compose --env-file .env -p napmix-prod -f docker-compose.yml exec backend python manage.py createsuperuser
docker compose --env-file .env -p napmix-prod -f docker-compose.yml ps -a

napmix-prod is the explicit identity for this new example. Record it with your installation configuration and keep it for every future command. Existing installations must retain their own established project name instead. Visit https://YOUR_HOSTNAME/, /admin/ and /api/health/ from a browser. Confirm a trusted certificate, readiness and login. Healthy containers do not prove public DNS/TLS reachability; these checks need the actual target server. Production never uses the local HTTP override. ORCID/SMTP can then be configured in Administration; register the exact HTTPS ORCID callback /api/account/orcid/callback/ at your origin. Never put those credentials in frontend variables or build arguments.

For an internal network without public certificate issuance, use a reviewed HTTPS configuration with a certificate trusted by the intended clients. The local HTTP helper does not configure LAN access or certificate trust; see private-network HTTPS.

C. Existing managed installation — upgrade

Keep its original project, files, .env, keys and volume associations. Do not run new-install configuration/key generation. First identify the installation and inspect the migration plan, then stop writers and verify a coherent backup. Only after your maintenance decision run the explicit --upgrade --backup-confirmed release. Follow the managed upgrade procedure, which provides the same commands for local HTTP and production HTTPS.

D. Older installation — adoption

This is an administrator procedure, not a universal one-command migration. Establish which database/files/keys belong together and configure its database connection in a reviewed override. Restore original credentials and application files first. The explicit --adopt --backup-confirmed workflow applies committed migrations but does not import reference data into existing databases. Follow legacy adoption, including the safe legacy encryption-key derivation instructions where necessary.

First rehearse against a restored copy in a separate Compose project with independent DB/state volumes, secrets/configuration files, image tags and ports. Compare the actual schema and recorded migration history: historical installations may need a separately reviewed schema alignment before adoption; --adopt does not repair arbitrary schema differences. Verify scientific records, relationships, accounts and exports before planning a cutover. A restored copy is independent and does not receive later writes to the old database; cutover requires stopping its writers and transferring the final state.

Accounts and metadata access

  • ORCID linking: enter an ORCID in Profile and verify it with Connect ORCID. An existing matching Researcher is offered for explicit linking consent. Both entry orders are supported: Profile first or Researcher first. A manually entered identifier alone never links an account. An administrator must configure ORCID before provider verification is available; ambiguous or claimed identities require review. See ORCID configuration and workflow.
  • Project metadata: sharing is off by default. The project creator or a staff administrator can enable read/export access for all signed-in users from the Governance Metadata tab. This grants no editing or snapshot-creation permissions. Snapshot preview remains creator/staff-only, with a fixed source/schema and a JSON/XML switch. See metadata access.

Operations, recovery and validation

See DEPLOYMENT.md for project identification, backup/restore, upgrade commands and troubleshooting. Never delete volumes, fake migrations or generate fresh keys to fix an existing installation. Normal restarts do not reseed, reset credentials or silently apply pending upgrades.

The validation record distinguishes real isolated container checks from external acceptance. GitLab checks frontend tests/lint/CI build, Django/MySQL, migration drift and proxy/browser startup. ci-smoke.sh is synthetic test tooling for a disposable checkout, not an installation health check. It never publishes images or deploys publicly.

Contributing and license

Submit reviewed changes through your team's GitLab process; do not push directly to main. Issues: https://codebase.helmholtz.cloud/napmix/napmix-metadata/-/issues

This project is licensed under GNU General Public License v3.0; see LICENSE. Bundled third-party components retain their own notices, including the Material Dashboard frontend and the MIT Stylis source used for source-map repair.

Participating organisations

Helmholtz Centre for Heavy Ion Research (GSI)
Fac
Deutsches Elektronen-Synchrotron DESY
Cen
Cen
Gra
HUN
Karlsruhe Institute of Technology (KIT)
Technical University of Darmstadt
Helmholtz-Zentrum Dresden-Rossendorf

Reference papers

Contributors

IK
Ivan Knežević
GSI Helmholtz Centre for Heavy Ion Research
0000-0001-7578-0169
DH
JG
Joaquin Gomez-Camacho
GG
Gaston Garcia
QF
Quentin Fable
Grand Accélérateur National d'Ions Lourds
0000-0001-6498-0552
CMC
Carla Tatiana Muñoz Chimbo
KP
Konstantina Palli
VR
Valera Ferrando Raul
Centro Nacional de Aceleradores
FFF
Francisco Javier Ferrer Fernández
AB
Axel Boeltzig
Helmholtz-Zentrum Dresden-Rossendorf
0000-0002-7209-2499
VT
Victoria Tokareva

Helmholtz Program-oriented Funding IV