first commit

This commit is contained in:
Beyhan Oğur
2026-04-26 21:37:58 +03:00
commit 8b1fbdee99
104 changed files with 23398 additions and 0 deletions

166
QUICKSTART.txt Normal file
View File

@@ -0,0 +1,166 @@
╔═══════════════════════════════════════════════════════════════════════╗
║ 🚀 GAuth-Central Quick Start ║
╚═══════════════════════════════════════════════════════════════════════╝
┌─────────────────────────────────────────────────────────────────────┐
│ 🎯 HIZLI BAŞLATMA │
└─────────────────────────────────────────────────────────────────────┘
Standalone Mode (Mevcut Sunucularla):
────────────────────────────────────────
$ ./start.sh
Docker Mode (Tüm Servisler):
────────────────────────────
$ ./start-with-docker.sh
Manuel:
───────
$ go run main.go
┌─────────────────────────────────────────────────────────────────────┐
│ 🌐 ERİŞİM NOKTALARI │
└─────────────────────────────────────────────────────────────────────┘
API: http://localhost:8080
Swagger: http://localhost:8080/docs/index.html
Frontend: http://localhost:3000 (CORS enabled)
┌─────────────────────────────────────────────────────────────────────┐
│ 🔧 MEVCUT YAPILANDIRMA │
└─────────────────────────────────────────────────────────────────────┘
PostgreSQL: 10.80.80.70:5432/go_gauth (user: cloud)
Redis: 10.80.80.70:6379 (user: default)
Backend: localhost:8080
┌─────────────────────────────────────────────────────────────────────┐
│ 🧪 TEST KOMUTLARI │
└─────────────────────────────────────────────────────────────────────┘
Sağlık Kontrolü:
────────────────
$ curl http://localhost:8080/
PostgreSQL Test:
────────────────
$ PGPASSWORD=gg7678290 psql -h 10.80.80.70 -U cloud \
-d go_gauth -c "SELECT 1;"
Redis Test:
───────────
$ redis-cli -h 10.80.80.70 -p 6379 -a gg7678290 \
--no-auth-warning PING
Kullanıcı Kaydı:
────────────────
$ curl -X POST http://localhost:8080/v1/auth/register \
-H "Content-Type: application/json" \
-d '{"email":"test@test.com","password":"Pass123!",
"user_name":"test"}'
┌─────────────────────────────────────────────────────────────────────┐
│ 📚 DOKÜMANTASYON │
└─────────────────────────────────────────────────────────────────────┘
README.md - Genel bilgiler ve özellikler
SETUP.md - Detaylı kurulum rehberi (4 seçenek)
DEPLOYMENT.md - Production deployment rehberi
QUICK_REFERENCE.md - Komutlar ve örnekler
CHANGELOG.md - Versiyon geçmişi
┌─────────────────────────────────────────────────────────────────────┐
│ ✨ ÖNE ÇIKAN ÖZELLİKLER │
└─────────────────────────────────────────────────────────────────────┘
✅ CORS yapılandırması (localhost:3000)
✅ Redis cache & session management
✅ Rate limiting (Login: 5/min, Register: 3/5min)
✅ JWT authentication
✅ OAuth2 (Google, GitHub)
✅ Email verification
✅ PostgreSQL + GORM
✅ Swagger documentation
✅ Docker support
┌─────────────────────────────────────────────────────────────────────┐
│ 🔐 GÜVENLİK ÖZELLİKLERİ │
└─────────────────────────────────────────────────────────────────────┘
• Bcrypt password hashing
• JWT token authentication
• Rate limiting (brute force protection)
• Token blacklist (logout)
• CORS policy
• Session management with Redis
┌─────────────────────────────────────────────────────────────────────┐
│ 📊 API ENDPOINTS │
└─────────────────────────────────────────────────────────────────────┘
POST /v1/auth/register - Kayıt (rate limited)
POST /v1/auth/login - Giriş (rate limited)
GET /v1/auth/verify-email - Email doğrulama
POST /v1/auth/refresh - Token yenileme
GET /v1/auth/me [Auth] - Kullanıcı bilgileri
GET /v1/auth/validate [Auth] - Token doğrulama
GET /v1/auth/:provider - OAuth (google/github)
┌─────────────────────────────────────────────────────────────────────┐
│ 🛠️ YARARLI KOMUTLAR │
└─────────────────────────────────────────────────────────────────────┘
Build: go build -o main .
Run: ./main
Dev Mode: go run main.go
Swagger Update: swag init -g main.go
Dependencies: go mod tidy
┌─────────────────────────────────────────────────────────────────────┐
│ 📦 SİSTEM GEREKSİNİMLERİ │
└─────────────────────────────────────────────────────────────────────┘
• Go 1.23+
• PostgreSQL 17+ erişimi (10.80.80.70:5432)
• Redis 7+ erişimi (10.80.80.70:6379)
• Network bağlantısı
┌─────────────────────────────────────────────────────────────────────┐
│ 🚨 SORUN GİDERME │
└─────────────────────────────────────────────────────────────────────┘
PostgreSQL bağlanamıyor:
────────────────────────
• .env dosyasında DB_URL kontrol edin
• Network erişimini test edin: telnet 10.80.80.70 5432
• Kullanıcı adı/şifre doğru mu kontrol edin
Redis bağlanamıyor:
──────────────────
• REDIS_URL doğru mu kontrol edin
• Network erişimi: telnet 10.80.80.70 6379
• Redis şifresini kontrol edin
CORS hatası:
────────────
• main.go'da AllowOrigins kontrol edin
• Frontend URL'i http://localhost:3000 mi?
Rate limit:
───────────
• api/middlewares/rate_limit_middleware.go'da
limit değerlerini artırın
┌─────────────────────────────────────────────────────────────────────┐
│ 📞 DAHA FAZLA BİLGİ │
└─────────────────────────────────────────────────────────────────────┘
Tüm detaylar için dokümantasyon dosyalarına bakın:
$ cat README.md
$ cat SETUP.md
$ cat DEPLOYMENT.md
╔═══════════════════════════════════════════════════════════════════════╗
║ 🎉 Başarılı çalışmalar! Sorularınız için dokümantasyona bakın. ║
╚═══════════════════════════════════════════════════════════════════════╝