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.
- 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
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
Users can create and delete different chat sessions, allowing them to organize conversations based on specific topics or purposes.
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.
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.
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