An open API service indexing awesome lists of open source software.

https://github.com/renato-milano/reacttemplateai

An open-source customizable React (using Vite) App skeleton for an AI-powered chatbot utilizing GroqCloudAPI for AI inference.
https://github.com/renato-milano/reacttemplateai

ai generative-ai groq-ai react vite

Last synced: 8 months ago
JSON representation

An open-source customizable React (using Vite) App skeleton for an AI-powered chatbot utilizing GroqCloudAPI for AI inference.

Awesome Lists containing this project

README

          

# AI Chatbot with Groq - React App Skeleton

This repository contains a skeleton for a React-based (using Vite) AI chatbot application using Groq. It provides a minimal yet extensible structure to build a chatbot UI and integrate it with Groq's API for AI-powered conversations.

## Personal Customization Example


Chatbot Preview 1
Chatbot Preview 2

## Features
- React-based UI
- API integration with Groq
- Modular structure for easy extension
- Basic state management
- Responsive design

## Prerequisites
Before you begin, ensure you have the following:
- [Node.js](https://nodejs.org/) (Latest LTS recommended)
- [npm](https://www.npmjs.com/) or [yarn](https://yarnpkg.com/)
- A Groq API key

## Installation
Clone the repository and install dependencies:
```sh
git clone https://github.com/renato-milano/ReactTemplateAI.git
cd ReactTemplateAI
npm install # or yarn install
```

## Configuration
Basically you have two options
#### Option. 1
Create a `.env` file in the root directory and add your Groq API key:
```
REACT_APP_GROQ_API_KEY=your-api-key-here
```
#### Option. 2 (not raccomanded)
Hardcode your Groq API key in `.lib/AI.js`:
```
const client = new Groq({ apiKey: 'INSERT-YOUR-API-KEY', dangerouslyAllowBrowser: true });
```

## Customization
Make sure to edit those simple parameters in `.src/pages/Chat.jsx` to give your AI a first basic customization
```
const SystemPrompt = "YOUR SISTEM PROMPT HERE";
const AvatarAI ="THE PATH OR URL OF THE AVATAR YOU WANT TO USE FOR YOUR AI";
const AssistantName = "THE NAME OF YOUR AI ASSISTANT";
```

## Running the App
Start the development server:
```sh
npm run dev # or yarn start
```
This will launch the app on `http://localhost:5173/`.

## Project Structure
```
.
├── src
│ ├── components # Reusable UI components
│ ├── lib # API call handlers
│ ├── pages # Main application pages
│ ├── App.jsx # Root component
| ├── App.css # CSS document for root
| ├── index.css # CSS document for entry point
│ └── main.jsx # Entry point
├── public # Static assets
├── package.json # Project dependencies
└── README.md # Project documentation
```

## Deployment
To build the app for production:
```sh
npm run build # or yarn build
```
Deploy the `build/` folder to your preferred hosting provider (e.g., Vercel, Netlify, or Firebase Hosting).

## Contributing
Feel free to fork this repository, submit issues, or contribute improvements via pull requests.

## License
This project is licensed under the [MIT License](LICENSE).

## Contact
For any inquiries or suggestions, open an issue or reach out via GitHub.

---
Enjoy building your AI chatbot! 🚀