### Manual Node.js Application Setup (Bash) Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/deployment/DEPLOYMENT_GUIDE.md Steps to set up the MeshMonitor application manually using Node.js. Involves cloning the repository, installing dependencies, building the application, and creating a data directory with appropriate permissions. ```bash # Clone or extract application git clone meshmonitor cd meshmonitor # Install dependencies npm install # Build application npm run build npm run build:server # Create data directory sudo mkdir -p /var/lib/meshmonitor/data sudo chown -R $(whoami):$(whoami) /var/lib/meshmonitor ``` -------------------------------- ### Start Frontend Development Server (npm) Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/development/claude-getting-started.md Starts only the frontend development server (Vite) in a dedicated terminal. This is part of an alternative setup where backend and frontend servers are run separately. ```bash npm run dev ``` -------------------------------- ### Local Development Setup - Bash Source: https://context7.com/skrashevich/meshmonitor/llms.txt This set of bash commands outlines the process for setting up a local development environment for MeshMonitor. It includes cloning the repository, installing dependencies, configuring environment variables, and starting development servers. ```bash # Clone repository with submodules git clone --recurse-submodules https://github.com/Yeraze/meshmonitor.git cd meshmonitor # Install dependencies npm install # Configure environment cp .env.example .env # Edit .env: set MESHTASTIC_NODE_IP to your device IP # Start development servers (React + Express) npm run dev:full # Access development server at http://localhost:5173 # API server runs on http://localhost:3001 # Run tests npm run test # Watch mode npm run test:run # Single run npm run test:coverage # With coverage report # Build for production npm run build # Frontend npm run build:server # Backend # Lint and type check npm run lint npm run typecheck # Build documentation site npm run docs:dev # Dev server npm run docs:build # Production build ``` -------------------------------- ### Install meshtasticd using Docker Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/configuration/meshtasticd.md Pulls the latest meshtasticd Docker image. This is the recommended and easiest way to get started with meshtasticd. ```bash docker pull meshtastic/meshtasticd:latest ``` -------------------------------- ### Local Development Setup for MeshMonitor Source: https://github.com/skrashevich/meshmonitor/blob/main/README.md This snippet outlines the steps to set up a local development environment for MeshMonitor. It includes cloning the repository with submodules, installing Node.js dependencies, and configuring the environment variables by copying and editing the example .env file. Prerequisites include Node.js 20+ or 22+, Docker (recommended), and a Meshtastic device. ```bash # Clone with submodules git clone --recurse-submodules https://github.com/Yeraze/meshmonitor.git cd meshmonitor # Install dependencies npm install # Configure environment cp .env.example .env # Edit .env with your Meshtastic node's IP address ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/development/setup.md Installs all frontend and backend dependencies for the MeshMonitor project. This command reads the dependencies listed in the `package.json` file. ```bash npm install ``` -------------------------------- ### Start and Enable Caddy Service (Native) Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/configuration/duckdns-https.md Commands to start the Caddy service and configure it to start automatically on boot. This is for native installations on systems using systemd. ```bash # Place Caddyfile in /etc/caddy/Caddyfile sudo systemctl start caddy sudo systemctl enable caddy # Start on boot ``` -------------------------------- ### Start MeshMonitor Development Server Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/development/setup.md Starts the MeshMonitor development server. Option 1 runs both frontend and backend concurrently. Option 2 requires running the frontend and backend in separate terminals. ```bash npm run dev:full ``` ```bash # Terminal 1: Frontend (Vite dev server) npm run dev # Terminal 2: Backend (Express API) npm run dev:server ``` -------------------------------- ### Example MeshMonitor Environment Configuration Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/deployment/PROXMOX_LXC_GUIDE.md An example of the `/etc/meshmonitor/meshmonitor.env` file showing required and optional configuration variables for MeshMonitor, including database paths, security settings, and notification parameters. ```bash # Required MESHTASTIC_NODE_IP=192.168.1.100 # Optional - Server PORT=3001 NODE_ENV=production BASE_URL=/ # Optional - Database DATABASE_PATH=/data/meshmonitor.db # Optional - Security SESSION_SECRET=your-random-secret-here COOKIE_SECURE=false COOKIE_SAMESITE=lax # Optional - CORS ALLOWED_ORIGINS=http://localhost:8080 # Optional - Virtual Node (for mobile apps) ENABLE_VIRTUAL_NODE=false VIRTUAL_NODE_PORT=4404 # Optional - Notifications VAPID_PUBLIC_KEY= VAPID_PRIVATE_KEY= VAPID_SUBJECT=mailto:your@email.com # Optional - SSO/OIDC OIDC_ISSUER= OIDC_CLIENT_ID= OIDC_CLIENT_SECRET= # Optional - Logging ACCESS_LOG_ENABLED=false ACCESS_LOG_PATH=/data/logs/access.log ACCESS_LOG_FORMAT=combined ``` -------------------------------- ### Install Node.js and npm Prerequisites (Bash) Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/deployment/DEPLOYMENT_GUIDE.md Package installation commands for Node.js, npm, and build tools on Debian/Ubuntu and CentOS/RHEL systems, as well as Homebrew for macOS. These are required for manual Node.js deployment of MeshMonitor. ```bash # Ubuntu/Debian sudo apt update sudo apt install -y nodejs npm build-essential python3 # CentOS/RHEL sudo dnf install -y nodejs npm gcc-c++ make python3 # macOS brew install node ``` -------------------------------- ### Start Full Development Servers (npm) Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/development/claude-getting-started.md Starts both the frontend (Vite) and backend (Express) development servers simultaneously using a single npm script. This enables hot reloading for both parts of the application during development. ```bash npm run dev:full ``` -------------------------------- ### Start Backend Development Server (npm) Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/development/claude-getting-started.md Starts only the backend development server (Express) in a dedicated terminal. This is used when running frontend and backend servers independently. ```bash npm run dev:server ``` -------------------------------- ### Check and Manage Node.js Version with nvm Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/development/claude-getting-started.md This demonstrates how to check the current Node.js version and use `nvm` (Node Version Manager) to install and switch to a required version (v22 in this example). This is important for avoiding errors related to unsupported Node.js features. ```bash # Check version node --version # Should be v20.x.x or higher # Use nvm to switch nvm install 22 nvm use 22 ``` -------------------------------- ### Start and Verify MeshMonitor Services Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/deployment/PROXMOX_LXC_GUIDE.md Commands to start the MeshMonitor and meshmonitor-apprise services, and then check their status to ensure they are running correctly. ```bash systemctl start meshmonitor systemctl start meshmonitor-apprise systemctl status meshmonitor systemctl status meshmonitor-apprise ``` -------------------------------- ### Node.js Basic Example Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/developers/auto-responder-scripting.md A fundamental Node.js script that demonstrates basic execution. It constructs a JSON response including the Node.js version. This script serves as a starting point for more complex Node.js applications within the MeshMonitor environment. ```javascript #!/usr/bin/env node const response = { response: `Hello from Node.js v${process.version}!` }; console.log(JSON.stringify(response)); ``` -------------------------------- ### Deploy MeshMonitor to Production (Bash) Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/deployment/DEPLOYMENT_GUIDE.md Commands to prepare the production environment and deploy MeshMonitor using Docker Compose. Includes creating necessary directories, setting ownership, and enabling Docker to start on boot. ```bash # Create directories sudo mkdir -p /var/lib/meshmonitor/{data,logs} sudo chown -R 1000:1000 /var/lib/meshmonitor # Deploy cd /var/lib/meshmonitor docker-compose -f docker-compose.prod.yml up -d # Enable auto-restart on boot sudo systemctl enable docker ``` -------------------------------- ### Create Environment Variables File Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/development/claude-getting-started.md Copies the example environment variable configuration file (`.env.example`) to a new file named `.env`. This new file will be used to store sensitive or environment-specific settings for the MeshMonitor application. ```bash cp .env.example .env ``` -------------------------------- ### Build MeshMonitor for Production Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/development/setup.md Commands to build the MeshMonitor project for production deployment. `npm run build` builds the frontend, `npm run build:server` builds the backend, and `npm start` runs the production build. ```bash # Build frontend npm run build ``` ```bash # Build backend npm run build:server ``` ```bash # Run production build npm start ``` -------------------------------- ### Deploy MeshMonitor with Docker Compose Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/index.md This snippet demonstrates how to set up and run MeshMonitor using Docker Compose. It defines the service, image, container name, port mapping, volume for data persistence, and environment variables. After creating the docker-compose.yml file, it starts the container in detached mode. ```bash cat > docker-compose.yml << 'EOF' \ services: \ meshmonitor: \ image: ghcr.io/yeraze/meshmonitor:latest \ container_name: meshmonitor \ ports: \ - "8080:3001" \ volumes: \ - meshmonitor-data:/data \ environment: \ - MESHTASTIC_NODE_IP=192.168.1.100 # Change to your node's IP \ restart: unless-stopped \ \ volumes: \ meshmonitor-data: \ EOF \ \ docker compose up -d ``` -------------------------------- ### Configure CORS Allowed Origins (YAML) Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/getting-started.md Sets the Cross-Origin Resource Sharing (CORS) policy for MeshMonitor. You must configure ALLOWED_ORIGINS to match the URLs from which you access the application to prevent unauthorized access. This example shows configurations for localhost, server IP, and multiple access methods. ```yaml - ALLOWED_ORIGINS=http://localhost:8080 ``` ```yaml environment: - MESHTASTIC_NODE_IP=192.168.1.100 - ALLOWED_ORIGINS=http://192.168.1.50:8080 # Replace with your server's IP ``` ```yaml - ALLOWED_ORIGINS=http://localhost:8080,http://192.168.1.50:8080 ``` ```yaml # Multiple origins with hostname - ALLOWED_ORIGINS=http://192.168.1.50:8080,http://meshmonitor.local:8080 # Allow all origins (not recommended, use for testing only) - ALLOWED_ORIGINS=* ``` -------------------------------- ### Database Connection String Examples (Bash) Source: https://github.com/skrashevich/meshmonitor/blob/main/ARCHITECTURE.md Illustrates how to configure database connections for the MeshMonitor service. It shows the environment variables required for SQLite (default), PostgreSQL, and MySQL/MariaDB backends. ```bash # SQLite (default - no configuration needed) DATABASE_PATH=/data/meshmonitor.db # PostgreSQL DATABASE_URL=postgres://user:password@host:5432/meshmonitor # MySQL/MariaDB DATABASE_URL=mysql://user:password@host:3306/meshmonitor ``` -------------------------------- ### Example Custom Tile Server Configuration Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/features/settings.md Provides an example configuration for a custom tile server, including its name, URL, attribution, maximum zoom level, and a description. This example demonstrates how to integrate local OpenStreetMap tiles. ```Configuration Name: Local OSM URL: http://localhost:8080/styles/osm-bright/{z}/{x}/{y}.png Attribution: © OpenStreetMap contributors Max Zoom: 18 Description: Offline OpenStreetMap tiles via TileServer GL ``` -------------------------------- ### Reset MeshMonitor Database (Bash) Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/getting-started.md A command sequence to resolve database errors by removing the existing data volume and restarting MeshMonitor. This effectively resets the database to its initial state. ```bash docker compose down docker volume rm meshmonitor-meshmonitor-data docker compose up -d ``` -------------------------------- ### Build Process Commands (Bash) Source: https://github.com/skrashevich/meshmonitor/blob/main/ARCHITECTURE.md Provides commands for building and running the MeshMonitor application in development and production environments. Includes commands for starting both frontend and backend in development, building frontend assets, compiling the backend, and starting the production server. ```bash # Development npm run dev:full # Start both frontend and backend in dev mode # Production npm run build # Build frontend assets npm run build:server # Compile TypeScript backend npm start # Start production server ``` -------------------------------- ### Multi-Message Lorem Ipsum Example (JavaScript, Python, Shell) Source: https://github.com/skrashevich/meshmonitor/blob/main/examples/auto-responder-scripts/README.md Demonstrates how to return multiple sequential responses with a delay and retry logic. This example uses Lorem Ipsum text and is available in JavaScript, Python, and Shell. ```javascript console.log("Lorem ipsum dolor sit amet, consectetur adipiscing elit."); setTimeout(() => { console.log("Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."); setTimeout(() => { console.log("Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."); }, 30000); }, 30000); ``` ```python import time print("Lorem ipsum dolor sit amet, consectetur adipiscing elit.") time.sleep(30) print("Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.") time.sleep(30) print("Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.") ``` ```shell #!/bin/bash echo "Lorem ipsum dolor sit amet, consectetur adipiscing elit." sleep 30 echo "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." sleep 30 echo "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat." ``` -------------------------------- ### Setting Meshtastic Node IP via Environment Variable Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/getting-started.md This bash command demonstrates how to set the `MESHTASTIC_NODE_IP` environment variable before starting MeshMonitor with Docker Compose. This is useful for dynamically configuring the Meshtastic device's IP address without modifying the `docker-compose.yml` file directly. ```bash export MESHTASTIC_NODE_IP=192.168.5.25 docker compose up -d ``` -------------------------------- ### Claude Quick Start Prompt for MeshMonitor Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/development/claude-getting-started.md A prompt to initialize Claude Code for understanding the MeshMonitor project, covering setup, architecture, and contribution rules. It assumes the repository is cloned and ready for configuration. ```plaintext I'm a new contributor to MeshMonitor. Please help me get started by: 1. Reading the project instructions in /CLAUDE.md 2. Reviewing docs/development/claude-getting-started.md for the full setup guide 3. Reading docs/ARCHITECTURE_LESSONS.md to understand critical patterns Then give me a summary of: - What MeshMonitor is and its tech stack - How to set up my development environment (I'll tell you if I'm using DevContainer or manual setup) - The key rules I need to follow when contributing - Common pitfalls to avoid I have the repo cloned and ready to configure. ``` -------------------------------- ### Troubleshoot Node Connectivity (Bash) Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/getting-started.md Provides commands to quickly diagnose and fix issues when MeshMonitor cannot connect to a Meshtastic node. It includes verifying network reachability with `ping` and checking port accessibility with `telnet`. ```bash # Verify node is reachable ping 192.168.1.100 # Check port 4403 is accessible telnet 192.168.1.100 4403 ``` -------------------------------- ### Add User to Docker Group (Bash) Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/getting-started.md Command to add the current user to the Docker group, which is necessary to resolve Docker permission errors. After running this command, you must log out and log back in for the changes to take effect. ```bash sudo usermod -aG docker $USER # Log out and back in ``` -------------------------------- ### Copy Scripts Locally to MeshMonitor Container Source: https://github.com/skrashevich/meshmonitor/blob/main/examples/auto-responder-scripts/README.md Demonstrates how to copy example scripts from a local directory to the MeshMonitor container's script directory using `docker cp`. This method is an alternative to volume mounts. ```bash docker cp hello.js meshmonitor:/data/scripts/ docker cp weather.py meshmonitor:/data/scripts/ docker cp PirateWeather.py meshmonitor:/data/scripts/ docker cp info.sh meshmonitor:/data/scripts/ ``` -------------------------------- ### Systemd Service Setup for MeshMonitor Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/deployment/DEPLOYMENT_GUIDE.md Configures MeshMonitor to run as a systemd service. This involves creating a service unit file, setting up a dedicated user, and managing the service lifecycle. It ensures the service starts on boot and restarts automatically if it crashes. ```ini [Unit] Description=MeshMonitor Service After=network.target [Service] Type=simple User=meshmonitor WorkingDirectory=/var/lib/meshmonitor/meshmonitor Environment=NODE_ENV=production Environment=PORT=3001 EnvironmentFile=/var/lib/meshmonitor/.env ExecStart=/usr/bin/node dist/server/server.js Restart=always RestartSec=10 StandardOutput=syslog StandardError=syslog SyslogIdentifier=meshmonitor [Install] WantedBy=multi-user.target ``` ```bash # Create service user sudo useradd -r -s /bin/false meshmonitor sudo chown -R meshmonitor:meshmonitor /var/lib/meshmonitor # Enable and start service sudo systemctl daemon-reload sudo systemctl enable meshmonitor sudo systemctl start meshmonitor # Check status sudo systemctl status meshmonitor ``` -------------------------------- ### Configuring Custom Timezone in Docker Compose Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/getting-started.md This snippet shows how to add a custom timezone to the MeshMonitor Docker container's environment variables within the `docker-compose.yml` file. This ensures that logs and timestamps within the application reflect the desired local time. ```yaml environment: - MESHTASTIC_NODE_IP=192.168.1.100 - TZ=Europe/London # See: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones ``` -------------------------------- ### MeshMonitor Development Workflow Summary Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/development/claude-getting-started.md Outlines the standard workflow for contributing to the MeshMonitor project. It covers cloning the repository with submodules, installing dependencies, configuring environment variables, starting development, branching, making changes, running tests, and creating pull requests. Adhering to this workflow ensures consistency and maintainability. ```markdown 1. **Clone with submodules**: `git clone --recurse-submodules ...` 2. **Install dependencies**: `npm install` 3. **Configure environment**: `cp .env.example .env` and set `MESHTASTIC_NODE_IP` 4. **Start development**: `npm run dev:full` or use Docker 5. **Create a branch**: `git checkout -b feature/my-feature` 6. **Make changes**: Follow ARCHITECTURE_LESSONS.md patterns 7. **Run unit tests**: `npm run test:run` 8. **Create PR**: Never push directly to main 9. **Request system tests**: For core/node changes, ask @Yeraze to run system tests ``` -------------------------------- ### Initial Database Setup and Admin User Creation Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/v2.0.0-authentication-plan.md This script outlines the process for the first-run setup of the MeshMonitor application. It includes generating a secure password, creating an admin user with all permissions, logging the password, and marking the setup as complete. ```typescript // On first run (no users exist): 1. Generate random password (20 chars, alphanumeric + symbols) 2. Create admin user: - Username: 'admin' (or from ADMIN_USERNAME env) - Password: generated password - is_admin: true 3. Grant all permissions to admin 4. Log password to console and audit log 5. Set 'setup_complete' flag in settings ``` -------------------------------- ### Manual Configuration Example (JSON) Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/planning/electron-desktop-app-plan.md An example of the `config.json` file used for manual configuration of MeshMonitor. It includes settings for Meshtastic node connection, server port, and application behavior like auto-start and update checks. ```json { "meshtastic": { "nodeIp": "192.168.5.106", "tcpPort": 4403 }, "server": { "port": 3001 }, "app": { "autoStart": false, "minimizeToTray": true, "checkForUpdates": true } } ``` -------------------------------- ### Docker Compose Configuration for MeshMonitor Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/getting-started.md This YAML configuration defines a Docker Compose service for MeshMonitor. It specifies the image to use, container name, port mapping, restart policy, volume for data persistence, and environment variables for Meshtastic node IP and allowed origins. It's designed for easy local deployment. ```yaml services: meshmonitor: image: ghcr.io/yeraze/meshmonitor:latest container_name: meshmonitor ports: - "8080:3001" restart: unless-stopped volumes: - meshmonitor-data:/data environment: - MESHTASTIC_NODE_IP=192.168.1.100 # Change to your node's IP - ALLOWED_ORIGINS=http://localhost:8080 # Required for CORS volumes: meshmonitor-data: driver: local ``` -------------------------------- ### Start Development Server Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/development/index.md Command to start the MeshMonitor development server, enabling live reloading and hot module replacement for rapid development. ```bash # Start development server npm run dev:full ``` -------------------------------- ### Get System Statistics - Curl Example Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/api/REST_API.md Example using curl to retrieve statistical information about the system, including message counts and messages by day. ```bash curl -X GET http://localhost:8080/api/stats ``` -------------------------------- ### Build and Run MeshMonitor Desktop (Bash) Source: https://github.com/skrashevich/meshmonitor/blob/main/desktop/README.md Commands to build the main project, install desktop dependencies, and run the application in development mode or build it for release. Assumes Node.js and npm are installed. ```bash # From project root npm ci npm run build cd desktop npm install # Run in development mode npm run tauri:dev # Build release npm run tauri:build ``` -------------------------------- ### Script Response Example Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/features/automation.md Provides an example of a script response, indicating the path to an executable script that will handle the trigger. Scripts can be written in Node.js, Python, or Shell. ```text /data/scripts/weather.py ``` -------------------------------- ### Install and Test Meshtastic CLI Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/development/claude-getting-started.md Installs the Meshtastic Python package and tests connectivity to a node using the command-line interface. This helps isolate whether the issue is with the MeshMonitor application or the Meshtastic node itself. Requires Python and pip to be installed. ```bash pip install meshtastic meshtastic --host 192.168.1.100 ``` -------------------------------- ### Weather Script Example (Python) Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/features/automation.md A Python script example for MeshMonitor Timer Triggers that fetches weather information from wttr.in. It handles potential exceptions and outputs the weather data or an error message in JSON format. ```python #!/usr/bin/env python3 import json import urllib.request try: url = "https://wttr.in/YourCity?format=3" with urllib.request.urlopen(url, timeout=5) as response: weather = response.read().decode('utf-8').strip() output = {"response": weather} except Exception as e: output = {"response": "Weather unavailable"} print(json.dumps(output)) ``` -------------------------------- ### Install Docker and Docker Compose Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/operations/disaster-recovery.md Installs Docker and adds the current user to the docker group for easier command execution. This is a prerequisite for running MeshMonitor in Docker. ```bash # Install Docker and Docker Compose if needed curl -fsSL https://get.docker.com | sh sudo usermod -aG docker $USER ``` -------------------------------- ### Start Caddy with Docker Compose Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/configuration/duckdns-https.md Command to start the Caddy service using Docker Compose. This command assumes you have a `docker-compose.caddy.yml` file in the current directory. ```bash docker compose -f docker-compose.caddy.yml up -d ``` -------------------------------- ### Get System Statistics - Response Example Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/api/REST_API.md Example JSON response containing system statistics such as total message count, node count, and a breakdown of messages by day. ```json { "messageCount": 1250, "nodeCount": 15, "messagesByDay": [ { "date": "2024-01-01", "count": 45 }, { "date": "2024-01-02", "count": 67 } ] } ``` -------------------------------- ### Start PostgreSQL Service Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/database-migration.md This command starts the PostgreSQL service defined in your `docker-compose.yml` file. It ensures the database is running and accessible before proceeding with the MeshMonitor configuration. ```bash docker compose up -d postgres ``` -------------------------------- ### Quick Start Docker Compose Deployment for MeshMonitor Source: https://github.com/skrashevich/meshmonitor/blob/main/README.md This snippet demonstrates how to quickly deploy MeshMonitor using Docker Compose. It defines a service for MeshMonitor, maps ports, sets up persistent storage, and configures the Meshtastic node IP. It requires Docker and Docker Compose to be installed. ```bash # 1. Create docker-compose.yml cat > docker-compose.yml << 'EOF' services: meshmonitor: image: ghcr.io/yeraze/meshmonitor:latest ports: - "8080:3001" volumes: - meshmonitor-data:/data environment: - MESHTASTIC_NODE_IP=192.168.1.100 # Change to your node's IP restart: unless-stopped volumes: meshmonitor-data: EOF # 2. Start MeshMonitor docker compose up -d # 3. Open http://localhost:8080 ``` -------------------------------- ### Create and Start MeshMonitor Container Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/deployment/PROXMOX_LXC_GUIDE.md Commands to create a new Proxmox container for MeshMonitor using a tarball and then start the container. Replace VERSION with the specific version number. ```bash pct create 100 local:vztmpl/meshmonitor-VERSION-amd64.tar.gz \ --hostname meshmonitor \ --cores 2 \ --memory 2048 \ --swap 512 \ --net0 name=eth0,bridge=vmbr0,ip=dhcp \ --storage local-lxc \ --rootfs local-lxc:10 \ --unprivileged 1 \ --features nesting=0 \ --onboot 1 pct start 100 ``` -------------------------------- ### Start TileServer GL Light Docker Container Source: https://github.com/skrashevich/meshmonitor/blob/main/docs/configuration/custom-tile-servers.md This command starts a Docker container for TileServer GL Light, a server for serving map tiles. It maps port 8080 from the container to the host and mounts a local 'tiles' directory to '/data' within the container, where .mbtiles files should be placed. This is a quick way to set up a local tile server for testing or offline use. ```bash docker run -d \ --name tileserver \ -p 8080:8080 \ -v $(pwd)/tiles:/data \ maptiler/tileserver-gl-light:latest ```