{"id":21016602,"url":"https://github.com/gsa/asis","last_synced_at":"2025-05-15T05:33:00.707Z","repository":{"id":19125074,"uuid":"22354434","full_name":"GSA/asis","owner":"GSA","description":"ASIS (Advanced Social Image Search) indexes Flickr and MRSS images and provides a search API across both indexes.","archived":false,"fork":false,"pushed_at":"2024-05-29T04:23:55.000Z","size":478,"stargazers_count":29,"open_issues_count":4,"forks_count":22,"subscribers_count":20,"default_branch":"main","last_synced_at":"2024-05-29T07:22:08.375Z","etag":null,"topics":["maintained"],"latest_commit_sha":null,"homepage":"https://search.digitalgov.gov/developer/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GSA.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2014-07-28T19:09:13.000Z","updated_at":"2024-05-30T15:44:30.610Z","dependencies_parsed_at":"2024-02-02T22:24:40.847Z","dependency_job_id":"3528383a-b085-46c6-9c29-48cbbab53791","html_url":"https://github.com/GSA/asis","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GSA%2Fasis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GSA%2Fasis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GSA%2Fasis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GSA%2Fasis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GSA","download_url":"https://codeload.github.com/GSA/asis/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254282738,"owners_count":22045128,"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":["maintained"],"created_at":"2024-11-19T10:14:50.933Z","updated_at":"2025-05-15T05:32:59.867Z","avatar_url":"https://github.com/GSA.png","language":"Ruby","readme":"ASIS Server\n==============\n\n[![CircleCI](https://circleci.com/gh/GSA/asis.svg?style=shield)](https://circleci.com/gh/GSA/asis)\n[![Code Climate](https://codeclimate.com/github/GSA/asis/badges/gpa.svg)](https://codeclimate.com/github/GSA/asis)\n[![Test Coverage](https://codeclimate.com/github/GSA/asis/badges/coverage.svg)](https://codeclimate.com/github/GSA/asis)\n\nASIS (Advanced Social Image Search) indexes Flickr and MRSS images and provides a search API across both indexes.\n\n## Current version\n\nYou are reading documentation for ASIS API v1.\n\n## Contribute to the code\n\nThe server code that runs the image search component of [Search.gov](https://search.gov/) is here on Github.\n[Fork this repo](https://github.com/GSA/oasis/fork) to add features like additional datasets, or to fix bugs.\n\n## Dependencies\n\n### Ruby\n\nUse [rvm](https://rvm.io/) to install the version of Ruby specified in `.ruby-version`.\n\n### Configuration\n\n 1. Copy `config/flickr.yml.example` to `config/flickr.yml` and update the fields with your Flickr credentials.\n\n### Docker\n\nDocker can be used to: 1) run just the required services (MySQL, Elasticsearch, etc.) while [running the asis application in your local machine](https://github.com/GSA/asis#developmentusage), and/or 2) run the entire `asis` application in a Docker container.  Please refer to [searchgov-services](https://github.com/GSA/search-services) for detailed instructions on centralized configuration for the services.\n\nWhen running in a Docker container (option 2 above), the `asis` application is configured to run on port [3300](http://localhost:3300/). Required dependencies - ([Ruby](https://github.com/GSA/asis#ruby), and [Gems](https://github.com/GSA/asis#ruby)) - are installed using Docker. However, other data or configuration may need to be setup manually, which can be done in the running container using `bash`.\n\nAny operations (using rails console, running rake commands, etc.) on ASIS application running in Docker container can be performed by executing below command in `search-services`.\n\n    $ docker compose run asis bash\n\nFor example, to setup DB in Docker:\n\n    $ docker compose run asis bash\n    $ bin/rails oasis:seed_profiles\n\nThe Elasticsearch service provided by `searchgov-services` is configured to run on the default port, [9200](http://localhost:9200/). To use a different host (with or without port) or set of hosts, set the `ES_HOSTS` environment variable. For example, use following command to run the specs using Elasticsearch running on `localhost:9207`:\n\n    ES_HOSTS=localhost:9207 bundle exec rspec spec\n\n### Gems\n\nWe use bundler to manage gems. You can install bundler and other required gems like this:\n\n    gem install bundler\n    bundle install\n\n## Development/Usage\n\n### Create indexes\n\n```ruby\nrails oasis:create_index\n```\n\n### Seed some image data\n\nYou can bootstrap the system with some government Flickr profiles and MRSS feeds to see the system working.\nSample lists are in config/flickr_profiles.csv` and `config/mrss_profiles.csv`.\n\n    bundle exec rake oasis:seed_profiles\n\nYou can keep the indexes up to date by periodically refreshing the last day's images. To do this manually via the Rails console:\n\n    MrssPhotosImporter.refresh\n    FlickrPhotosImporter.refresh\n\n### Running it\n\nFire up a server and try it all out.\n\n    bundle exec rails s\n\nHere are the profiles you have just bootstrapped. Note: Chrome does a nice job of pretty-printing the JSON response.\n\n\u003chttp://localhost:3000/api/v1/flickr_profiles.json\u003e\n\n\u003chttp://localhost:3000/api/v1/mrss_profiles.json\u003e\n\nYou can add a new profile manually via the REST API:\n\n        curl -XPOST \"http://localhost:3000/api/v1/flickr_profiles.json?name=commercegov\u0026id=61913304@N07\u0026profile_type=user\"\n        curl -XPOST \"http://localhost:3000/api/v1/mrss_profiles.json?url=https://share-ng.sandia.gov/news/resources/news_releases/feed/\"\n\nMRSS profiles work a little differently than Flickr profiles. When you create the MRSS profile, Oasis assigns a\nshort name to it that you will use when performing searches. The JSON result from the POST request will look something like this:\n\n      {\n        \"created_at\": \"2014-10-26T18:25:21.167+00:00\",\n        \"updated_at\": \"2014-10-26T18:25:21.173+00:00\",\n        \"name\": \"72\",\n        \"id\": \"https://share-ng.sandia.gov/news/resources/news_releases/feed/\"\n      }\n\n### Asynchronous job processing\n\nWe use [Sidekiq](http://sidekiq.org) for job processing. You can see all your jobs queued up here:\n\n\u003chttp://localhost:3000/sidekiq\u003e\n\nKick off the indexing process:\n\n    bundle exec sidekiq\n\n### Searching\n\nIn the Rails console, you can query each index manually using the Elasticsearch [Query DSL](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl.html):\n\n    bin/rails c\n    FlickrPhoto.count\n    MrssPhoto.count\n    FlickrPhoto.all(query:{term:{owner:'28634332@N05'}}).results\n    MrssPhoto.all(query:{match:{description:'air'}}).results\n\n### Parameters\n\nThese parameters are accepted for the blended search API:\n\n1. query\n2. flickr_groups (comma separated)\n2. flickr_users (comma separated)\n2. mrss_names (comma separated list of Oasis-assigned names)\n4. size\n5. from\n\n### Results\n\nThe top level JSON contains these fields:\n\n* `total`\n* `offset`\n* `suggestion`: The overridden spelling suggestion\n* `results`\n\nEach result contains these fields:\n\n* `type`: FlickrPhoto\n* `title`\n* `url`\n* `thumbnail_url`\n* `taken_at`\n\n### API versioning\n\nWe support API versioning with the JSON format. The current version is v1. You can specify a specific JSON API version like this:\n\n    curl \"http://localhost:3000/api/v1/image.json?flickr_groups=1058319@N21\u0026flickr_users=35067687@n04,24662369@n07\u0026mrss_names=72,73\u0026query=earth\"\n\n## Tests\n\nThese require an [Elasticsearch](http://www.elasticsearch.org/) server and [Redis](http://redis.io) server to be running.\n\n    bundle exec rspec\n\n### Code coverage\n\nWe track test coverage of the codebase over time, to help identify areas where we could write better tests and to see when poorly tested code got introduced.\n\nAfter running your tests, view the report by opening `coverage/index.html`.\n\nClick around on the files that have \u003c 100% coverage to see what lines weren't exercised.\n\n### Code Quality\n\nWe use [Rubocop](https://rubocop.org/) for static code analysis. Settings specific to ASIS are configured via [.rubocop.yml](.rubocop.yml). Settings that can be shared among all Search.gov repos should be configured via the [searchgov_style](https://github.com/GSA/searchgov_style) gem.\n\n## Code samples\n\nWe \"eat our own dog food\" and use this ASIS API to display image results on the government websites that use [Search.gov](https://search.gov/).\n\nSee the results for a search for [*bird* on FWS.gov](https://search.usa.gov/search/images?affiliate=fws.gov\u0026query=bird).\n\nFeedback\n--------\n\nYou can send feedback via [Github Issues](https://github.com/GSA/oasis/issues).\n\n-----\n\n[Loren Siebert](https://github.com/loren) and [contributors](http://github.com/GSA/oasis/contributors).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgsa%2Fasis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgsa%2Fasis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgsa%2Fasis/lists"}