Skip to content

Deploying a Quant-UX App

Introduction

Quant-UX is an open-source UX testing and prototyping platform that collects user interaction analytics. Deploying Quant-UX with a Dockerfile on Klutch.sh gives you reproducible builds, managed secrets, and persistent storage—all configured from klutch.sh/app. This guide covers installation, Dockerfile setup, environment variables, storage, Nixpacks overrides, and sample requests to verify your instance.


Prerequisites

  • A Klutch.sh account (sign up)
  • A GitHub repository containing your Quant-UX Dockerfile (GitHub is the only supported git source)
  • External MongoDB (Quant-UX stores projects and analytics in MongoDB)
  • Domain and TLS for secure access

For onboarding, see the Quick Start.


Architecture and ports

  • Quant-UX serves HTTP on internal port 8000. Choose HTTP traffic in Klutch.sh and set the internal port to 8000.
  • Persistent storage is recommended for uploads and cache; primary data is in MongoDB.

Repository layout

quant-ux/
├── Dockerfile # Must be at repo root for auto-detection
└── README.md

Keep secrets out of Git; store them in Klutch.sh environment variables.


Installation (local) and starter commands

Build and run locally (ensure MongoDB is reachable):

Terminal window
docker build -t quantux-local .
docker run -p 8000:8000 \
-e MONGO_URL=mongodb://user:pass@localhost:27017/quantux \
-e MONGO_DB=quantux \
quantux-local

Dockerfile for Quant-UX (production-ready)

Place this at the repo root; Klutch.sh auto-detects Dockerfiles.

FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
ENV PORT=8000
EXPOSE 8000
CMD ["npm", "run", "start"]

Notes:

  • Pin Node to the version Quant-UX supports; adjust if upstream changes.
  • Keep the Dockerfile at the repo root; Docker selection is automatic in Klutch.sh.

Environment variables (Klutch.sh)

Set these before deploying:

  • PORT=8000
  • MONGO_URL=mongodb://<user>:<password>@<host>:27017/<db>
  • MONGO_DB=quantux
  • Optional: APP_BASE_URL=https://example-app.klutch.sh, SMTP settings if you enable email

If deploying without the Dockerfile and relying on Nixpacks:

  • NIXPACKS_NODE_VERSION=18
  • NIXPACKS_START_CMD=npm run start

Attach persistent volumes

If you store local assets, add storage in Klutch.sh (path and size only):

  • /app/uploads — user/project uploads.

Ensure the path matches your Quant-UX configuration.


Deploy Quant-UX on Klutch.sh (Dockerfile workflow)

  1. Push your repository—with the Dockerfile at the root—to GitHub.
  2. Open klutch.sh/app, create a project, and add an app.
  3. Select HTTP traffic and set the internal port to 8000.
  4. Add the environment variables above (MongoDB URL and database, plus optional base URL/SMTP).
  5. Attach a volume at /app/uploads if you need local asset persistence, sized for your media.
  6. Deploy. Access your app at https://example-app.klutch.sh; add a custom domain if desired.

Sample checks

Landing page:

Terminal window
curl -I https://example-app.klutch.sh

If Quant-UX exposes a health or API endpoint (replace if different):

Terminal window
curl -I https://example-app.klutch.sh/api/health

Health checks and production tips

  • Add an HTTP readiness probe to / or your health endpoint.
  • Keep MongoDB credentials in Klutch.sh secrets; rotate them regularly.
  • Use external MongoDB for durability; back it up on a schedule.
  • Pin Docker base versions and test upgrades in staging before production.
  • Monitor storage usage on /app/uploads if enabled; resize volumes proactively.

Quant-UX on Klutch.sh delivers reproducible Docker builds, managed secrets, and optional storage—without extra YAML or CI steps. Configure ports, env vars, and storage, then launch your UX testing platform.