"Childhood Illness Search Engine" is a cross-platform app built with Flutter that allows users to search for potential illnesses by inputting a description of their symptoms. The app is divided into two parts: a frontend built with Flutter and a backend built with the Python framework Flask. It is designed to help parents and caregivers quickly identify potential health issues in children and seek medical attention if necessary. The app is a valuable resource for those looking to quickly and accurately diagnose and treat illnesses in young children.
Clone or download the source code from the repository.
Install the appropriate Docker application for your operating system.
NOTE: Make sure that Docker is allotted at least 4GiB of memory. In Docker Desktop, you configure resource usage on the Advanced tab in Preference (macOS) or Settings (Windows).
Obtaining Elasticsearch for Docker is as simple as issuing a docker pull command against the Elastic Docker registry.
$ docker pull docker.elastic.co/elasticsearch/elasticsearch:8.5.0
The following commands start a single-node Elasticsearch cluster for development or testing.
- Create a new docker network for Elasticsearch
$ docker network create elastic
- Start Elasticsearch in Docker. A password is generated for the elastic user and output to the terminal.
$ docker run --name es01 --net elastic -p 9200:9200 -p 9300:9300 -it docker.elastic.co/elasticsearch/elasticsearch:8.5.0
-
Copy the generated password token and save them in a secure location. These values are shown only when you start Elasticsearch for the first time.
-
Copy the
http_ca.crt
security certificate from your Docker container to your local machine.
$ docker cp es01:/usr/share/elasticsearch/config/certs/http_ca.crt .
NOTE: Do remember the path you copy http_ca.crt
from this step because it will copy file to the current path.
You can check the current path by using pwd
and ls
to see that http_ca.crt
is in this path.
$ pwd
/Users/cheesecake
$ ls
Applications Library Public nltk_data
Desktop Movies StudioProjects sketchybarrc
Documents Music zshrc
Downloads Pictures http_ca.crt
IdeaProjects Postman
- Open a new terminal and verify that you can connect to your Elasticsearch cluster by making an authenticated call, using the
http_ca.crt
file that you copied from your Docker container. Enter the password for the elastic user when prompted.
curl --cacert http_ca.crt -u elastic https://localhost:9200
It should show some result like following image if it work correctly.
- Make server folder to be virtual environment (venv). Make sure that that current path is root of repo
$ pwd
/path/to/GitHub/Childhood-Illness-Search-Engine
$ ls
README.md client design server
# if you don't already have virtualenv installed
$ pip install virtualenv
$ virtualenv server
- Access server path. Install all requirements
$ cd server
$ pwd
/path/to/GitHub/Childhood-Illness-Search-Engine/server
$ source bin/activate
$ pip install -r requirements.txt
- Access to app folder, create
.env
file in /app/.env to store elastic password and ca certificate path.
$ cd app
$ pwd
/path/to/GitHub/Childhood-Illness-Search-Engine/server/app
$ touch .env
- Edit
.env
file. You can use any text editor to open and it. Insert the following text.
# Password for the 'elastic' user generated by Elasticsearch
# NOTE: Don't forget to change to be compatible with your environemnt
ELASTIC_PASSWORD = "password_of_elastic"
CA_CERTS_PATH = "~/http_ca.crt"
NOTE 1: Please make sure that you are running elasticsearch by instruction provided above. See Start Elasticsearch Server
NOTE 2: Do not forget to replace password_of_elastic
to be current password. The password can be found in terminal running elasticsearch. For example, based on image below, the password is *TxugNZbdv2s*MUzScX-
The final file of .env
will be look like this:
# Password for the 'elastic' user generated by Elasticsearch
# NOTE: Don't forget to change to be compatible with your environemnt
ELASTIC_PASSWORD = "*TxugNZbdv2s*MUzScX-"
CA_CERTS_PATH = "~/http_ca.crt"
- Access back to server folder.
$ cd ..
$ pwd
/path/to/GitHub/Childhood-Illness-Search-Engine/server
- Run in local device
python3 app/app.py
or
python app/app.py
- (Optional) Run [local] in development mode. This step require to install nodejs and nodemon package.
nodemon --exec python3 app/app.py
Use Kibana to test and visualize the data in the Elasticsearch server
Kibana enables you to easily send requests to Elasticsearch and analyze, visualize, and manage data interactively.
- In a new terminal session, start Kibana and connect it to your Elasticsearch container:
docker pull docker.elastic.co/kibana/kibana:8.5.0
docker run --name kibana --net elastic -p 5601:5601 docker.elastic.co/kibana/kibana:8.5.0
When you start Kibana, a unique URL is output to your terminal.
- To access Kibana, open the generated URL in your browser.
-
Paste the enrollment token that you copied when starting Elasticsearch and click the button to connect your Kibana instance with Elasticsearch.
-
Log in to Kibana as the elastic user with the password that was generated when you started Elasticsearch.
- Start the Elasticserver and backend server as described in previous section.
- Start the app by using Android Studio or Visual Studio Code.
- When the app is successfully run on any platform, user can search the list of potential illnesses by inserting the symptoms as a input in search box.
- When click search icon, the system will return the list of illnesses in a second.
- User can directly reedit the input to start searching again or click X icon to remove all string input.
When the backend server is started, it performs the following actions:
- Normalizes the data from the provided CSV files using Nltk.
- Loads the normalized data into Elasticsearch.
- Listens for client input in the form of a symptom description string in frontend part.
- Normalizes the input using Nltk.
- Searches Elasticsearch for a match based on the normalized input.
- Returns a list of potential illnesses and their associated symptoms as an API.
- the frontend receives data via an API and display to the client.
We would like to acknowledge the following resources and libraries that were used in the development of this project:
Flutter: A mobile app development framework used for the frontend of the app. Flask: A Python framework used for the backend of the app. Elasticsearch: A search engine used to index and search the data in our database. Nltk: A library for natural language processing used to parse and analyze user input. Pandas: A library for data manipulation and analysis used to process and clean the data in our database.
We used data from the following external source to populate our database:
Nidirect: the website containing illnesses information that we extracted and formatted into a CSV file for use in the app.
We would also like to extend our gratitude to the following individuals who contributed to this project:
This project would not have been possible without the support and guidance of these resources and individuals. Thank you!