Skip to content

sanger/storelight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Storelight

Graphql-based storage service for CGAP

The CGAP LIMS has a mature storage feature, wherein barcoded items can be scanned into various freezers, cupboards, benches, shelf spaces, nested in different configurations, in either in an unsorted pile or in grid-based layout.

This application is the beginning of an attempt to decouple that feature from the LIMS so that it can be shared between multiple other applications.

It uses a MySQL database with a simple schema, and has a GraphQL API that supports storing and unstoring items, searching for stored items, creating and examining storage locations in some kind of hierarchy. (The database schema it uses is described in the storelight-sql repository.)

Any location can contain other locations, both with and without grid-locations, and any location can store items, both with and without grid-locations. Every location has a barcode (generated by Storelight automatically), and locations can be looked up via a barcode or an id, or by searching the hierarchy. (Clients of the storelight app are expected to impose whatever restrictions are appropriate to their use case on what can be stored where.)

The application is written in Java 11 using Spring Boot.

Performing any mutation via the GraphQL schema requires a valid API key.

The API key can be supplied through a header with the name STORELIGHT-APIKEY. You can also supply a username which will be logged against the request, using the header STORELIGHT-USER. No verification is performed on the username.

(For convenience, you can also supply these values in the variables section of the GraphQL request.)

Database Setup:

  • Install MySQL via home-brew
  • Create a schema in your local mysql db called storelight
    • This can be done by running CREATE SCHEMA storelight DEFAULT CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci;
  • Create a storelight user to match the details in application.properties
    • This can be done by running
      create user 'storelight'@'%' identified by 'storelightpassword';
      grant delete, insert, execute, select, update on `storelight%`.* to 'storelight'@'%';
    
  • Using the storelight-sql repo, follow the sequence.txt file to create storelight tables and dummy data