{"id":21877220,"url":"https://github.com/sudomesh/service-browser","last_synced_at":"2025-08-16T09:11:11.461Z","repository":{"id":15168692,"uuid":"17896444","full_name":"sudomesh/service-browser","owner":"sudomesh","description":"A web app for browsing services available on the People's Open Network.","archived":false,"fork":false,"pushed_at":"2015-05-01T05:32:36.000Z","size":4739,"stargazers_count":6,"open_issues_count":1,"forks_count":4,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-03-28T14:37:18.683Z","etag":null,"topics":["needs-update"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sudomesh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-19T08:09:41.000Z","updated_at":"2018-01-09T23:58:56.000Z","dependencies_parsed_at":"2022-08-31T14:23:06.518Z","dependency_job_id":null,"html_url":"https://github.com/sudomesh/service-browser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudomesh%2Fservice-browser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudomesh%2Fservice-browser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudomesh%2Fservice-browser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudomesh%2Fservice-browser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sudomesh","download_url":"https://codeload.github.com/sudomesh/service-browser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248997080,"owners_count":21195786,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["needs-update"],"created_at":"2024-11-28T08:08:32.936Z","updated_at":"2025-04-15T02:43:20.593Z","avatar_url":"https://github.com/sudomesh.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nThis is a web app for browsing services available on the [People's Open Network](https://peoplesopen.net/).\n\nIt is a simple node.js/express based web app that uses mDNS/DNS-SD to listen for services and informs the web clients about them using websockets.\n\nFor testing purposes, check out [Simple Service Advertisement](https://github.com/sudomesh/simple-service-advertisement) to advertise local services in order to see the browser in use.\n\n# Download #\n\n```\ngit clone https://github.com/sudomesh/service-browser.git\n```\n\n# Install dependencies #\n\n```\nsudo apt-get install libavahi-compat-libdnssd-dev\ncd service-browser/\nnpm install\n```\n\n# Build #\n\n```\nnpm build\n```\n\n# Setup #\n\nSpecify the port and hostname where you want the server to listen in config.js.\n\n# Running #\n\n```\nnpm start\n```\n\nThe service browser will be available at:\n```\nhttp://HOST:PORT/static\n```\nwhere HOST and PORT are defined in config.js\n\n# Test #\n\n```\nnpm test\n```\n\n# DB Scripts #\n\nAvailable db = [development, test]\n\nDump DB to console.\n```\nnode db/db_tasks.js \u003cdb\u003e dump\n```\n\nSeed DB with services.\n```\nnode db/db_tasks.js \u003cdb\u003e seed\n```\n\nDrop all records.\n```\nnode db/db_tasks.js \u003cdb\u003e clear\n```\n\n\n# Gulp/Browserify/Bower #\n\nservice-browser uses Gulp, Browserify, and Bower to manage front-end dependencies.\nSo this means that you can use npm packages inside of client-side javascript\nThere's pretty decent documentation for these modules all over the internets.\n\n## Gulp ##\n\nGulp is a javascript build system/task manager. By running `./node_modules/gulp/bin/gulp.js` you are \nrunning the `./gulp/tasks/default.js` task which runs a build and then watch task.\nThe build task will optimize images, compile LESS and run browserify.\n\nAll of the tasks are under  `./gulp/tasks`. You can run any individual tasks by running:\n`./node_modules/gulp/bin/gulp.js build` where build is the name of the task you'd want to run\n\n\n## Browserify ##\n\nBrowserify is a nifty tool which lets you use CommonJS require syntax to pull in npm modules into\nclient-side JS. Thanks substack!\nMost of the magic is inside of `./gulp/tasks/browserify.js`\n\nSay you wanted to use lodash (an underscore analog) in a client-side script. You could do the following\n`npm install --save lodash` (use --save if you want to add the module to package.json)\nThen inside your client-side JS, you could do the following:\n\n````\nvar _ = require('lodash')\nconsole.log(_)\n```\n\nWe also make pretty significant use of browserify-shim, which lets us include packages that aren't \ninstallable via npm. This is mostly setup inside of `./package.json`. The relevant passage looks \nsimilar to:\n\n```\n  \"browser\": {\n    \"jquery-cookie\": \"./www/bower_components/jquery.cookie/jquery.cookie.js\",\n    \"sockjs-client\": \"./www/bower_components/sockjs/sockjs.js\"\n  },\n  \"browserify\": {\n    \"transform\": [\n      \"browserify-shim\",\n      \"hbsfy\"\n    ]\n  },\n  \"browserify-shim\": {\n    \"jquery-cookie\": {\n      \"depends\": [\n        \"jquery:$\"\n      ],\n      \"exports\": \"jquery.cookie\"\n    },\n    \"sockjs-client\": {\n      \"exports\": \"SockJS\"\n    }\n  }\n```\nThe values of \"browser\" are key value pairs where the key is the require() name and the value\nis the location of the package\n\n\"browserify-shim\" delineates the specifics of each of the shimmed packages. There is a field \nfor what the package depends on and what it exports. That would be the result of the assignment\n```\nvar variable = require('sockjs-client')\n```\n\nThe location of the package can be anywhere, although I've been mostly using bower to install\n3rd party packages, which brings us to....\n\n\n## Bower ##\nBower is a fairly generic and unopinionated front-end package manager. I've been using it to install\nanything that doesn't exist in npm as well as css packages (like bootstrap)\n\nTo install a new package, cd into ./www and then run\n```\n../node_modules/bin/bower install --save bootstrap\n```\nwhere bootstrap is the package you want to install and --save saves it to bower.json\n\nThere are a variety of ways you can now use these packages:\n\n- browserify-shim: see above \n- less/css: inside of `./www/css/imports.less` you'll see the lines:\n```\n  @import \"../bower_components/bootstrap/less/bootstrap.less\";\n```\nThat will import the bootstrap less file, which will then be compiled by browserify, etc. \n\n\n# Troubleshooting #\n\nIf you get an error like this:\n\n```\nModule version mismatch, refusing to load\n```\n\nThen ensure that you don't have any older versions of node, node-gyp or npm sitting around. Deleting older versions of node-gyp from ~/.node-gyp/ may fix this problem.\n\nIf you get an error like this:\n\n```\n../src/mdns.hpp:31:20: fatal error: dns_sd.h: No such file or directory\n #include \u003cdns_sd.h\u003e\n                    ^\ncompilation terminated.\nmake: *** [Release/obj.target/dns_sd_bindings/src/dns_sd.o] Error 1\nmake: Leaving directory `/home/mini/sudo/mesh/service-browser/node_modules/mdns2/build'\ngyp ERR! build error \ngyp ERR! stack Error: `make` failed with exit code: 2\ngyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)\ngyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)\ngyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:797:12)\ngyp ERR! System Linux 3.11.0-19-generic\ngyp ERR! command \"node\" \"/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js\" \"rebuild\"\ngyp ERR! cwd /home/mini/sudo/mesh/service-browser/node_modules/mdns2\ngyp ERR! node -v v0.10.26\ngyp ERR! node-gyp -v v0.12.2\ngyp ERR! not ok \n\n```\nit looks like it can be fixed by installing libavahi-compat-libdnssd-dev\n```\nsudo apt-get install libavahi-compat-libdnssd-dev\n```\n\nIf you get an error similar to the following:\n```\nnpm http 200 https://registry.npmjs.org/weak/-/weak-0.2.2.tgz\nnpm http GET https://registry.npmjs.org/bindings\nnpm http 304 https://registry.npmjs.org/bindings\n\n\u003e weak@0.2.2 install node_modules/weak\n\u003e node-gyp rebuild\n\nTraceback (most recent call last):\n  File \"/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py\", line 18, in \u003cmodule\u003e\n    sys.exit(gyp.script_main())\nAttributeError: 'module' object has no attribute 'script_main'\ngyp ERR! configure error \ngyp ERR! stack Error: `gyp` failed with exit code: 1\ngyp ERR! stack     at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:337:16)\ngyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)\ngyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)\ngyp ERR! System Linux 3.11.0-15-generic\ngyp ERR! command \"node\" \"/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js\" \"rebuild\"\n\ngyp ERR! node -v v0.10.15\ngyp ERR! node-gyp -v v0.12.1\ngyp ERR! not ok \nnpm ERR! weak@0.2.2 install: `node-gyp rebuild`\nnpm ERR! Exit status 1\nnpm ERR! \nnpm ERR! Failed at the weak@0.2.2 install script.\nnpm ERR! This is most likely a problem with the weak package,\nnpm ERR! not with npm itself.\nnpm ERR! Tell the author that this fails on your system:\nnpm ERR!     node-gyp rebuild\nnpm ERR! You can get their info via:\nnpm ERR!     npm owner ls weak\nnpm ERR! There is likely additional logging output above.\n\nnpm ERR! System Linux 3.11.0-15-generic\nnpm ERR! command \"node\" \"/usr/bin/npm\" \"install\" \"weak@0.2.2\"\nnpm ERR! node -v v0.10.15\nnpm ERR! npm -v 1.3.23\nnpm ERR! code ELIFECYCLE\n\nnpm ERR! not ok code 0\n```\nthis might be helpful. From\nhttp://stackoverflow.com/questions/21155922/error-installing-node-gyp-on-ubuntu\n\n```\n#!/bin/bash\n#On Ubuntu Saucy:\nsudo add-apt-repository ppa:fkrull/deadsnakes\nsudo apt-get update\nsudo apt-get install python2.6\nsudo update-alternatives --install /usr/bin/python python /usr/bin/python2.6 20\nsudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 10\n\n#you can switch between 2.6 \u0026 2.7 using:\nsudo update-alternatives --config python\n```\n\nIt looks like python 2.6 might be a dependency for the mdns module, in which case the stack overflow answer allows for easy switching between 2.6 and 2.7\n\n# ToDo #\n\n* Currently only lists http/https services\n* Searching services\n* Organizing by category/etc.\n* On service down, remember the service but flag it as down and filter when pushing to clients.\n* Implement levedb on client and sync with on connect.\n* Save up/down votes from client.\n\n# License #\n\n[AGPLv3](http://www.gnu.org/licenses/agpl-3.0.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsudomesh%2Fservice-browser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsudomesh%2Fservice-browser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsudomesh%2Fservice-browser/lists"}