{"id":25564601,"url":"https://github.com/chenxu2394/web-oscilloscope","last_synced_at":"2026-04-28T21:34:58.714Z","repository":{"id":277286797,"uuid":"931763338","full_name":"chenxu2394/web-oscilloscope","owner":"chenxu2394","description":"A containerized oscilloscope that enables users to broadcast and visualize live data on the internet.","archived":false,"fork":false,"pushed_at":"2025-09-01T05:55:41.000Z","size":9356,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-05T18:41:21.256Z","etag":null,"topics":["azure","container","docker","flask","http"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chenxu2394.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-12T20:17:50.000Z","updated_at":"2025-09-01T05:55:45.000Z","dependencies_parsed_at":"2025-05-24T22:13:34.142Z","dependency_job_id":"32294c42-d556-46f2-9789-eb4eaf3bb6c5","html_url":"https://github.com/chenxu2394/web-oscilloscope","commit_stats":null,"previous_names":["chenxu2394/web_oscilloscope","chenxu2394/web-oscilloscope"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chenxu2394/web-oscilloscope","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenxu2394%2Fweb-oscilloscope","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenxu2394%2Fweb-oscilloscope/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenxu2394%2Fweb-oscilloscope/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenxu2394%2Fweb-oscilloscope/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chenxu2394","download_url":"https://codeload.github.com/chenxu2394/web-oscilloscope/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenxu2394%2Fweb-oscilloscope/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32400868,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T19:38:08.556Z","status":"ssl_error","status_checked_at":"2026-04-28T19:37:55.688Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["azure","container","docker","flask","http"],"created_at":"2025-02-20T21:21:15.308Z","updated_at":"2026-04-28T21:34:58.695Z","avatar_url":"https://github.com/chenxu2394.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Web Oscilloscope\n\nWeb Oscilloscope is a containerized, real-time oscilloscope built with Flask, Bokeh, and Nginx that enables users to publish live data and view it from anywhere on the internet.\n\n![Web Oscilloscope](./demo.gif)\n\n---\n\n## Overview\n\nWeb Oscilloscope provides a web-based interface for visualizing real-time data. Data is broadcasted via HTTP POST requests to a Flask API and then displayed in a continuously updating oscilloscope powered by Bokeh.\n\n---\n\n## Features\n\n- **Real-Time Visualization:**  \n  Renders a continuously updating oscilloscope using [Bokeh](https://bokeh.org/).\n\n- **Data Ingestion API:**  \n  Receives data via HTTP POST requests using [Flask](https://flask.palletsprojects.com/).\n\n- **Persistent Data Storage:**  \n  Uses a capped global deque to store recent data points for consistent plotting for different sessions.\n\n- **Reverse Proxy with Nginx:**  \n  Routes incoming requests to the appropriate backend (Bokeh or Flask) while exposing a single public port.\n\n- **Containerized \u0026 Cloud-Ready:**  \n  Fully Dockerized for seamless deployment, e.g., via Azure Web App for Containers.\n\n---\n\n## Project Structure\n\n```bash\n.\n├── Dockerfile          # Docker build instructions\n├── README.md           # Project documentation\n├── nginx.conf          # Nginx configuration for reverse proxying\n├── oscilloscope.py     # Main application (Flask + Bokeh server)\n├── requirements.txt    # Python dependencies list\n├── send_data.py        # Script to simulate sending data\n├── start.sh            # Startup script for launching the app and Nginx\n└── venv                # (Optional) Local virtual environment folder\n```\n\n---\n\n## Prerequisites\n\n- [Docker](https://www.docker.com/) (Docker Desktop or similar)\n- Python 3.7.13 if you wish to run parts of the application locally\n- An [Azure account](https://azure.microsoft.com/) if you plan to deploy to Azure\n\n---\n\n## Getting Started (Local Testing)\n\n### 1. Build the Docker Image\n\nIn your project directory, run:\n\n```bash\ndocker build -t osc .\n```\n\nThis command uses the Dockerfile to create an image named osc.\n\n### 2. Run the Docker Container Locally\n\nRun the container and map the container’s port 80 (Nginx) to a host port (e.g., 8080):\n\n```bash\ndocker run -p 8080:80 osc\n```\n\n- Nginx listens on port 80 inside the container.\n- The environment variable BOKEH_ALLOW_WS_ORIGIN is set to localhost:8080 (for local testing).\n\n### 3. View the Oscilloscope\n\nOpen your browser and navigate to:\n\n```bash\nhttp://localhost:8080\n```\n\nYou should see the oscilloscope interface (powered by Bokeh).\n\n### 4. Send Data to the Oscilloscope\n\nYou can simulate data input by using the provided `send_data.py` script:\n\n```bash\npython send_data.py --url \"http://localhost:8080/data\"\n```\n\nOr manually send data via curl:\n\n```bash\ncurl -X POST -H \"Content-Type: application/json\" -d '{\"x\": 12.34, \"y\": 56.78}' http://localhost:8080/data\n```\n\nSuccessful responses will return JSON like:\n\n```json\n{ \"status\": \"success\" }\n```\n\n---\n\n## Deployment to Azure\n\n### 1. Build and Push the Docker Image\n\n```bash\ndocker buildx build --platform linux/amd64 -t \u003cyour-dockerhub-username\u003e/osc:latest --push .\n```\n\n### 2. Create an Azure Web App for Containers\n\n1. In the Azure Portal, create a new Web App for Containers.\n2. In the container settings:\n   - Choose Docker Hub as the image source.\n   - Enter the image name (e.g., `\u003cyour-dockerhub-username\u003e/osc:latest`).\n   - Azure will expose the container on port 80 by default.\n3. In the Configuration section, add or update the environment variable:\n   - Name: `BOKEH_ALLOW_WS_ORIGIN`\n   - Value: `\u003cyour-azure-web-app-domain\u003e` (e.g., `osc-yourapp.azurewebsites.net`)\n4. Save the configuration and restart the container.\n\n### 3. Access the Deployed Oscilloscope\n\nAfter deployment, your application will be available at the URL provided by Azure (e.g., `https://osc-yourapp.azurewebsites.net`).\n\n- **Oscilloscope Page**:\n  Visit the Azure URL in your browser to view the oscilloscope.\n- **Data Ingestion**:\n  Send data to the oscilloscope by POSTing to `https://osc-yourapp.azurewebsites.net/data`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchenxu2394%2Fweb-oscilloscope","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchenxu2394%2Fweb-oscilloscope","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchenxu2394%2Fweb-oscilloscope/lists"}