System Achitecture

     System Achitecture.png

Details

Explaination

This the graph for our system architecture, so the starting point for the structure is the hardware with sensor at the bottem left corner.
That is a hardware building using ESP 32 microcontroller with a pH sensor, temperature sensor, GSM/GPRS modules, GPS module on it which is the user going to place it inside the water to collect the data. It will start to collect the data once it is turn power on and will sending the data to pubnub via GPRS module every minutes.

The pubnub is act as a transfer station that accept the data from the sensor and sent it to our backend server which is hosting on AWS Elastic Beanstalk, and connected to AWS Relational Database System.

Then our we having a mobile application that help the user to do the river side sampling. It is act as a client side which able to interact with our backend server by using API call. It can perform the function like login authentication, getting insect list, getting river list, and also getting hardwaredata.

During the sampling process, if the user found that some of the insect they cannot recognize, they can take the image and sent it to our AI model server which is hosting on Google APP Engine.

After the sampling, the mobile application can save the sampling record to our backend server which also able to review it on mobile as well.

Then we also have a admin site that can perform Create, Read, Update, Delete function to our data in our database.

Finally we also have setup the CI/CD pipeline in our project using github action which will run a code system check and API check everytime the pull request is created for the backend server. And everytime the AqualityServer_Master branch is merged, it will deploy the new version to our AWS EB enviroment.

Technology Used

  • Hardware:
    • PH Sensor (H-101 pH Electrode)
    • Temperature Sensor (DS18B20)
    • Microcontroller (ESP32)
    • GSM/GPRS Module (SIM 800L)
    • GPS Module (Neo-6M)
  • App: React Native
  • Cloud: AWS, PubNub 
  • AI: Yolov3+LabelImg+Google Cloud Platform
  • Backend: Django + PostgreSQL
  • UI Testing: Appium + WebdriveIO
  • API Testing: Postman + newman + Github Actions

React Native

In this project, we use React Native to build our mobile application.

React Native is an open-source mobile application framework created by Facebook, Inc. It is used to develop applications for Android, iOS, and much more.

And we using React Native in our project because It provides a slick, smooth, and responsive user interface, while significantly reducing load time. It's also much faster and cheaper to build apps in React Native as opposed to building native ones, without the need to compromise on quality and functionality.

Django

In this project, we use Django to build our backend server and also our admin site.

Django is a high-level Python web framework that enables rapid development of secure and maintainable websites. Built by experienced developers, Django takes care of much of the hassle of web development, so we can focus on writing our app without needing to reinvent the wheel

ESP 32 Microcontroller

We use dsada

  • pH Sensor (H-101 pH Electrode)
  • Temperature Sensor (DS18B20)
  • Microcontroller (ESP32)
  • GSM/GPRS Module (SIM 800L)
  • GPS Module (Neo-6M)

AWS Elastic Beanstalk

In this project, we use AWS EB to host our backend server.

AWS Elastic Beanstalk is an easy-to-use service for deploying and scaling web applications and services developed with Java, .NET, PHP, Node.js, Python, Ruby, Go, and Docker on familiar servers such as Apache, Nginx, Passenger, and IIS.

And Using AWS EB, it as providing a AWS Relational Database and let us to store our data.

PostMan

postman.jpg.1

Postman is a collaboration platform for API development, it simplifies each step of building an API and streamline collaboration so it can create better APIs—faster.

 API (Application Programming Interface) is a computing interface which enables communication and data exchange between two separate software systems. API testing is a software testing type that validates Application Programming Interfaces (APIs). The purpose of API Testing is to check the functionality, reliability, performance, and security of the programming interfaces.

Postman also can be used in CI pipeline, here is the example about how to set to postman CI pip in GitHub Actions: 

GIthub CI/CD

github action.png.1

GitHub supports CI/CD natively through its feature GitHub Actions. With its easy YAML configuration, huge community support and fair pricing, it has become a solution of choice for automating tests and deployments in Continuous Integration pipelines.  More information please view the official documentation: Github Actions

Continuous integration (CI) is a software practice that requires frequently committing code to a shared repository. Committing code more often detects errors sooner and reduces the amount of code a developer needs to debug when finding the source of an error. Frequent code updates also make it easier to merge changes from different members of a software development team. This is great for developers, who can spend more time writing code and less time debugging errors or resolving merge conflicts.

Useful links: 

Building an Android CI Pipeline with GitHub Actions

GitHub Actions: End to end CI/CD Pipeline for Django

How to use GitHub Actions secrets to hide your tokens and passwords

Write Secrets to File in Github Action

new line for secret key in gtihub action

Automation Testing Tool —— Appium

Appium.png

Appium is an open-source test automation tool for use with native, hybrid and mobile web apps, it drives iOS, Android, and Windows apps using the WebDriver protocol. Setting up the Appium environment into the project is difficult, but it's easy to implement test scripts once it set up successfully.

YoloV3, LabelImg and Google Cloud Platform

You only look once, or YOLO, is one of the faster object detection algorithms out there. Though it is no longer the most accurate object detection algorithm, it is a very good choice when you need real-time detection, without loss of too much accuracy.

LabelImg is a free, open source tool for graphically labeling images. It's written in Python and uses QT for its graphical interface. It's an easy, free way to label a few hundred images to try out your next project.

Google colab: Colaboratory, or “Colab” for short, is a product from Google Research. Colab allows anybody to write and execute arbitrary python code through the browser, and is especially well suited to machine learning, data analysis and education.

Useful links:

YoloV3 - About YoloV3 and how it works

LabelImg - Instructions for use and installation  

Google Colab - Introduction to Google Colab with python

YOLOV3, LabelImg and GCP - Tutorial in using yolov3, LableImg along with Google Colab to create a custom AI Model