The VIAQ Backend Platform is the core infrastructure powering VIAQ's smart environmental monitoring solutions. It leverages IoT technology and data analytics to provide real-time insights into environmental parameters such as air quality, gaseous pollutants, dust, temperature, and humidity.
This repository contains the primary backend services (node-mongo), infrastructure configuration (docker-compose.yml), and management utilities required to run the VIAQ platform.
Key Features:
node-mongo/ – Main backend API service (Node.js + Express.js).
Handles client requests, device interactions, business logic, and MongoDB communication.
➡️ View NodeMongo README
docker-compose.yml – Defines the multi‑container Docker application that forms the platform backbone.
Services managed: questdb (time‑series database), mongodb (primary database), grafana (visualisation), telegraf (metrics collection), plus rabbitmq and emqx.
telegraf/ – Contains the unified telegraf.conf used for collecting metrics from all platform components and IoT devices.
scripts/ – Organised collection of Bash scripts for server administration, backups, and service orchestration.
Scripts are grouped into subdirectories (e.g., qdb/, git/, mailserver/, nginx/, npm/, rabbitmq/, startup/).
This project uses a fully automated CI/CD pipeline built on GitHub Actions, powered by reusable workflows.
Centralized templates in the ci-cd-templates repository ensure consistency across all projects.
Workflow:
main or develop.Clone the repository:
git clone https://github.com/Viaq-Platform/Viaq-Backend.git
cd Viaq-Backend
Start dependent Docker services:
docker-compose up -d
This starts MongoDB, QuestDB, Grafana, and other infrastructure containers.
Set up the node-mongo service:
cd node-mongo
npm install
cp environments/.env.example environments/.env
# Edit environments/.env with your local settings
Run the API server:
npm start
Access services:
node-mongo API – http://localhost:3500 (or as configured)http://localhost:9000http://localhost:3000All administrative scripts are located in the scripts/ directory, organised into subfolders. To make them globally accessible, run the alias installer:
sudo bash /var/www/viaq/backend/Viaq-Backend/scripts/install_scripts.sh
This command:
.sh file inside scripts/ and its subdirectories.back, backup, temp, or old (case‑insensitive)./usr/local/bin so that every script becomes a global command (the script’s name without the .sh suffix).After running the installer, you can invoke the following commands from anywhere:
| Category | Command | Description |
|---|---|---|
| Platform start | startup |
Starts the entire VIAQ platform (Docker + PM2) – runs startup/startup.sh |
| Healthchecker | healthcheck or hlthch |
Runs the healthcheck start script (/var/www/healthchecker/start.sh) |
healthcheck_log or hlthch_log |
Shows merged, sorted logs from the healthchecker | |
| QuestDB | qdb_backup |
Backs up a date range of QuestDB data |
qdb_import |
Imports a compressed QuestDB backup | |
qdb_copy_with_progress |
Copies QuestDB data with progress indicator | |
qdb_functions |
Helper functions for QuestDB operations (not meant to be called directly) | |
| Git | pull_all |
Pulls the latest code for all repositories |
| Mailserver | scripts inside mailserver/ |
Various mailserver utilities |
| Nginx | scripts inside nginx/ |
Nginx configuration helpers |
| npm | scripts inside npm/ |
NPM package management helpers |
| RabbitMQ | scripts inside rabbitmq/ |
RabbitMQ administration scripts |
Note: The installer automatically gives each script a command name equal to the base filename (e.g.,
qdb_backup.shbecomesqdb_backup).
Short aliases (hlthch,hlthch_log) are created only for the healthchecker.
If you prefer to run scripts directly without installing aliases, use the full path:
sudo bash /var/www/viaq/backend/Viaq-Backend/scripts/startup/startup.sh
sudo bash /var/www/healthchecker/start.sh
This project is proprietary and confidential. All rights reserved.