A cloned version of ChatGPT website written in JavaScript. Using OpenAI API to interact with OpenAI model.
- Authentication via Discord OAuth2
- Display mathematical notation from GPT response with LaTeX markup
- Highlight code segment from GPT response and enclose in code block
- Interact with OpenAI GPT model using API
- Remember login by session cookies using KV
- Remove image in prompt by clicking on corresponding image
- Save & Load chat history using D1 database
- Upload image in prompt by Ctrl+V to utilize GPT-4 vision capabilities
- Button for deleting chat history
- Button for removing uploaded image in prompt
- Button for uploading image instead of Ctrl+V only
- Better UI design
- Logout button
- Responsive Web Design (Especially for mobile users)
git clone https://github.com/yinkiu602/ChatGPT-clone-Cloudflare-Page.git
Clone thie repository and create a page application on Cloudflare website by importing the cloned repo.
Create the required KV namespace and D1 table on Cloudflare.
- All chat history will be automatically saved to database if the user is logged in.
{
"_id": "${random_chat_id_here}",
"userId": "${user_id}",
"title": "${title of the conversation}",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "${user prompt}"
}
]
},
{
"role": "assistant",
"content": "${response from GPT}"
}
],
"modified": ${Unix timestamp of last modification}
}