kitspace / partinfo

A microservice to get information on electronic components.

Home Page:https://dev-partinfo.kitspace.org/graphql

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Kitspace Partinfo

Build Status

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.

Popup screenshot

Development

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

Requirements

  • 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

Quick start for Debian/Ubuntu

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

Running the server

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

Tests

There are some automated tests in integration/test_api.js that you can run:

yarn test

About

A microservice to get information on electronic components.

https://dev-partinfo.kitspace.org/graphql

License:Other


Languages

Language:JavaScript 100.0%