{"id":19164698,"url":"https://github.com/publiclab/spectral-workbench","last_synced_at":"2025-04-06T13:11:40.380Z","repository":{"id":8808170,"uuid":"10504658","full_name":"publiclab/spectral-workbench","owner":"publiclab","description":"Web-based tools for collecting, analyzing, and sharing data from a DIY spectrometer","archived":false,"fork":false,"pushed_at":"2023-03-06T12:59:11.000Z","size":24106,"stargazers_count":132,"open_issues_count":157,"forks_count":160,"subscribers_count":20,"default_branch":"main","last_synced_at":"2025-03-30T12:07:22.630Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":"http://spectralworkbench.org","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/publiclab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2013-06-05T14:35:46.000Z","updated_at":"2025-03-06T04:17:00.000Z","dependencies_parsed_at":"2023-01-16T20:00:10.461Z","dependency_job_id":"c9415061-11a6-47ec-95a5-4e764582b319","html_url":"https://github.com/publiclab/spectral-workbench","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/publiclab%2Fspectral-workbench","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/publiclab%2Fspectral-workbench/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/publiclab%2Fspectral-workbench/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/publiclab%2Fspectral-workbench/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/publiclab","download_url":"https://codeload.github.com/publiclab/spectral-workbench/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247485290,"owners_count":20946398,"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":["hacktoberfest"],"created_at":"2024-11-09T09:23:34.383Z","updated_at":"2025-04-06T13:11:40.363Z","avatar_url":"https://github.com/publiclab.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spectral Workbench\n\nCopyright Public Lab\npubliclab.org | spectralworkbench.org\n\n[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/publiclab/spectral-workbench/)\n[![tests](https://github.com/publiclab/spectral-workbench/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/publiclab/spectral-workbench/actions/workflows/tests.yml)\n[![View performance data on Skylight](https://badges.skylight.io/typical/Wnv2jzIUWl5x.svg)](https://oss.skylight.io/app/applications/Wnv2jzIUWl5x)\n\nSpectral Workbench is an open-source tool to perform low-cost spectral analysis and to share those results online. It consists of a Ruby on Rails web application for publishing, archiving, discussing, and analyzing spectra online -- running at http://spectralworkbench.org\n\nThe core library for analyzing and manipulating spectral data **has been spun out into its own self-contained JavaScript module**, at https://github.com/publiclab/spectral-workbench.js, which is then included into this application. To use Spectral Workbench on the commandline, try that out!\n\nRead about how to build and use your own spectrometer with this software here: http://publiclab.org/wiki/spectrometer\n\n****\n\n## Simple installation with Cloud9\n\n1. If you have a GitHub account, visit https://c9.io and log in with the GitHub button.\n2. Fork this repository to your own GitHub account, creating a `yourname/spectral-workbench` project.\n3. Name your project, then (order important!) choose the **Ruby** template, THEN enter `yourname/spectral-workbench` in the \"Clone from Git or Mercurial URL\" field, and press **Create Workspace** \n4. In the command line prompt at the bottom of the page, type `./install_cloud9.sh` and press enter.\n5. Enter your username when prompted, and click \"Run Project\" when it's done.\n6. You're done! Go to the URL shown!\n\n****\n\n## Installation\n\nThe app now runs on Ruby 2.6.6 up to Ruby 2.6.x (preferred), and Rails 5.2.x, and uses Bundler for gem management and Yarn for static asset management.  \n\n### Prerequisites:\n\nRecommended; for an Ubuntu/Debian system. Varies slightly for mac/fedora/etc\n\nInstall a database, if necessary:\n\n`sudo apt-get install mysql-server`\n\n**Note:** You will have to update the `config/database.yml` file appropriately. The example file assumes usage of SQLite. For which you need not install MySQL.\n\nRMagick dependencies are required for processing uploaded spectrum images: `apt-get install imagemagick ruby-rmagick libmagickwand-dev libmagick++-dev`\n\n* On Fedora/centOs: `yum install ImageMagick-devel`\n* On mac, you can use Homebrew: `brew install imagemagick`\n\nInstall rvm for Ruby management (http://rvm.io)\n\n`curl -L https://get.rvm.io | bash -s stable`\n\n**Note:** At this point during the process, you may want to log out and log back in, or open a new terminal window; RVM will then properly load in your environment. \n\n**Ubuntu users:** You may need to enable `Run command as a login shell` in Ubuntu's Terminal, under Profile Preferences \u003e Title and Command. Then close the terminal and reopen it.\n\nThen, use RVM to install version 2.6.6 of Ruby:\n\n`rvm install 2.6.6`\n\nYou'll also need **yarn** which is available through NPM. To install NPM, you can run:\n\n`sudo apt-get install npm`\n\nHowever, on Ubuntu, you may need to also install the `nodejs-legacy` package, as due to a naming collision, some versions of Ubuntu already have an unrelated package called `node`. To do this, run:\n\n`sudo apt-get install nodejs-legacy`\n\nOnce NPM is installed, you should be able to run:\n\n`sudo npm install -g yarn`\n\n* On mac, you can use Homebrew: `brew install yarn`\n\n### Installation steps:\n\n1. Download a copy of the source with `git clone https://github.com/publiclab/spectral-workbench.git` \n2. Install gems with `bundle install` from the rails root folder. You may need to run `bundle update` if you have older gems in your environment.\n3. Copy and configure database with `cp config/database.yml.example config/database.yml`. Similarly, configure `cp config/config.yml.example config/config.yml`\n4. Initialize database with `bundle exec rake db:setup`\n5. Install static assets (like external javascript libraries, fonts) with `yarn install` \n6. Start rails with `bundle exec passenger start` from the Rails root and open http://localhost:3000 in a web browser. (For some, just `passenger start` will work; adding `bundle exec` ensures you're using the version of passenger you just installed with Bundler.)\n\nSign in instructions:\n\n*  Create a account at PublicLab.org and use that username to log in.\n*  Then you will be redirected to publiclab.org to \"approve\" a use of the openid identity.\n*  Note that this applies for development environment as well. \n\n## Bugs and support\n\nTo report bugs and request features, please use the GitHub issue tracker provided at http://github.com/publiclab/spectral-workbench/issues \n\nFor additional support, join the Public Laboratory website and mailing list at http://publiclab.org/lists or for urgent requests, email web@publiclab.org\n\nFor questions related to the use of this software and your open source spectrometer, the same page links to the \"plots-spectrometry\" group. \n\n## API\n\nUsing your secret API token on your SpectralWorkbench.org profile, you can submit spectral via the API in JSON format:\n\nPOST to \"https://spectralworkbench.org/spectrums.json\"\n\nThe required parameters are: \n\n```json\n{\"spectrum\": {\n  \"title\": \"Test spectrum\",\n  \"data_type\": \"json\",\n  \"data\": [\n    {\"average\": 64.3, \"r\": 69, \"g\": 46, \"b\": 78, \"wavelength\": 269.089 },\n    {\"average\": 63.3, \"r\": 71, \"g\": 45, \"b\": 74, \"wavelength\": 277.718 },\n    {\"average\": 64,   \"r\": 71, \"g\": 47, \"b\": 74, \"wavelength\": 291.524 },\n    {\"average\": 64,   \"r\": 68, \"g\": 49, \"b\": 75, \"wavelength\": 303.604 }\n  ]},\n  \"token\": \"00000000\"\n}\n```\n\nThis will return a path (from the root URL by default) to the spectrum, as in: `/spectrums/12345`\n\n## Developers\n\nDevelopment is occurring at https://github.com/publiclab/spectral-workbench/; please fork and submit pull requests; for more guidelines on contributing to Public Lab projects, see http://publiclab.org/wiki/contributing-to-public-lab-software\n\nIf you're a developer, consider joining the Public Lab developer list, also at http://publiclab.org/wiki/developers\n\n### Testing\n\nBefore submitting changes, please run tests with `rake test` to ensure that your code passes.\n\nAlso run `rake jasmine` and navigate to http://localhost:8888 to check client-side tests.\n\nNew tests are also appreciated to increase coverage; Rails tests are in /test and Jasmine tests (JavaScript tests) are in /spec.\n\n****\n\n## License\n\nSpectral Workbench is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nSpectral Workbench is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with Spectral Workbench.  If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpubliclab%2Fspectral-workbench","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpubliclab%2Fspectral-workbench","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpubliclab%2Fspectral-workbench/lists"}