Skip to content

🤖 OpenAI GPT generator for storing mock users in Elasticsearch and show them in a React mentions style text box

License

Notifications You must be signed in to change notification settings

zejiran/openai-textbox-mentions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenAI Text Box Mentions

Index

Overview

OpenAI GPT generator for storing mock users in Elasticsearch and show them in a React mentions style text box.

Used Technologies

  • JavaScript.
  • NodeJS.
  • React.
  • OpenAI API.
  • Elasticsearch.
  • Render.
  • Vercel.

Usage

You can demo directly this project by going to this website or instead configure your own deployment as explained below.

Backend Initialization

  1. cd ./ai-user-generator.
  2. Create an environment file with the following variables:
    • OPENAI_API_KEY.
    • CLOUD_ID.
    • ELASTIC_USER.
    • ELASTIC_PASS.
    • HOST.
    • PORT.
  3. Install dependencies with npm install.
  4. Run NodeJS server with npm start.

Frontend Initialization

  1. cd ./user-mentions-dashboard.
  2. Configure server URL variable in src/App.js.
  3. Install dependencies with npm install.
  4. Run the app in the development mode with npm start.

Features

AI User Generator

You can go to https://<hostname>:<port>/generate/users for testing the creation of 25 users with GPT, split them into customers or employees, and then store these in a Elasticsearch index.

First, this would generate names and emails using OpenAI API.

OpenAI User Generation

Then store it in a Elasticsearch index.

Elasticsearch Storage

Users Endpoint

Go to https://<hostname>:<port>/users endpoint for obtaining the last 25 created users.

Get Users Endpoint

Go to https://<hostname>:<port>/users?searchTerm= for obtaining users according to a search term, send as a query param.

Search Term Endpoint

User Mentions Dashboard

In this dashboard you will find a generator button for creating 25 new users.

Generator Button

Here you can find two tables showing last customers and employees stored in Elasticsearch.

Last Generated Users

Finally, you will find a text box where you can mention users by name, typing '@'.

Mention by Name

When you click on a user from the list of match coincidences, their name will appear highlighted in the text box according to their role.

Highlight by Role

This text box also allows to search by email.

Mention by email

License

License

About

🤖 OpenAI GPT generator for storing mock users in Elasticsearch and show them in a React mentions style text box

Topics

Resources

License

Stars

Watchers

Forks