A real-time chat application with AI-powered features, built with Svelte and Firebase.
-
Real-time Chat
- Instant message delivery
- User authentication with Google
- Message persistence across sessions
- Responsive design for mobile and desktop
-
AI Features
$joke
- Get contextual jokes based on chat history$summary
- Generate chat summaries&&
- Generate AI images from chat context using DALL-E 3- Random emoji reactions with witty comments
-
User Experience
- Dark/Light mode support
- Push notifications for new messages
- Full-screen background image on login
- Modern, responsive UI
-
Frontend
- Svelte/SvelteKit
- Firebase SDK
- OpenAI API
-
Backend Services
- Firebase Authentication
- Firebase Cloud Firestore
- Firebase Cloud Messaging
- Firebase Hosting
The application uses Firebase Cloud Firestore with secure rules:
- Authentication required for all operations
- Users can only modify their own messages
- Protected AI message handling
- Optimized indexes for efficient queries
- Clone the repository:
git clone https://github.com/peterkrueck/Kuhsengs-AI-Chat.git
cd kuhsengs-chat
- Install dependencies:
npm install
- Set up environment variables:
Create a
.env
file with your Firebase and OpenAI credentials:
VITE_FIREBASE_API_KEY=your_api_key
VITE_FIREBASE_AUTH_DOMAIN=your_auth_domain
VITE_FIREBASE_PROJECT_ID=your_project_id
VITE_FIREBASE_STORAGE_BUCKET=your_storage_bucket
VITE_FIREBASE_MESSAGING_SENDER_ID=your_messaging_sender_id
VITE_FIREBASE_APP_ID=your_app_id
VITE_OPENAI_API_KEY=your_openai_api_key
- Deploy Firestore Security Rules:
firebase deploy --only firestore:rules
- Deploy Firestore Indexes:
firebase deploy --only firestore:indexes
- Run the development server:
npm run dev
- Build for production:
npm run build
- Deploy to Firebase:
firebase deploy
kuhsengs-chat/
├── src/
│ ├── lib/
│ │ ├── components/
│ │ │ ├── Auth.svelte
│ │ │ ├── Chat.svelte
│ │ │ ├── Kuhilligence.svelte
│ │ │ └── Message.svelte
│ │ ├── services/
│ │ │ └── notifications.js
│ │ └── firebase.js
│ └── routes/
│ ├── +layout.svelte
│ └── +page.svelte
├── static/
│ ├── firebase-messaging-sw.js
│ └── notification-icon.svg
├── firestore.rules
├── firestore.indexes.json
└── firebase.json
The application implements several security measures:
- Firestore security rules to protect data
- Environment variables for sensitive data
- Authentication required for all operations
- Rate limiting for AI interactions
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.