RESEARCH

Project Research

Sampling applications haven been widely utilized in various areas, serving for various organisations included IFRC. From our research, there are already many sampling tool which could be applied in different scenarios, where we can learn plenty of design ideas and technical solutions. In this portfolios, we would introduce two of them which are representative:


1. ENA Software

ENA (Emergency Nutrition Assessment) software is a user-friendly analytical program recommended by SMART. It has automated functions for sample size calculations, sample selection, quality checks, standardization for anthropometry measurements, and report generation with automatic analyses. ENA is highly favoured by field practitioners; it facilitates survey planning, data collection, analysis and reporting with the ability to generate automatic standard tables and graphs for anthropometric indices and plausibility check reports.

Advantage

        1. Includes 3 common sampling methods

        2. Includes sample size calculator alongside sampling planning

Disadvantage

        1. Use case for nutrition cluster only, cannot use for general population

        2. Doesn't explain or guide users through the planning steps

        3. Too complex, especially for newbies



2. SurveyMonkey Sampling Calculator

The SurveyMonkey Sampling Calculator is a free tool that helps survey creators determine the appropriate sample size for their surveys. It takes into account user inputs such as confidence level, margin of error, and population size to generate recommended sample sizes. This tool is a valuable resource for ensuring accurate and reliable survey results.

Advantage

        1. Simple user interface, only 3 data entry points

        2. Online, no tools necessary

        3. Easy to see how inputs change the results

Disadvantage

        1. Only works if user has a complete list of their population (eg., marketing campaign)

        1. No ability to contextualise purpose of survey

        2. Done from marketing research in resource-rich environment

        3. So simple that it can be harmful (no explaination of the limitation of the result)



3. Raosoft

Raosoft is a free online tool that helps users calculate the sample size for basic surveys. It is similar to SurveyMonkey as in that it uses the same formula to calculate sample size, therefore also the same sampling methodology. However, Raosoft has some additional functionality where users can see the effect of changing the confidence level and margin of error by looking at 'Alternate Scenarios'.

Advantage

        1. Takes into account non-response rate

        2. 'Alternate Scenarios' where users can see the effect of margin of error and confidence level

        3. Provides detailed content and example scenarios

Disadvantage

        1. Outdated and difficult-to-use user interface

        2. Lack of guidance for certain input fields

        3. Only covers one sampling method when users have a complete list of their population


Technology Research

As stated on the Requirements page, a significant part of our project is focused on the extendibility of the tool. This is to make it as easy as possible for the IFRC GO development team to embed and extend our tool and API. As a result, we were specific in our technology choices and aligned our design solutions to the one of IFRC GO whenever possible. The IFRC GO technology stack consists of React, Django, PostgreSQL and finally Azure for deployment.

General

Before requirements became clear we did look at alternative frontend libraries and frameworks. First, we considered Bootstrap as it is famous for its wide range of pre-designed UI styles. However, Bootstrap can be difficult to customise and it is very rarely if ever, used in a real-world production environment. Our second candidate was Material UI, which integrates seamlessly with React, is fully flexible and customisable and many modern applications use it. MUI would have been the ideal UI framework to use, but by this point, we became familiar with the IFRC GO technology stack and the IFRC GO User Library.

React

React follows a component-based architecture, which means if we use that, when developing the sampling tool, we can break down our UI into small, reusable components. This makes it easier to manage and maintain our codebase, as well as reuse code across different parts of our sampling application.


IFRC Go User Library


IFRC Go User Library is a collection of reusable user interface components and patterns that have been specifically designed for use in applications built on the IFRC Go platform[1]. The library helped us create a more consistent, reusable, accessible, and well-supported user interface. Also worth mentioning, this portfolio is also designed according to the IFRC Go User Library.

Python

Because for the API we decided to use the Django REST API framework it also made sense to use Python for our sampling size calculations. This way we can have all of our backend code and functionality in one place and well-integrated.

Typescript

For the front end, we could have simply used JavaScript. But because our tool will quickly change hands after the project is over, we decided to use a combination of Typescript and JavaScript. We’re predominantly using Typescript due to its strict type system and its maintainability aspects [2]. It is much easier for a new developer to come in and read and understand Typescript code, rather than just vanilla JavaScript.

PostgreSQL

In order to separate the logic of the sampling tool from the frontend we also had to set up a database that would store questions and their options. When combined, these make up the decision tree that is displayed on the frontend. See the ‘Implementation’ page for more info on the purpose and use of the database. The decision to go forward with PostgreSQL was two folded. First, Microsoft Azure has a cloud service called Microsoft PostgreSQL server that lets developers instantiate a fully maintained and ready-to-use SQL database in minutes. Second, the IFRC development team uses PostgreSQL on their backend which makes database migration really quick and simple.

Also, PostgreSQL is highly customizable and can be integrated with a variety of programming languages and tools. This can be useful when developing a sampling tool that needs to be tailored to the specific needs of a particular user or organization [3]. Additionally, PostgreSQL provides powerful querying and analytical tools which can become a significant advantage when our tool is developed futher, in more complex ways.

Django

Before deciding on Django and the Django REST framework as our backend technology, we also looked into Flask. Flask is a lightweight framework for Python that can establish connections and communicate with the frontend just like Django. But again, the fact that Django is used a lot more widely in production, plus the IFRC GO platform has a dedicated Django API, made our decision easy.

Microsoft Azure

Last but not least, we had to find a platform to deploy and host our application. At the risk of repeating ourselves, IFRC has been a long-time user of Microsoft Azure. Consequently, Azure was the first cloud provider we looked into. It turned out to be the right fit for us because of two cloud services that do exactly what we needed. Firstly, the Microsoft Azure PostgreSQL server is perfect for setting up an easily maintainable and scalable SQL database. Secondly, Azure App Service let us deploy our Django REST API for free and with seamless integration of the SQL database.


Cypress

Cypress is a popular end-to-end testing framework for web applications, including React apps. More reason why we choose it would be listed in the Testing part, here is only a brief introduction.

Pytest

Pytest is a popular choice for backend testing due to its simplicity, flexibility, compatibility, rich set of features, integration with other tools, and active community support. It offers a simple and intuitive syntax, supports various testing styles, and integrates easily with other backend development tools. Pytest can help ensure the quality and reliability of your backend code, making it a valuable tool for any backend developer. More reason why we choose it would be listed in the Testing part, here is only a brief introduction.

Technical Decisions

Having researched multiple technologies for each "functionality" we settled with the well-known fullstack combination of React and Django. The remaining parts of the sampling tool and API centre around these two technologies and, of course the fact that we are staying consistent with IFRC GO's stack.

Functionality Technology
Frontend Framework React
Frontend Languages TypeScript, JavaScript, SCSS
Frontend Deployment Vercel
API Framework Django REST Framework
API Host Azure App Service
Backend Logic Python
Database PostgreSQL
Database Server Azure PostgreSQL Server
Backend Deployment Microsoft Azure

References:

[1] The IFRC Go User Library Github Repository at: https://github.com/IFRCGo/go-user-library [Accessed 18 March 2023]

[2] B. Garcia and R. Vega, "TypeScript: JavaScript Development at Application Scale," in IEEE Software, vol. 36, no. 5, pp. 50-56, Sept.-Oct. 2019, doi: 10.1109/MS.2019.2922269.

[3] M. Stonebraker, A. Pavlo, A. Rasin, and S. Zdonik, "The End of an Architectural Era (It's Time for a Complete Rewrite)," in Proceedings of the 33rd International Conference on Very Large Data Bases, Vienna, Austria, 2007, pp. 1150-1160.