Main Goal

Understand that Sparrow has a lot to offer labs without them building anything of their own. Sparrow is a developed a complex data infromatics application that allows lab's data to be accessible, shareable, and useable.

Overview

What is a tech stack?

A tech stack is a combination of programming languages, frameworks, and tools that developers use to build a web or mobile applcation.

What is included in Sparrow's tech stack?

Sparrow is made of 3 MAIN parts: the database, the Backend, and the frontend. There is a more in depth description of each further below however the basic technologies they are all based on are as follows:

Why should you care?

Software architecture is very important as each technology has its benefits and limitations. Although, it may seem more important for developers to understand, as users of the software it's important to understand the foundations that Sparrow is built upon.

Sparrow's tech stack was chosen with a data center philosophy. The technology utilized by Sparrow is designed to best fit with the complex relationships that exist in geologic data. These technologies also give Sparrow a sturdy foundation to grow and improve.

What do you get?

Lab's that utilize Sparrow will be recieving a complex infromatics system without needing to do any software development of their own. The only thing lab's need to concern themselves with are data importers. Sparrow provides a data structure system that allows labs to quickly access, present, and share their data through the user interface (frontend). Sparrow also provides the ability for labs to customize their own instance if they so choose.

Database:

The database is the starting point for Sparrow. This is where a lab's data is housed and where the data is structured into relational schemas.

The Sparrow databse is built using PostgreSQL. Postgres is a database system focusing on object relationships. The complex relationship structures that arise from geological data are easily mapped using PostgreSQL. Postgres is free and open source which has developed a giant community of support and resources around it making it one of they most robust systems available. Postgres is also designed to work efficiently with Postgis, a sql based system for dealing with spatially organized data, making it especially useful for the geosciences.

The developers at Sparrow generally work with the database by proxy through SQL and python queries, however the databases are directly accessed using third party PostgreSQL clients like Postico.

Backend

The Sparrow backend is the middle man between the database and the frontend. Through the backend data is transferred. The backend is written in mainly Python but utilizes powerful libraries for different aspects.

Sparrow utilizes the python library SQLAlchemy for backend - database interactions. SQLAlchemy allows for database tables and relationships to be mapped to python usable data structures. Using SQLAlchemy abstracts the actual SQL into easier to understand python and it leverages the ability python has with manipulating data.

The REST API (representational state transfer, application programming interface) is built using the Starlette API framework. The Sparrow API is how data is transfered from the database to the frontend. The API is accessable on every Sparrow instance and contains extensive documentation on available routes and filters for data. The API is also how edits and new data is transfered from frontend interactions to the database.

  • GET: Frontend asks the API to query the database.
  • PUT/POST: Frontend pushes edits or new data to the API for database insert.

Frontend

The frontend is the user facing side of the Sparrow application, the lab's website. Sparrow's frontend is built upon the lab's data in a way that exposes the hierarchical and sometimes complex data structures that arise.

General data model hierarchy:

  • Projects
  • Samples (sub-samples)
  • Session
  • Anaylsis
  • Datum

Furthermore, the frontend has evolved to be easier to use and easier to find, edit, or create new data models. Organizing data is also a main concern of the frontend and a recent feature allows users to add and create Tags to specific data models.

The Sparrow frontend is also used as documenting platform for data schemas. Components such as the API-Explorer and the Schema-Explorer are designed to aid labs in understanding the structure their data needs to be in to import into Sparrow.

The Sparrow frontend is written in TypeScript, a subset of JavaScript, using ReactJS. ReactJS is a powerful JavaScript library that has become synonymous with frontend development. It makes developing interactive user interfaces quicker and easier. For labs who wish to create custom frontend plugins, it's highly reccomended to make them using ReactJS. Another benefit of ReactJS is the ability to share components between projects. Sparrow utilizes the library UW-Macrostrat/UI-Components, a ReactJS component library made by the same developers of Sparrow. Sharing components cuts down on the amount of work and creates a developer community.