CatBot is a delightful AI-powered chatbot that streams cute cat images and facts in real-time! Built with OpenAI's Assistant API and TheCatAPI, you can chat with CatBot and ask for specific breeds, request multiple images, and enjoy a smooth, persistent conversation experience.
- 💬 Conversational Chat with OpenAI Assistant API (
gpt-4o-mini) - 📷 Cat Images on Demand – Powered by TheCatAPI
- 🐈⬛ Supports Specific Breeds – e.g., "Show me a Siamese cat"
- 🖼️ Multiple Image Support – Ask for more than one image!
- ⚡ Streaming Response Support – Instant typing feedback and incremental loading
- 💾 Persistent Threads using
localStorage(continue where you left off after refresh!)
- React.js
- Axios – For communicating with the backend
- CSS – For styling the chat interface
- localStorage – Stores
threadIdand messages for persistence
- Node.js
- Express.js – API routing
- dotenv – Securely manages environment variables (e.g., API keys)
- OpenAI Assistant API – Handles assistant logic and tool calling
- TheCatAPI – Source of all adorable cat images
- API Keys are stored safely in a
.envfile and never exposed to the frontend .gitignoreensures.envis never committed to Git
/backend
├── server.js # Express server
├── services/
│ └── assistantService.js # Handles chat, streaming, and tool calling
├── functions/
│ └── getCatImage.js # Fetches cat images from TheCatAPI
└── catbotPrompt.js # Custom assistant instructions
/frontend
├── components/
│ ├── ChatInput.js
│ └── ChatWindow.js
├── App.js
└── styles/
└── App.css, ChatWindow.css, ChatInput.css
- 🔄 Chat only scrolls to the start of new messages (not entire message)
- 🧱 Occasional weird spacing issues
- 📋 Bullet points may format incorrectly
cd backend
npm install
Create a `.env`:
OPENAI_API_KEY=sk-...
CAT_API_KEY=live_...
npm start
cd frontend
npm install
npm startThe app will be available at:
Frontend: http://localhost:3000
Backend: http://localhost:5001
- "Show me a cat"
- "Can I see 5 Persian cats?"
- "Tell me a fun cat fact"
Issues? Suggestions? Feature ideas? Open a GitHub issue or contact us!
Made by Brandon
Built for the incredible team at Nika.eco
🐱🌿 Inspiring change — one cheerful chat at a time.