A modern, responsive AI chatbot powered by HackClub's AI API. Clean interface, persistent chat sessions, and no backend required - perfect for static hosting.
- 🤖 AI-Powered Chat - Real-time conversations with HackClub's AI
- 📂 Multiple Sessions - Create and manage separate chat conversations
- 🎨 Dark/Light Themes - Toggle between beautiful themes
- 💾 Auto-Save - Chat history persists across browser sessions
- 📱 Responsive Design - Works perfectly on desktop and mobile
- 📥 Export Chats - Download conversations as JSON or text
- ⌨️ Keyboard Shortcuts - Efficient navigation and controls
- 🔒 Privacy-First - All data stored locally in your browser
- Get a free API key from HackClub AI Dashboard
- Create a
.envfile in the project root:VITE_HACK_CLUB_API_KEY=your_api_key_here - The app will prompt for your API key on first use if not found in
.env
- Download the project files
- Add your API key to
.envor be ready to enter it when prompted - Double-click
index.htmlto open in your browser - Start chatting!
# Using Python
python -m http.server 8000
# Using Node.js
npx http-server
# Then visit http://localhost:8000- Fork this repository
- Add your API key as a GitHub Secret (if using automated deployment)
- Enable GitHub Pages in Settings
- Your chatbot will be live at
https://yourusername.github.io/repository-name - Note: You'll be prompted to enter your API key on first use
- Type messages and press Enter to send
- Use Shift+Enter for new lines
- Hover over AI messages to copy them
- Click 🗑️ to clear the current chat
- Click ➕ to create a new chat session
- Click 📁 to toggle the sessions sidebar
- Switch between sessions by clicking on them
- Each session saves automatically
- Click 🌙/☀️ to switch between dark/light themes
- Click 📥 to export your chat history
- Choose JSON (with metadata) or TXT (readable) format
- Ctrl/Cmd+L - Focus message input
- Escape - Clear current input
- Enter - Send message
- Shift+Enter - New line
Web-based-AI-ChatBot/
├── index.html # Main application
├── style.css # Styling and themes
├── script.js # JavaScript functionality
├── app.py # Optional Flask backend (unused)
└── README.md # This guide
Edit the API call in script.js (in sendMessage() function):
const response = await fetch('https://ai.hackclub.com/proxy/v1/chat/completions', {
method: 'POST',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
model: 'qwen/qwen3-32b', // Can change to other available models
messages: [{role: 'user', content: message}],
// Optional: Add custom parameters:
// temperature: 0.7,
// max_tokens: 150
})
});The app uses Bearer token authentication with the Hack Club AI API:
- API Key is read from
.envfile (environment variableVITE_HACK_CLUB_API_KEY) - Falls back to
localStorageif available - Prompts user if neither is found
- Stores in
localStorageafter first entry for convenience
Check HackClub AI Models for available models. Current default: qwen/qwen3-32b
Update CSS variables in style.css:
:root {
--primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
--chat-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}| Issue | Solution |
|---|---|
| AI not responding | Check internet connection, try refreshing |
| Chat history not saving | Enable localStorage, exit private browsing |
| Layout issues | Use modern browser, clear cache |
| Theme not switching | Check console for errors, clear site data |
| Browser | Version | Status |
|---|---|---|
| Chrome | 60+ | ✅ Supported |
| Firefox | 60+ | ✅ Supported |
| Safari | 12+ | ✅ Supported |
| Edge | 79+ | ✅ Supported |
MIT License - see LICENSE file for details.
Made with ❤️ by Aslesh Sura | Powered by HackClub AI