Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Yevhenbk/pharmchat

Repository files navigation

Pharmchat

Overview

Pharmchat is a Next.js project designed to facilitate communication between users and a chatbot-like system aimed at providing information about pharmaceutical drugs. The project incorporates features such as authentication using Kinde, creating and deleting different chat sessions, querying information from the FDA drugs API, and an AI-powered chat feature called "Ask AI" which runs solely on the client-side. (Due to recent changes in Hugging Face's hosting and plan requirements, I switched from Open Assistant AI model to GPT2, that may not work or respond as expected unless you have a paid Inference Endpoint or the model is available for free API inference. This limitation is outside of my control =)

Technologies Used

  • Next 14: A React framework for building server-side rendered (SSR) applications
  • Prisma: A modern database toolkit for Node.js and TypeScript
  • Kinde: Authentication middleware
  • FDA Drugs API: Provides access to information about pharmaceutical drugs
  • Open Assistant AI: An AI model used for health-related queries within the "Ask AI" feature

Features

Authentication

Pharmchat implements user authentication using Kinde, ensuring secure access to chat functionalities:

  • getKindeServerSession() on the server
  • useKindeBrowserClient() on the client
  • isAuthenticated method for securing routes

Chat Sessions

Users can create and delete different chat sessions, allowing them to organize conversations based on specific topics or purposes.

FDA Drugs API Integration

The application enables users to request information about pharmaceutical drugs from the FDA Drugs API. Queries are processed instantly, providing users with relevant and accurate information.

Ask AI

Pharmchat includes a separate chat feature called "Ask AI," which is always present and runs exclusively on the client-side. This feature utilizes the Open Assistant AI model to answer health-related questions posed by users. The conversations in this mode are not saved, ensuring privacy and data security.

Setup Instructions

To start the app run this command inside the project

npm install #install the dependencies
npm run dev #runs the app in the development mode

npx prisma migrate dev #create and apply migrations
npx prisma generate #generate prisma client

Project Preview

Home View

About

Pharmaceutical chatbot app built with Next.js, Open Assistant AI, Kinde Auth, FDA drugs API and Prisma.

Topics

Resources

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages