{"id":50919115,"url":"https://github.com/rasweb/arduino---backend-frontend-","last_synced_at":"2026-06-16T18:01:57.788Z","repository":{"id":353343727,"uuid":"1219015486","full_name":"Rasweb/Arduino---backend-frontend-","owner":"Rasweb","description":"Connected to my internship, where I worked with 2 other developers.","archived":false,"fork":false,"pushed_at":"2026-04-23T12:58:42.000Z","size":92,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-23T14:37:02.567Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rasweb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2026-04-23T12:51:55.000Z","updated_at":"2026-04-23T12:58:46.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Rasweb/Arduino---backend-frontend-","commit_stats":null,"previous_names":["rasweb/arduino---backend-frontend-"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Rasweb/Arduino---backend-frontend-","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rasweb%2FArduino---backend-frontend-","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rasweb%2FArduino---backend-frontend-/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rasweb%2FArduino---backend-frontend-/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rasweb%2FArduino---backend-frontend-/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rasweb","download_url":"https://codeload.github.com/Rasweb/Arduino---backend-frontend-/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rasweb%2FArduino---backend-frontend-/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34417416,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-16T02:00:06.860Z","response_time":126,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2026-06-16T18:01:56.697Z","updated_at":"2026-06-16T18:01:57.780Z","avatar_url":"https://github.com/Rasweb.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Product Test Results Server\n\nA Node.js/Express server for collecting and displaying product test results with a web interface and REST API.\n\n## Features\n\n- **Web Interface**: Real-time dashboard showing test statistics and results\n- **REST API**: JSON endpoints for programmatic access\n- **Data Persistence**: Automatic saving to JSON file\n- **Device Management**: Support for multiple test devices\n- **Statistics**: Real-time counters for Product A and Product B tests\n- **Filtering**: Filter tests by device and product type\n- **Data Export**: Download test data as JSON\n\n## Installation\n\n1. Install Node.js dependencies:\n```bash\nnpm install express\nStart the server:\n\nbash\nnode server.js\nOpen your browser to:\n\ntext\nhttp://localhost:3000\nAPI Endpoints\nWeb Interface\nGET / - Web dashboard\n\nTest Management\nGET /api/tests - Get all tests\n\nGET /api/tests/:device_id - Get tests by device\n\nPOST /addTestResult - Add single test result\n\nPOST /syncTests - Sync multiple test results\n\nGET /getLastTestId/:device_id - Get latest test ID for device\n\nUtility\nGET /api/stats - Get statistics\n\nGET /logAllEntries - Log all entries to console\n\nGET /health - Health check\n\nPOST /addRandomTest - Add random test (for testing)\n\nData Structure\nTest results are stored with the following format:\n\njson\n{\n  \"test_id\": \"string\",\n  \"data\": {\n    \"productA\": boolean,\n    \"productB\": boolean\n  },\n  \"timestamp\": \"ISO-string\",\n  \"device_id\": \"string\"\n}\nAdding Test Results\nSingle Test\nbash\ncurl -X POST http://localhost:3000/addTestResult \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"test_id\": \"TEST_123\",\n    \"productA\": true,\n    \"productB\": false,\n    \"timestamp\": \"2023-10-15T12:00:00.000Z\",\n    \"device_id\": \"DEVICE_001\"\n  }'\nSync Multiple Tests\nbash\ncurl -X POST http://localhost:3000/syncTests \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"device_id\": \"DEVICE_001\",\n    \"tests\": [\n      {\n        \"test_id\": \"TEST_124\",\n        \"productA\": false,\n        \"productB\": true,\n        \"timestamp\": \"2023-10-15T12:05:00.000Z\"\n      }\n    ]\n  }'\nConfiguration\nPort: 3000\n\nIP: 0.0.0.0 (accessible from any network interface)\n\nData File: testData.json (automatically created)\n\nFeatures Details\nAutomatic Data Persistence: Data is automatically saved to testData.json\n\nDuplicate Prevention: Prevents duplicate test IDs for the same device\n\nReal-time Statistics: Live counters for total tests and product-specific tests\n\nDevice Filtering: View tests from specific devices\n\nProduct Filtering: Filter by Product A, Product B, or both\n\nAuto-refresh: Web interface updates every 30 seconds\n\nUsage Examples\nGet Statistics\nbash\ncurl http://localhost:3000/api/stats\nGet Tests for Specific Device\nbash\ncurl http://localhost:3000/api/tests/DEVICE_001\nHealth Check\nbash\ncurl http://localhost:3000/health\nData File Format\nThe server uses JSON format for data storage:\n\njson\n[\n  {\n    \"test_id\": \"TEST_123\",\n    \"data\": {\n      \"productA\": true,\n      \"productB\": false\n    },\n    \"timestamp\": \"2023-10-15T12:00:00.000Z\",\n    \"device_id\": \"DEVICE_001\"\n  }\n]\nThe server automatically handles file creation, reading, and writing using JSON.parse() and JSON.stringify().","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frasweb%2Farduino---backend-frontend-","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frasweb%2Farduino---backend-frontend-","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frasweb%2Farduino---backend-frontend-/lists"}