Skip to content

andommar/character_bot

Repository files navigation

🧠 AI Character Chat App (Frontend)

A fun, interactive chat interface built with React and Vite, allowing users to:

  • Talk to AI-powered characters like Tony Stark or Cleopatra
  • Choose different AI models (GPT-3.5, GPT-4, Claude, etc.) via OpenRouter
  • Listen to responses with voice output (TTS)
  • See which models are free
  • Save chat history locally

πŸš€ Features

  • πŸ§™β€β™‚οΈ Chat with AI Characters – Select from a growing list of fictional or historical personas
  • 🧠 Model Selector – Choose from GPT, Claude, Mistral, and more through OpenRouter
  • 🟒 Free Model Flags – Instantly see which models cost $0
  • πŸ–ΌοΈ Model Logos – Logos next to model names for a cleaner UX
  • πŸ”Š TTS Output – Read AI replies aloud with voice selection
  • πŸ’Ύ Chat History – Automatically stored in localStorage for persistent sessions

🧱 Tech Stack

  • React + Vite – For a lightning-fast frontend
  • OpenRouter API – To connect to various LLMs
  • Web Speech API – For text-to-speech support
  • TailwindCSS – Clean and modern UI
  • LocalStorage – To persist chat history

πŸ—‚οΈ Project Structure

src/
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ ChatWindow.jsx        # Chat interface and layout
β”‚   β”œβ”€β”€ ModelSelector.jsx     # Dropdown for choosing LLM
β”‚   β”œβ”€β”€ VoiceSelector.jsx     # Dropdown for TTS voices
β”‚   β”œβ”€β”€ MessageBubble.jsx     # Styles user and AI messages
β”œβ”€β”€ lib/
β”‚   └── openai.js             # Handles fetch requests to OpenRouter API
β”œβ”€β”€ utils/
β”‚   └── localStorage.js       # Save/load chat history
β”œβ”€β”€ App.jsx                   # Main component
└── main.jsx                  # App entry point

πŸ”§ Getting Started

1. Clone the repo

git clone https://github.com/your-username/ai-character-chat.git
cd ai-character-chat

2. Install dependencies

npm install

3. Set up environment variables

Create a .env file in the root:

VITE_OPENROUTER_API_KEY=your_openrouter_key_here

βœ… You can use many models for free β€” no credit card needed for OpenRouter.

4. Run the app

npm run dev

πŸ’‘ Ideas for Future Features

  • πŸ” User login + backend storage
  • 🎭 Custom character creator
  • πŸ“€ Share or export conversations
  • 🎨 Light/Dark themes
  • 🧩 Plugin or tool integrations (memory, file access, etc.)

πŸ™Œ Credits


πŸ“œ License

MIT β€” free to use, adapt, and remix.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published