A modern, responsive AI chatbot powered by HackClub's AI API. Clean interface, persistent chat sessions, and no backend required - perfect for static hosting.
๐ Try It Live!
- ๐ค 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