NMDC ORCID Creditor is a web app NMDC team members can use to offer credits to people that contribute to the project; and which those people can use to claim those credits—applying them to their ORCID profiles.
Important
NMDC ORCID Creditor does not yet allow a person to claim a credit in a way that updates their ORCID profile. That functionality is still under development.
- Create and customize your
.env
file.cp .env.example .env
- Spin up the containerized development environment.
docker compose up --detach
- Visit the development server at: http://127.0.0.1:8000
- API docs are at: http://127.0.0.1:8000/docs
- View the container's logs:
docker compose logs -f app
- Access the container's shell:
docker compose exec app bash
You can run the following commands inside the container (i.e. at the container's shell).
Alternatively, if you prepend
docker compose exec app
to any of them, you will be able to run it from outside the container.
- Run tests:
poetry run pytest # From outside the container: # $ docker compose exec app poetry run pytest
- Format Python code:
poetry run black . # From outside the container: # $ docker compose exec app poetry run black .
- Format and lint Jinja2 templates:
poetry run djlint --reformat --lint . # From outside the container: # $ docker compose exec app poetry run djlint --reformat --lint .
- Format JavaScript files (if you have Node.js and NPM installed):
npx --yes prettier --write nmdc-orcid-creditor-proxy/*.js # From outside the container: # $ docker compose exec app npx --yes prettier --write nmdc-orcid-creditor-proxy/*.js
Here's where you can find certain things within the repository:
nmdc-orcid-creditor-proxy/
: Google Apps Scriptnmdc_orcid_creditor/
: FastAPI appnmdc_orcid_creditor/templates/
: Jinja2 templates used by the FastAPI appstatic/
: Static files served by the FastAPI app
- We copied
static/favicon.png
and some brand color codes from the nmdc-field-notes repository - We downloaded
static/undraw_online_resume_re_ru7s.svg
from unDraw