A microservice to get information on electronic components. This is used on kitspace.org to get the part information for the BOM popups on project pages and for the BOM Builder.
This is a GraphQL API, the schema is detailed in schema.js. It currently makes use of:
You need keys for these APIs. Copy the config.js.in
file to config.js
and add them there.
cp config.js.in config.js
$EDITOR config.js
- NodeJS version 8 or higher
- Yarn dependency manager
- Redis persistent in-memory database (for caching)
- The rest of the dependencies can be obtained by running
yarn install
cp config.js.in config.js
$EDITOR config.js
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install nodejs yarn redis
yarn install
yarn start
You should be able to see a GraphiQL client when visting http://localhost:4001/graphql
in your browser. Try this example query.
Query responses will be cached (and persisted to disk) by Redis. If you want to clear all Redis data run:
redis-cli flushall
There are some automated tests in integration/test_api.js
that you can run:
yarn test