Appendix

Navigation



1.1 Go to the deployed webpage at https://ifrc-ada.netlify.app.
You should be greeted with the home page like this:
home page of website
1.2 (Optional) Tools & Articles
Scrolling down further, you will see a list of technologies that we used, along with the articles we wrote to demystify the process
tools and articles of website
1.3 (Optional) Footer
Scrolling all the way to the bottom, you will see the footer with links to the project partners and relevant sections.

1.4 (Optional) Multilinguility
On top of the navbar, there is a language switcher that allows you to switch between English, Spanish or French.
language switcher in navbar
Note that the website and articles will be translated accordingly. However, for the sake of explanation, we will stick to English in this manual.

1.5 Logging In
To access the full functionality of the application, you will need to log in. Click on the "Log In" button on the top right corner.
logging in
1.6 Login Page
You will then be directed to the login page, where you can pick a variety of login methods, including the conventional email, Google or Microsoft login.
login page>
If you have no account, just register one by clicking on the "Sign Up" button.

1.7 Data Management System
You will first be directed towards the Chat page, however, I would like to draw your attention to the Data Management System first.
data management page
As can be seen, the data sources are tabulated already with the options to add, edit or even delete an entry.

editting entry form
1.8 Chat Page
Now, let's go back to the Chat page. Which is navigated via the navbar on top.
chat page
The design follows a very traditional chat application, with the chat history on the left and the chat input on the right.

User can view previous conversations and even delete them if they wish.
deleting chat
1.9 Prompting + Generation
Users can then prompt the chatbot with a question, and the chatbot will generate a response based on the data sources. Note that the average response time is around ~30seconds, as the chatbot is processing the data sources in real-time.
prompting chatbot
After the wait, the chatbot will stream the response to the user.

chatbot response
The response aims to be concise and informative, with the ability to view the sources used to the user. The system is built intending for the user to quickly gather social behavioural information while affirming the information via the sources provided.

This is a highly iterative process, where the user can ask follow-up questions or even ask for more information.

1.10 (Optional) Logging Out
Once you are satisfied with the information, you can log out by clicking on the "Log Out" button on the profile icon on the top right corner, which will redirect back to home.
logging out
1.11 Multilinguility v2
It is noted that the chatbot itself is natively multilingual and inheritly supports most of the most spoken languages in the world.
2.1 As mentioned in the user manual, the application is already deployed at https://ifrc-ada.netlify.app.
Hence, this will just be a guide of how to deploy the application using your own API keys.

2.2 Prerequisites
Our application uses a number of external services and APIs, which require the use of API keys for authentication. Before deploying the application, you will need to obtain API keys for the following services:

  • Firebase
  • Google Cloud and Custom Search Engine
  • Microsoft Azure Translator API
This manual assumes that you have already cloned the repository and gotten the necessary API keys (such as the Django secret key) from the handoff.

2.3 Frontend Environment Variables
From the handoff, you will have received access to the Netlify hosted frontend. In particular, this manual will cover updating the environment variables using the ui, however, note that other options are possible. This is the structure of the environment variables that you will need to update:
Please note the spelling of the variables as they are case-sensitive and won't work otherwise.

2.3.1 Firebase Variables
A firebase app can be setup by following the instructions here. It is noted that only the first portion till 1:08 is required for this. The rest is just additional knowledge.

What we really care about is the API key, auth domain, project id, storage bucket and messaging sender id.
                      
                        // Import the functions you need from the SDKs you need
                        import { initializeApp } from "firebase/app";
                        import { getAnalytics } from "firebase/analytics";
                        // TODO: Add SDKs for Firebase products that you want to use
                        // https://firebase.google.com/docs/web/setup#available-libraries

                        // Your web app's Firebase configuration
                        // For Firebase JS SDK v7.20.0 and later, measurementId is optional
                        const firebaseConfig = {
                          apiKey: "XXXXXXX",
                          authDomain: "XXXXXXX",
                          projectId: "XXXXXXXX",
                          storageBucket: "XXXXXXX",
                          messagingSenderId: "XXXXXXXX",
                          appId: "XXXXXXXXX",
                          measurementId: "XXXXXXXX"
                        };

                        // Initialize Firebase
                        const app = initializeApp(firebaseConfig);
                        const analytics = getAnalytics(app);
                      
                    
A visualize of the obfuscated variables that we care about. Using this information, you can update the environment variables accordingly. Note that the enabling of the authentication and firestore is required for the chatbot to work.

2.3.2 VITE_BACKEND_URL
This variable is basically the url of the backend server. In our case, it is the Django server that we have hosted on Azure. Again, given the hand off process, this should already be given to you.

2.4 Backend Environment Variables
For the Azure App service, you will need to update the environment variables in the Azure portal, see below:
Note that the variables of AZURE_POSTGRESQL_CONNECTIONSTRING, SCM_DO_BUILD_DURING_DEPLOYMENT, AZURE_APP_SERVICE_DOMAIN should already be populated, and no need to changed.

2.4.1 Google Keys
For our scraper, we leverage the google search terms to get the top results, this is done using Google's Programmable Search Engine. This is enabled here, and the API key and search engine id can be found in the control panel, it is noted that we didn't restrict any websites for the engine, as we do that in the backend itself.

A more detailed overview of the process can be found here. All that is left is to generate the API key and search engine id and update the environment variables accordingly.

2.4.2 CHROMA_COLLECTION_NAME
This variable dictates the collection name of the ChromaDB (vector database), which is used to store the vectors of the data sources. It can be randomly selected but should be hidden for security reasons.

2.4.3 OPENAI_API_KEY
This key should be obtained from yourself, and is used to access the GPT-3 API.

2.5 Contact
That should settle it in terms of the deployment process, if you have any questions, feel free to contact me at hao.pe.22@ucl.ac.uk.
4. Monthly Videos
Please find below the monthly videos tracking our progress. These comprehensive videos provide a detailed overview of our ongoing efforts and achievements, offering valuable insights into the evolution of our project. Click to delve deeper into the intricacies of our journey and gain a better understanding of the milestones we've reached.