Integrating Google Firebase Firestore with ChatGPT API. The frontend

Raphael Almeida Araújo
3 min readMay 10, 2023

During the last weeks, I published posts talking about how to keep yourself no poor by consuming AI API services:

Today, I will introduce an app that utilizes the entirety of this infrastructure:

About the app

Do you like to play Uno, Mattel’s famous card game? If so, you’ll love discovering the new web and mobile application that lets you clear all your doubts about the rules, special cards, and the best strategies to beat your opponents.

The application is called ‘Guruduno’ (that’s right, it’s not ‘Uno’s Guru’) and it is an interactive platform where you can access several questions previously asked by other users and also have the option to ask new questions which are answered via integration with OpenAI’s ChatGPT, an artificial intelligence capable of generating coherent and relevant responses.

With ‘Guruduno’, you can learn more about the card game Uno, have fun with the curiosities and challenges proposed by ChatGPT, and even share your experiences and tips with other game fans. The app is free and available for all major web browsers and mobile operating systems.

This app was created as a proof of concept to test the feasibility of developing a question and answer system based on official documentation. This documentation is stored in a database that serves as a source for ChatGPT to interpret the user’s questions and respond according to the available information.

For example, you can use this application to create a chatbot that answers questions about a specific product or service, using the official product or service documentation as a source of information. Or you can use this application to create a chatbot that answers questions about a topic of general interest, using a database of articles or books on the topic as a source of information. Or you can use this app to create a chatbot that answers questions about a famous personality, using a database of biographies or interviews about the personality as the source of information.

This application aims to demonstrate the potential of ChatGPT to generate coherent and relevant responses from a structured and updated database. You can explore the different functionalities of the app and ask any questions you want. We hope you enjoy this experience and give us your feedback.

Tools

  • Listen to audio versions of questions and answers contributed by the public, available in a shared repository.
  • Use your voice to send your questions
  • Access to the official game rules

Used technologies

  • Google Firebase:
    Firestore: Store the real-time questions
    Hosting: Host the project assets
    Functions: After a new question is inserted on Firestore, there is a trigger to send the question data to the Render’s backend app.
  • Render: Host the Flask app to request answers from OpenAI API.
  • Ionic: Ionic React version to create the app’s screen and consume the Firestore data.
  • Pinecone: Store the embedding data generated by the ‘text-embedding-ada-002-v2’ model from OpenAI API.
  • OpenAI API (model ‘gpt3.5-turbo’): Answer the user questions.

--

--