Simple node.js app that collects authenticated ORCID iDs and uploads them to a Google document.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
e2e
local_modules
src
test
.angular-cli.json
.editorconfig
.gitignore
.travis.yml
LICENSE
README.md
karma.conf.js
package-lock.json
package.json
protractor.conf.js
server.js
tsconfig.json
tslint.json

README.md

share-my-id

MEAN app for creating collections of authenticated ORCID iDs

Developer Setup

Prerequsites

1. Clone project

git clone git@github.com:ORCID/share-my-id.git

2. Switch to project directory

cd ~/git/share-my-id

3. Install node dependencies

npm install

4. Start mongodb and mongo shell

<path to mongo installation directory>/mongod --dbpath <path to mongo data directory>
<path to mongo installation directory>/mongo

Paths vary depending on your OS and installation method - see MongoDB Manual for more info and alternate startup instructions.

6. Create database and user (first time only)

 use smid;
    db.createUser({
      user: "smid_user",
      pwd: "devpassword",
          roles: ["readWrite"]
    });

7. Start app

npm start

8. Open localhost http://localhost:8080/

Build and reload changes automatically during development

npm start builds Angular source files into the /dist directory once and starts the server; changes will not be rebuilt/reloaded. To rebuild/reload changes automatically:

  1. Install nodemon npm install -g nodemon

  2. Start node server with nodemon nodemon server.js

  3. In separate tab/window, build the Angular project and watch for changes ng build -w

Configure ORCID API credentials

This example is configured with default test credentials on the ORCID Sandbox. You can optionally supply your own sandbox credentials.

1. Register for sandbox credentials at http://orcid.org/content/register-client-application

When registering include the redirect_uri 'https://localhost'

2. Override default config by exporting environment variables

Example in linux bash:

    export CLIENT_ID='APP-3BI8IQ5O8DREEAVF'
    export CLIENT_SECRET='35d8f715-9121-440c-ad34-b66cb8c4e884'
    export ORCID_URL='https://sandbox.orcid.org'
    export PORT_HTTP='8080'
    export HOST='http://localhost:8080'

other systems