Skip to content

ryan-io/LabAutomata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

117 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

au·tom·a·ton/ôˈtämədən,ôˈtäməˌtän/ a machine that performs a function according to a predetermined set of coded instructions, especially one capable of a range of programmed responses to different circumstances

Lab Automata

A .NET application to automate laboratory data acquisiton (DAQ) and processing. Allows a laboratory to track equipment, work requests, test instances, calibrations, and personnel.

Report Bug · Request Feature

This project is a work in progress. The UI is simply a mock to demonstrate backend capabilities.

Screenshot 2024-09-02 173017


Table of Contents
  1. Overview
  2. Technical Stack
  3. Getting Started & Usage
  4. License
  5. Contact
  6. Acknowledgments

Overview

This passion project comes as the result of an 8 year professional career within an automotive qualification laboratory. The focus was on executing OEM product validation. During validations, an enormous amount of data is acquired: temperature, humidity, voltage input/output, software logging, and quiescient current to name a few. Any and all parameters needed to be collected and logged as data. The intent of this project is to provide a rather generic application for interfacing with your DAQ systems.

It is also a project to showcase a large breadth of software concepts - one of my goals is to make to make it all encompasing. Depth-wise, it is a bit shallow in areas. Overall, it has a front end GUI, backend systems, database communication, CI/CD pipelines, a Web API, Blynk IoT integration, and version control. Communciation between devices, HMI, and this application are primarily done via MQTT.

Circuit schematics were created with TinkerCad

Imgur

Tech Stack

  • Core
    • .NET 8 & C# 12
  • Solution
    • LabAutomata
      • The WPF project and entry point of the application
    • LabAutomata.Db
      • Contains an API for establishing database connections with Entity Framework Core
      • Models for your application would be defined here
    • LabAutomata.Library
      • Business logic and services are defined here
    • LabAutomata.Tests.Unit
      • A testing project for the LabAutomata project
    • LabAutomata.Wpf.Library
      • This project contains all view models and commands for use with MVVM
    • LabAutomata.Wpf.Tests.Unit
      • A testing project for the LabAutomata.Wpf.Library project
    • LabAutomata.Wap
      • Windows Application Packaging project for creating MSIX packages
    • LabAutomata.IoT
      • Project for handling the Internet of Things related logic
      • Implmenets MQTT.net for communicaiton with an ESP8266/ESP01 module
      • Communication is done via MQTT w/ C++ written in Arduino IDE
  • GUI
    • Windows Presentation Foundation (WPF)
    • Controls are made to be as modular and isolated as possible
  • Backend
    • MVVM architecture
    • Dependency Injection with Microsoft.Extensions.DependencyInjection
    • Entity Framework Core for interacting with a PostgreSQL database
    • ASP.NET Web Api tested and documented with Swagger
    • ScottPlot for a wonderful API wrapper for Matplotlib
  • Testing
    • xUnit
    • NSusbstitute
    • Fluent Assertions
  • Web API
    • ASP.NET Core Web API using MVC
    • Uses ErrorOr as a fluent discrimanted union package for an error or a result
  • Database
    • PostgreSQL along with pgAdmin4 for DB management
    • Mockaroo for populating a test/mock database with data
  • Logging
    • My own logging package that is a simple wrapper for SeriLog
    • Implements ILogger from the Microsoft.Extensions.Logging package
  • CI/CD
    • GitHub Actions
    • A workflow for new releases that uses tags to invoke this workflow
    • A workflow for running unit tests on all libraries when a push is made
  • Design Patterns
    • IoC
    • Repository
    • Command
    • Singleton
    • Builder
    • Factory
    • Iterator
    • Observer
    • Services
  • Miscellaneous
    • I implore SOLID principles with the caveat that I approach these principles more as guidelines or tools rather than strict rules. A core piece of software is maintainability and extensibility. With that said, there are time crunches where I need to get something release. Separation of concerns may not be the best, it could appear more as a jumble of code, or I fail to document a piece of code. These are perfect opportunties for me to go back through the SDLC and refactor code like this. It is an ever evolving process and you can very easily put yourself in a place where development of a piece of software never ceases to end.

Sensor & Arduino Setup

IMG_1937

IMG_1936

** TODO - Finalize TinkerCad circuit and upload **

Running Notes

  • LabAutomata.Library has dependency on LabAutomata.Db
  • LabAutomata has dependency on LabAutomata.Library & LabAutomata.Db

Creating entities

  1. Query a model factory -> this should return a discriminated union of ErrorOr that validates the entity was successfully created from the factory
  2. If ErroOr.IsError -> return an IActionResult of type error; let the consumer know there was a problem creating the entity within the controller (factory) call
  3. Pass this new entity into the servicer -> the service will depond on a respoitory of the same type; this will add the newly created/validated entity into your database
  4. The user service will propogate it's own list of ErrorOr
  5. In summary -> the controller needs to check ErrorOr from creating the model and the ErrorOr invoking the sercice to add it to a repostiory
  6. There is a documented example currently in the SsTempTestsController class

(back to top)

License

Distributed under the MIT License.

(back to top)

Contact

RyanIO

[Email]
[LinkedIn]
[GitHub]

(back to top)

Acknowledgments and Credit

(back to top)

About

*WIP* An application framework for managing laboratory, R&D, and IoT data acquisition. This is a prototype for specific systems of a larger production application.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors