This repository contains the source code for a chat bot application written primarily in TypeScript.
app
: Contains the application structure and global styles. This includes:favicon.ico
: Icon for the application.globals.css
: Global CSS styles.layout.tsx
: The main layout file.page.tsx
: The main page file.
components
: Contains the React components for the application. This includes:Header.tsx
: The header component.ai-chat
: A folder containing the chatbot-related components:Button.tsx
: Button component.Chat.tsx
: Main chat component.ChatLine.tsx
: Component for individual chat lines.
pages/api
: Contains server-side routes for the application. This includes:chat.ts
: API route for the chat functionality.
public
: Contains public assets for the application. This includes:logo.svg
: Logo for the application.next.svg
: Next.js logo.vercel.svg
: Vercel logo.
utils
: Contains utility files. This includes:OpenAIStream.ts
: Utility for streaming data from OpenAI.about.json
: JSON file containing metadata about the application.
Other files in the root directory are configuration files for tools such as ESLint, PostCSS, Tailwind CSS, and TypeScript.
To set up and run this project locally:
- Clone the repository to your local machine.
- Install the dependencies by running
npm install
. - Edit the
.env.example
to be.env.local
with your credentials - Edit the
/utils/about.json
with your desired contnent - Start the development server by running
npm run dev
.
Contributions are welcome. Please open an issue or submit a pull request.
This project is open source and available under the MIT License.