### Set up local development environment Source: https://github.com/aryamantodkar/oneglanse/blob/main/CONTRIBUTING.md Clones the repository and runs the local setup command. Requires Node.js 20+, pnpm 10.16.0, and Docker with Compose. `pnpm local` installs dependencies, prepares the browser runtime, starts PostgreSQL, ClickHouse, and Redis, runs migrations, and opens the web app at http://localhost:3000. ```bash git clone https://github.com/oneglanse/oneglanse.git cd oneglanse pnpm local ``` -------------------------------- ### Run automated VPS setup script Source: https://github.com/aryamantodkar/oneglanse/blob/main/docs/self-hosted-setup.mdx Run the automated setup script on a non-root sudo user. The script rejects root, asks for domain, install directory, analysis key, proxy API URL, and upload token, installs dependencies, configures .env, starts Docker stack, configures nginx, attempts Let's Encrypt certificate, and opens firewall ports if ufw is installed. It generates an upload token if left blank and opens port 3333 for session upload. ```bash bash <(curl -fsSL https://raw.githubusercontent.com/oneglanse/oneglanse/main/scripts/setup-vps.sh) ``` -------------------------------- ### Install prerequisites on Ubuntu Source: https://github.com/aryamantodkar/oneglanse/blob/main/docs/self-hosted-setup.mdx Install Docker, Node.js 20, Git, nginx, and Certbot on Ubuntu for the self-hosted setup. ```bash sudo apt-get update curl -fsSL https://get.docker.com | sh sudo usermod -aG docker "$USER" newgrp docker curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - sudo apt-get install -y nodejs git nginx certbot python3-certbot-nginx ``` -------------------------------- ### Clone repository and run setup script Source: https://github.com/aryamantodkar/oneglanse/blob/main/docs/self-hosted-setup.mdx Clone the repository and run the setup script from the checkout. This is an alternative to the curl-based one-liner and requires the same non-root sudo user and DNS A record. ```bash git clone https://github.com/oneglanse/oneglanse.git /tmp/oneglanse bash /tmp/oneglanse/scripts/setup-vps.sh ``` -------------------------------- ### Start OneGlanse locally with pnpm local Source: https://github.com/aryamantodkar/oneglanse/blob/main/README.md Starts the local OneGlanse app. Prepares browser files, starts supporting services, and applies database migrations. First start may take longer while Docker images and browser files download. ```bash pnpm local ``` -------------------------------- ### Start Next.js dev server Source: https://github.com/aryamantodkar/oneglanse/blob/main/apps/web/README.md Starts the Next.js development server for the @oneglanse/web app. Run after applying migrations. ```bash pnpm --filter @oneglanse/web dev ``` -------------------------------- ### Clone and set up OneGlanse environment Source: https://github.com/aryamantodkar/oneglanse/blob/main/README.md Clones the OneGlanse repository, changes into the project directory, and copies the example environment file to .env. Requires Node.js 20+, pnpm 10+, Docker, and an analysis model API key. ```bash git clone https://github.com/oneglanse/oneglanse.git cd oneglanse cp .env.example .env ``` -------------------------------- ### Run landing app dev server Source: https://github.com/aryamantodkar/oneglanse/blob/main/apps/landing/README.md Starts the Next.js development server for the landing app. If port 3000 is already in use, run with a custom PORT. ```bash pnpm --filter @oneglanse/landing dev ``` -------------------------------- ### Apply database migrations Source: https://github.com/aryamantodkar/oneglanse/blob/main/apps/web/README.md Applies database migrations before starting the app. Requires root infrastructure (db, clickhouse, redis) to be running. ```bash pnpm db:migrate ``` -------------------------------- ### View migration and Postgres logs Source: https://github.com/aryamantodkar/oneglanse/blob/main/docs/troubleshooting.mdx Check the migration container and Postgres logs when migration fails on startup. Resolve the reported database or migration error, then rerun `pnpm self-host`. The Compose stack runs migrations before Web starts. ```bash docker logs oneglanse-migrate --tail 100 docker logs postgres_db --tail 100 ``` -------------------------------- ### Run pnpm self-host to pull images Source: https://github.com/aryamantodkar/oneglanse/blob/main/docs/troubleshooting.mdx Pull and start the application images. If Docker reports 'no matching manifest' for the machine's architecture, bootstrap falls back to a local build; other pull errors stop the command. Check Docker's error and outbound registry access before retrying. ```bash pnpm self-host ``` -------------------------------- ### Check ClickHouse logs with docker logs Source: https://github.com/aryamantodkar/oneglanse/blob/main/docs/troubleshooting.mdx Use this command to inspect ClickHouse container logs when the dashboard or logs report a connection error. On first start, initialization can take time; if the container remains unhealthy, inspect its logs before retrying the app. ```bash docker logs clickhouse_db --tail 100 ``` -------------------------------- ### Restrict port 3333 with ufw Source: https://github.com/aryamantodkar/oneglanse/blob/main/docs/self-hosted-setup.mdx Restrict the upload port 3333 to a specific desktop public IP after setup. The first command removes the broad rule opened by the automated script; the second allows only the given IP. Use this on a public VPS to narrow the firewall rule. ```bash sudo ufw delete allow 3333/tcp sudo ufw allow from YOUR_DESKTOP_PUBLIC_IP to any port 3333 proto tcp ``` -------------------------------- ### Run pnpm auth to prepare and sign in Source: https://github.com/aryamantodkar/oneglanse/blob/main/docs/self-hosted-setup.mdx Prepares the Camoufox browser, builds required workspace packages, and opens the local provider sign-in UI on port 3100. The full local app stack and database services are not required. ```bash pnpm auth ``` -------------------------------- ### Enable nginx site and obtain certificate Source: https://github.com/aryamantodkar/oneglanse/blob/main/docs/self-hosted-setup.mdx Enable the nginx site, test configuration, reload nginx, and obtain a Let's Encrypt certificate with Certbot. ```bash sudo ln -s /etc/nginx/sites-available/oneglanse /etc/nginx/sites-enabled/oneglanse sudo nginx -t sudo systemctl reload nginx sudo certbot --nginx -d app.example.com ``` -------------------------------- ### Clone and configure the repository Source: https://github.com/aryamantodkar/oneglanse/blob/main/docs/self-hosted-setup.mdx Clone the oneglanse repository and copy the environment template. ```bash git clone https://github.com/oneglanse/oneglanse.git "$HOME/oneglanse" cd "$HOME/oneglanse" cp .env.example .env ``` -------------------------------- ### Bootstrap the stack with run-compose.mjs Source: https://github.com/aryamantodkar/oneglanse/blob/main/docs/self-hosted-setup.mdx Bootstrap the stack. Uses published images when available, falls back to local build if no compatible manifest. Web app listens on 127.0.0.1:3000; Agent upload API on port 3333. ```bash node scripts/run-compose.mjs bootstrap ``` -------------------------------- ### Configure upload target in .env Source: https://github.com/aryamantodkar/oneglanse/blob/main/docs/self-hosted-setup.mdx Configure the upload target in the local checkout's .env file. Use the same token as the VPS. The default IP shortcut constructs a plain HTTP URL on port 3333. ```dotenv ONEGLANSE_VPS_IP=YOUR_VPS_IP AGENT_AUTH_UPLOAD_TOKEN=your-long-random-secret ``` -------------------------------- ### Build images with pnpm self-host:build Source: https://github.com/aryamantodkar/oneglanse/blob/main/docs/troubleshooting.mdx Explicitly build the application images from source when you need to avoid pulling prebuilt images, such as when the registry is unavailable or you want a local build. ```bash pnpm self-host:build ``` -------------------------------- ### Configure .env for self-hosted deployment Source: https://github.com/aryamantodkar/oneglanse/blob/main/docs/self-hosted-setup.mdx Set the public URL, analysis model, ThorData API endpoint, and upload token in .env. For Anthropic, use ANTHROPIC_API_KEY and ANALYSIS_LLM_PROVIDER=claude instead of OPENAI_API_KEY. Keep ONEGLANSE_APP_MODE=self-host. ```dotenv APP_URL=https://app.example.com API_BASE_URL=https://app.example.com ONEGLANSE_APP_MODE=self-host OPENAI_API_KEY=your-key THORDATA_PROXY_API_URL=https://your-thordata-api-link AGENT_AUTH_UPLOAD_TOKEN=your-long-random-secret ``` -------------------------------- ### Update VPS with git pull and bootstrap Source: https://github.com/aryamantodkar/oneglanse/blob/main/docs/self-hosted-setup.mdx Updates the VPS checkout. Bootstrap pulls current configured images and recreates containers. Expect a brief interruption during recreation. If .env changed, this command applies the new values. ```bash cd "$HOME/oneglanse" git pull node scripts/run-compose.mjs bootstrap ``` -------------------------------- ### Run pre-PR verification checks Source: https://github.com/aryamantodkar/oneglanse/blob/main/CONTRIBUTING.md Runs the full set of repository checks before opening a pull request. CI runs the same checks and also builds and tests Docker images on AMD64 and ARM64 runners when relevant files change. ```bash pnpm lint pnpm typecheck pnpm test pnpm deadcode pnpm build ``` -------------------------------- ### View Web and Postgres logs for scheduler errors Source: https://github.com/aryamantodkar/oneglanse/blob/main/docs/troubleshooting.mdx Inspect Web and Postgres logs for `[scheduler]`, `pg_cron`, or scheduled-run errors when a recurring schedule is saved but does not run. Verify that `API_BASE_URL` is reachable from the Postgres container and that startup generated `INTERNAL_CRON_SECRET`. ```bash docker logs oneglanse-web --tail 100 docker logs postgres_db --tail 100 ``` -------------------------------- ### Check Docker containers with docker ps Source: https://github.com/aryamantodkar/oneglanse/blob/main/docs/troubleshooting.mdx Use this command to verify that Docker is running and the redis container is healthy when encountering ECONNREFUSED errors for Redis. ```bash docker ps ``` -------------------------------- ### Check Agent worker logs with docker logs Source: https://github.com/aryamantodkar/oneglanse/blob/main/docs/troubleshooting.mdx Inspect the Agent worker logs on a VPS to diagnose prompts that remain queued. Run this after confirming the worker is running and before checking provider connection status and Redis health. ```bash docker logs oneglanse-agent-worker --tail 100 ``` -------------------------------- ### Upload sessions with pnpm upload:vps Source: https://github.com/aryamantodkar/oneglanse/blob/main/docs/self-hosted-setup.mdx Uploads existing sessions later without signing in again. Only works if sessions changed and upload is configured. ```bash pnpm upload:vps ``` -------------------------------- ### Set Anthropic API key and provider in .env Source: https://github.com/aryamantodkar/oneglanse/blob/main/README.md Sets the Anthropic API key and configures the analysis provider to Claude in the .env file. Use this when you have an Anthropic key. ```dotenv ANTHROPIC_API_KEY=your-key ANALYSIS_LLM_PROVIDER=claude ``` -------------------------------- ### Set OpenAI API key in .env Source: https://github.com/aryamantodkar/oneglanse/blob/main/README.md Sets the OpenAI API key in the .env file for analysis. Use this when you have an OpenAI key. ```dotenv OPENAI_API_KEY=your-key ``` -------------------------------- ### Check Agent health endpoint Source: https://github.com/aryamantodkar/oneglanse/blob/main/docs/troubleshooting.mdx Confirm the Agent is reachable from the desktop and the upload port is allowed by your firewall or private network. A `401 Unauthorized` response means the token was rejected. Check the Agent logs with `docker logs oneglanse-agent-worker --tail 100`. ```bash curl http://YOUR_VPS_IP:3333/health ``` -------------------------------- ### Nginx reverse proxy configuration Source: https://github.com/aryamantodkar/oneglanse/blob/main/docs/self-hosted-setup.mdx Nginx server block for the oneglanse web app, proxying to 127.0.0.1:3000. Save as /etc/nginx/sites-available/oneglanse with your real hostname. ```nginx server { listen 80; server_name app.example.com; location / { proxy_pass http://127.0.0.1:3000; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_read_timeout 120s; } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.