{"id":18838323,"url":"https://github.com/inspirehep/inspirehep","last_synced_at":"2026-04-29T09:01:46.149Z","repository":{"id":37405499,"uuid":"161622906","full_name":"inspirehep/inspirehep","owner":"inspirehep","description":"Documentation: http://inspire.docs.cern.ch","archived":false,"fork":false,"pushed_at":"2026-04-07T09:10:11.000Z","size":665870,"stargazers_count":19,"open_issues_count":2,"forks_count":23,"subscribers_count":7,"default_branch":"master","last_synced_at":"2026-04-07T09:34:23.529Z","etag":null,"topics":["backend","frontend","inspirehep","python","reactjs","record-editor"],"latest_commit_sha":null,"homepage":"http://inspirehep.net","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/inspirehep.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":"2018-12-13T10:30:29.000Z","updated_at":"2026-04-07T09:10:16.000Z","dependencies_parsed_at":"2024-05-21T10:12:23.861Z","dependency_job_id":"a750d4d3-0176-4da8-be25-211ee89d6f24","html_url":"https://github.com/inspirehep/inspirehep","commit_stats":null,"previous_names":[],"tags_count":380,"template":false,"template_full_name":null,"purl":"pkg:github/inspirehep/inspirehep","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inspirehep%2Finspirehep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inspirehep%2Finspirehep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inspirehep%2Finspirehep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inspirehep%2Finspirehep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inspirehep","download_url":"https://codeload.github.com/inspirehep/inspirehep/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inspirehep%2Finspirehep/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31747170,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T09:16:15.125Z","status":"ssl_error","status_checked_at":"2026-04-13T09:16:05.023Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["backend","frontend","inspirehep","python","reactjs","record-editor"],"created_at":"2024-11-08T02:38:55.614Z","updated_at":"2026-04-13T10:01:29.485Z","avatar_url":"https://github.com/inspirehep.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Inspirehep\n\nThis is a monorepo that currently contains 3 main services (besides helper services)\n- Inspirehep - this is what the main inspire services, it serves the website inspirehep.net / inspirebeta.net and calls the required services\n- Backoffice - a Django app with the goal of fully replacing [inspire-next](https://github.com/inspirehep/inspire-next/) one day with the help of the workflows service\n- Workflows - an airflow service responsible for running the workflows.\n\nOkay now the question is how do we develop on it?\n\n\n## Running with docker\nBy far easiest way to get the project running in your machine is through docker (instruction on how to run it locally below for the brave ones), given that you have enough memory\n\n### Make\nMake will spin up the required services, depending on what you are working on.\n\n- This will prepare the whole inspire development with demo records:\n```bash\nmake run\n```\n- This spinup the whole inspirehep development with demo records but without the backoffice\n```bash\nmake run-inspirehep\n```\n- This will spin up a backoffice\n```bash\nmake run-backoffice\n```\n- You can stop it by simply run\n```bash\nmake stop\n```\n\n### Usage\nUpon spinning it up services should be available in the following routes:\n- Inspirehep - http://localhost:8080\n- Backoffice - http://localhost:8001\n- Airflow / Workflows - http://localhost:8070\n- Opensearch - http://localhost:9200\n- Postgres db  - http://localhost:5432\n\n### How to Log in\n\n- If you simply wish to login to [inspirehep](http://localhost:8080/user/login/local), use `admin@inspirehep.net:123456`\n- If you wish to login into [inspirehep/backoffice](http://localhost:8080/backoffice/login/local) or the [actual backoffice](http://localhost:8001/accounts/login/) use `admin@admin.com:admin`\nBut if you want to test with orcid you will need to set the `ORCID_CLIENT_ID` and `ORCID_CLIENT_SECRET` extra steps must be done:\nIf you wish to test orcid on `inspirehep`:\n   - Go to `backend/inspirehep/orcid/config.py` - They will correspond to `consumer_key` and `consumer_secret`\nIf you wish to test orcid on `backoffice`:\n   - Go to `backoffice/.envs/local/.django` - Add `ORCID_CLIENT_ID` and `ORCID_CLIENT_SECRET` there.\n \n  You can find this values in the password manager for the sandbox orcid environment.\n \n  **⚠️ Do not forget to remove them before committing ⚠️**\n\n### Testing  (WORK IN PROGRESS)\nIf you wish to run the tests for a given services here's the way to do it\nFirst exect into the container i.e.: `docker exec -it \u003ccontainer_name\u003e /bin/bash` or via dockerdestkop\nThen depending on the service you are testing:\n- backoffice-webserver : `pytest .`\n- airflow-webserver: `pytest .`\n- inspire-hep: ?\n- backend: ?\n\n### Adding global variables:\nThere are two ways of setting environment variables on hep:\n- `backend/inspirehep/config.py` \n- `docker-compose.services.yml` - `INVENIO_` prefix must be added. Variables here overwrite `config.py`\n\n## Running Locally\nFor running the enviroment locally you have the following prerequirements:\n\n### Pre requirements\n\n#### Debian / Ubuntu\n\n```bash\n$ sudo apt-get install python3 build-essential python3-dev\n```\n\n#### MacOS\n\n```bash\n$ brew install postgresql@14 libmagic openssl@3 openblas python\n```\n\n### nodejs \u0026 npm using nvm\n\nPlease follow the instructions https://github.com/nvm-sh/nvm#installing-and-updating\n\nWe're using `v20.0.0` (first version we install is the default)\n\n```\n$ nvm install 20.0.0\n$ nvm use global 20.0.0\n```\n\n### yarn\n\n#### Debian / Ubuntu\n\nPlease follow the instructions https://classic.yarnpkg.com/en/docs/install/#debian-stable\n\n#### MacOS\n\n```bash\n$ brew install yarn\n```\n\n### poetry\n\ninstall `poetry` https://poetry.eustace.io/docs/\n\n```bash\n$ curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python -\n```\n\n### pre-commit\n\ninstall `pre-commit` https://pre-commit.com/\n\n```bash\n$ curl https://pre-commit.com/install-local.py | python -\n```\n\nAnd run\n\n```bash\n$ pre-commit install\n```\n\n### Docker \u0026 Docker Compose\n\n#### The topology of docker-compose\n\n![Alt text](./docker/topology.png)\n\nFollow the guide https://docs.docker.com/compose/install/\n\n### For MacOS users\n\n#### General\n\nTurn of the `AirPlay Receiver` under System Preference -\u003e Sharing -\u003e AirPlay Receiver.\nOtherwise, you will run into problems with port 5000 being already in use.\nSee [this](https://developer.apple.com/forums/thread/682332) for more information.\n\n#### M1 users\n\nInstall `Homebrew-file` https://homebrew-file.readthedocs.io/en/latest/installation.html\n\n```bash\n$ brew install rcmdnk/file/brew-file\n```\n\nAnd run\n\n```bash\n$ brew file install\n```\n---\n\n## Run locally\n\n### Backend\n\n```bash\n$ cd backend\n$ poetry install\n```\n\n### UI\n\n```bash\n$ cd ui\n$ yarn install\n```\n\nAlso setup your **VS Code** so as to use Prettier as the default formatter.\n\nPress `CMD+,` and type `defaultFormatter`. \n\nFrom the list choose `Prettier - Code formatter`.\n\nReload your **VS Code** so as the changes to take effect.\n\nFor formatting a file, you can do `CMD+Shift+P` and choose the `Format document` option. This will automatically format your file.\n\n### Editor\n\n```bash\n$ cd record-editor\n$ yarn install\n```\n\n---\n\n### Setup\n\nFirst you need to start all the services (postgreSQL, Redis, ElasticSearch, RabbitMQ)\n\n```bash\n$ docker compose -f docker-compose.services.yml up es mq db cache\n```\n\nAnd initialize database, ES, rabbitMQ, redis and s3\n\n```bash\n$ cd backend\n$ ./scripts/setup\n```\n\nNote that s3 configuration requires default region to be set to `us-east-1`. If you have another default setup in your AWS config (`~/.aws/config`) you need to update it!\n\nAlso, to enable fulltext indexing \u0026 highlighting the following feature flags must be set to true:\n\n```\nFEATURE_FLAG_ENABLE_FULLTEXT = True\nFEATURE_FLAG_ENABLE_FILES = True\n```\n\n### Run\n\n#### Backend\n\nYou can visit Backend http://localhost:8000\n\n```bash\n$ cd backend\n$ ./scripts/server\n```\n\n#### UI\n\nYou can visit UI http://localhost:3000\n\n```bash\n$ cd ui\n$ yarn start\n```\n\n#### Editor\n\n```bash\n$ cd ui\n$ yarn start\n```\n\nIn case you wanna use docker and just run the record-editor locally, use the following steps:\n1. Add the following volume mount to the record-editor service in the [docker-compose.yml](docker-compose.yml):\n    * `- ./record-editor/dist/:/usr/share/nginx/html`\n2. Navigate into the record-editor folder and first run `yarn` and then `yarn start`\n3. Open a second terminal and run `make run`\n\nThe record editor should now be availabe and automatically update when changes are made to the codebase.\n\n\n#### General\nYou can also connect UI to another environment by changing the proxy in `ui/setupProxy.js`\n\n```javascript\nproxy({\n  target: 'http://A_PROXY_SERVER',\n  ...\n});\n```\n\n---\n\n## How to test\n\n### Backend\n\nThe backend tests locally use [`testmon`](https://github.com/tarpas/pytest-testmon) to only run tests that depend on code that has changed (after the first run) by default:\n\n```bash\n$ cd backend\n$ poetry run ./run-tests.sh\n```\n\nIf you pass the `--all` flag to the `run-tests.sh` script, all tests will be run (this is equivalent to the `--testmon-noselect` flag). All other flags passed to the script are transferred to `py.test`, so you can do things like\n\n```bash\n$ poetry run ./run-tests.sh --pdb -k test_failing\n```\n\nYou'll need to run all tests or force test selection (e.g. with `-k`) in a few cases:\n\n- an external dependency has changed, and you want to make sure that it doesn't break the tests (as `testmon` doesn't track external deps)\n- you manually change a test fixture in a non-python file (as `testmon` only tracks python imports, not external data)\n\nIf you want to invoke `py.test` directly but still want to use `testmon`, you'll need to use the `--testmon --no-cov` flags:\n\n```bash\n$ poetry run py.test tests/integration/records --testmon --no-cov\n```\n\nIf you want to disable `testmon` test selection but still perform collection (to update test dependencies), use `--testmon-noselect --no-cov` instead.\n\nNote that `testmon` is only used locally to speed up tests and not in the CI to be completely sure _all_ tests pass before merging a commit.\n\n#### SNow integration tests\n\nIf you wish to modify the SNow integration tests, you have to set the following variables in the SNow [config](https://github.com/inspirehep/inspirehep/blob/master/backend/inspirehep/snow/config.py)\nfile:\n\n```\n SNOW_CLIENT_ID\n SNOW_CLIENT_SECRET\n SNOW_AUTH_URL\n```\n\nThe secrets can be found in the inspirehep QA or PROD sealed secrets.\nAfter setting the variables, run the tests, so the cassettes get generated.\n\n**Before you push dont forget to delete the secrets from the config file!**\n\n### UI\n\n```bash\n$ cd ui\n$ yarn test # runs everything (lint, bundlesize etc.) indentical to CI\n$ yarn test:unit # will open jest on watch mode\n```\n\nNote that `jest` automatically run tests that changed files (unstaged) affect.\n\n### cypress (e2e)\n\nRuns everything from scratch, identical to CI\n\n```bash\n$ sh cypress-tests-chrome.sh\n$ sh cypress-tests-firefox.sh\n```\n\nOpens cypress runner GUI runs them against local dev server (localhost:8080)\n\n```bash\n$ cd e2e\n$ yarn test:dev\n$ yarn test:dev --env inspirehep_url=\u003cany url that serves inspirehep ui\u003e\n```\n\n#### visual tests\n\nVisual tests are run only on `headless` mode. So `yarn test:dev` which uses the headed browser will ignore them.\nRunning existing visual tests and updating/creating snapshots requires `cypress-tests.sh` script.\n\nFor continuous runs (when local DB is running and has required records etc.), the script can be reduced to only the last part `sh cypress-tests-run.sh`.\n\nIf required, tests can run against `localhost:3000` by simply modifying `--host` option in `sh cypress-tests-run.sh`.\n\n#### working with (visual) tests more efficiently\n\nYou may not always need to run tests exactly like on the CI environment.\n\n- To run specific suite, just change `test` script in `e2e/package.json` temporarily to `cypress run --spec cypress/integration/\u003cspec.test.js\u003e`\n\n## How to import records\n\nFirst make sure that you are running:\n\n```bash\n$ cd backend\n$ ./scripts/server\n```\n\nThere is a command `inspirehep importer records` which accepts url `-u`, a directory of `JSON` files `-d` and `JSON` files `-f`.\nA selection of demo records can be found in `data` directory and they are structure based on the record type (i.e. `literature`). Examples:\n\n#### With url\n\n```bash\n# Local\n$ poetry run inspirehep importer records -u https://inspirehep.net/api/literature/20 -u https://inspirehep.net/api/literature/1726642\n# Docker\n$ docker compose exec hep-web inspirehep importer records -u https://inspirehep.net/api/literature/20 -u https://inspirehep.net/api/literature/1726642\n\n# `--save` will save the imported record also to the data folder\n$ \u003c...\u003e inspirehep importer records -u https://inspirehep.net/api/literature/20 --save\n```\n\nValid `--token` or `backend/inspirehep/config.py:AUTHENTICATION_TOKEN` is required.\n\n#### With directory\n\n```bash\n# Local\n$ poetry run inspirehep importer records -d data/records/literature\n# Docker\n$ docker compose exec hep-web inspirehep importer records -d data/records/literature\n```\n\n#### With files\n\n```bash\n# Local\n$ poetry run inspirehep importer records -f data/records/literature/374836.json -f data/records/authors/999108.json\n# Docker\n$ docker compose exec hep-web inspirehep importer records -f data/records/literature/374836.json -f data/records/authors/999108.json\n```\n\n#### All records\n\n```bash\n# Local\n$ poetry run inspirehep importer demo-records\n# Docker\n$ docker compose exec hep-web inspirehep importer demo-records\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finspirehep%2Finspirehep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finspirehep%2Finspirehep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finspirehep%2Finspirehep/lists"}