Yapay zeka destekli duygu analizi ile gerçek zamanlı sohbet uygulaması. Mesajlar gerçek zamanlı olarak analiz edilerek duygusal ton (Pozitif, Negatif veya Nötr) makine öğrenimi kullanılarak tespit edilir.
- Özellikler
- Teknoloji Yığını
- Mimari
- Başlangıç
- Docker ile Çalıştırma
- API Dokümantasyonu
- Proje Yapısı
- Yayınlama
- Katkıda Bulunma
- Lisans
- 🔐 Basit Kullanıcı Kaydı - Rumuz tabanlı kimlik doğrulama
- 💬 Gerçek Zamanlı Mesajlaşma - Anında mesaj gönder ve al
- 🤖 AI Duygu Analizi - Otomatik duygu tespiti (Pozitif/Negatif/Nötr)
- 📊 Güven Skorları - AI'ın her analiz için ne kadar emin olduğunu görün
- 🎨 Modern Arayüz - Gradient arka planlarla responsive tasarım
- ⚡ Hızlı & Hafif - Performans için optimize edilmiş
- 🐳 Docker Desteği - Container'lar ile kolay yayınlama
- 🔄 Otomatik Yenileme - Mesajlar her 3 saniyede güncellenir
- React 18 - UI kütüphanesi
- Vite - Build aracı & geliştirme sunucusu
- Axios - HTTP istemcisi
- CSS3 - Gradient & animasyonlarla stil
- .NET Core 8 - Web API framework
- Entity Framework Core - ORM
- SQLite - Gömülü veritabanı
- ASP.NET Core - RESTful API
- Flask - Python web framework
- Transformers - Hugging Face kütüphanesi
- DistilBERT - Duygu analizi modeli
- PyTorch - Derin öğrenme framework
- Docker - Konteynerizasyon
- Docker Compose - Çoklu konteyner yönetimi
- Render - Backend & AI barındırma
- Vercel - Frontend barındırma
┌─────────────┐ HTTP ┌──────────────┐ HTTP ┌─────────────┐
│ │ ────────────> │ │ ────────────> │ │
│ React │ │ .NET Core │ │ Flask │
│ Frontend │ <──────────── │ Backend │ <──────────── │ AI Servisi │
│ │ JSON/REST │ │ JSON/REST │ │
└─────────────┘ └──────────────┘ └─────────────┘
│
│
▼
┌──────────────┐
│ SQLite │
│ Veritabanı │
└──────────────┘
İş Akışı:
- Kullanıcı React frontend üzerinden mesaj gönderir
- Frontend .NET Core API'yi çağırır
- Backend mesajı SQLite'a kaydeder
- Backend mesajı Flask AI servisine gönderir
- AI, DistilBERT modelini kullanarak duygu analizi yapar
- Duygu analizi sonucu veritabanına kaydedilir
- Frontend mesajı duygu etiketi ile gösterir
- Node.js 18+ ve npm
- .NET SDK 8.0+
- Python 3.10+
- Docker (opsiyonel)
- Git
git clone https://github.com/aakcay5656/chat-sentiment-app.git
cd chat-sentiment-app
cd ai-service
# Virtual environment oluştur
python -m venv venv
# Aktifleştir (Windows)
.\venv\Scripts\activate
# Aktifleştir (Linux/Mac)
source venv/bin/activate
# Bağımlılıkları yükle
pip install -r requirements.txt
# AI servisini çalıştır
python app.py
AI Servisi şu adreste çalışır: http://localhost:8000
cd backend/ChatSentimentApp
# Bağımlılıkları yükle
dotnet restore
# Backend'i çalıştır
dotnet run
Backend şu adreste çalışır: http://localhost:5058
cd frontend
# Bağımlılıkları yükle
npm install
# Geliştirme sunucusunu çalıştır
npm run dev
Frontend şu adreste çalışır: http://localhost:5173
Ziyaret edin: http://localhost:5173
# AI Servisini Build Et
cd ai-service
docker build -t chat-sentiment-ai .
docker run -p 8000:10000 -e PORT=10000 chat-sentiment-ai
# Backend'i Build Et
cd backend/ChatSentimentApp
docker build -t chat-sentiment-backend .
docker run -p 5000:10000 -e PORT=10000 -e AI_SERVICE_URL=http://localhost:8000/analyze chat-sentiment-backend
# Frontend'i Build Et
cd frontend
docker build --build-arg VITE_API_URL=http://localhost:5058/api/chat -t chat-sentiment-frontend .
docker run -p 3000:80 chat-sentiment-frontend
# Tüm servisleri çalıştır
docker-compose up
# Arka planda çalıştır
docker-compose up -d
# Tüm servisleri durdur
docker-compose down
Erişim: http://localhost:3000
http://localhost:5058/api/chat
POST /api/chat/register
Content-Type: application/json
{
"username": "ahmet"
}
Cevap:
{
"id": 1,
"username": "ahmet",
"createdAt": "2025-10-09T12:00:00Z"
}
POST /api/chat/messages
Content-Type: application/json
{
"username": "ahmet",
"content": "Bu harika bir gün!"
}
Cevap:
{
"id": 1,
"username": "ahmet",
"content": "Bu harika bir gün!",
"sentiment": "POSITIVE",
"confidence": 0.9998,
"createdAt": "2025-10-09T12:00:00Z"
}
GET /api/chat/messages?limit=50
Cevap:
[
{
"id": 1,
"username": "ahmet",
"content": "Bu harika bir gün!",
"sentiment": "POSITIVE",
"confidence": 0.9998,
"createdAt": "2025-10-09T12:00:00Z"
}
]
POST /analyze
Content-Type: application/json
{
"text": "Bugün çok mutluyum!"
}
Cevap:
{
"sentiment": "POSITIVE",
"confidence": 0.9995
}
chat-sentiment-app/
├── frontend/ # React frontend
│ ├── src/
│ │ ├── App.jsx # Ana bileşen
│ │ ├── App.css # Stiller
│ │ └── services/
│ │ └── api.js # API çağrıları
│ ├── Dockerfile
│ ├── nginx.conf
│ └── package.json
│
├── backend/ # .NET Core backend
│ └── ChatSentimentApp/
│ ├── Controllers/
│ │ └── ChatController.cs
│ ├── Data/
│ │ └── ChatDbContext.cs
│ ├── Models/
│ │ └── Message.cs
│ ├── Program.cs
│ ├── Dockerfile
│ └── ChatSentimentApp.csproj
│
├── ai-service/ # Python AI servisi
│ ├── app.py # Flask API
│ ├── requirements.txt
│ └── Dockerfile
│
├── docker-compose.yml # Çoklu konteyner kurulumu
└── README.md # Bu dosya
- Kodu GitHub'a push edin
- Render'da yeni Web Service oluşturun
- Repository seçin:
ai-service/ - Runtime: Docker
- Deploy edin
- Yeni Web Service oluşturun
- Repository seçin:
backend/ChatSentimentApp/ - Runtime: Docker
- Environment variable ekleyin:
AI_SERVICE_URL:https://ai-servisiniz.onrender.com/analyze
- Deploy edin
cd frontend
npm install -g vercel
vercel login
vercel --prod
Veya GitHub deposunu Vercel dashboard'una bağlayın.
Katkılar memnuniyetle karşılanır! Lütfen şu adımları izleyin:
- Projeyi fork edin
- Feature branch'inizi oluşturun (
git checkout -b feature/HarikaOzellik) - Değişikliklerinizi commit edin (
git commit -m 'Harika özellik eklendi') - Branch'inizi push edin (
git push origin feature/HarikaOzellik) - Pull Request açın
Bu proje MIT Lisansı altında lisanslanmıştır
- Hugging Face Transformers - NLP kütüphanesi
- DistilBERT - Duygu analizi modeli
- Microsoft .NET - Backend framework
- React - Frontend kütüphanesi
- Render - Hosting platformu
- Ücretsiz seviye kısıtlamaları: Render servisleri 15 dakika aktivite olmadığında uyuyabilir
- İlk istek: AI servisi ilk istekte 30-60 saniye sürebilir (model yükleme)
- Veritabanı: Basitlik için SQLite kullanılmıştır; production için PostgreSQL düşünün
- Güvenlik: Production kullanımı için authentication ve rate limiting ekleyin