Modern, bulut tabanlı spor salonu yönetim platformu.
╔═══════════════════════════════════════════════════════════════════════════════╗
║ 🏋️ knowhygym Platform ║
║ ║
║ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ║
║ │ 👑 Admin │ │ 🏃 Trainer │ │ 👤 Member │ │ 📱 Mobile │ ║
║ │ Panel │ │ Panel │ │ Portal │ │ PWA │ ║
║ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘ ║
║ │ │ │ │ ║
║ └──────────────────┴──────────────────┴──────────────────┘ ║
║ │ ║
║ ┌──────────▼──────────┐ ║
║ │ 🌐 React Frontend │ ║
║ │ (Vite + TypeScript)│ ║
║ └──────────┬──────────┘ ║
║ │ REST API ║
║ ┌──────────▼──────────┐ ║
║ │ ⚡ Express Backend │ ║
║ │ (Node.js + JWT) │ ║
║ └──────────┬──────────┘ ║
║ ┌───────────────┼───────────────┐ ║
║ ┌─────▼─────┐ ┌─────▼─────┐ ┌─────▼─────┐ ║
║ │ 🐘 Postgres│ │ 🔴 Redis │ │ 📧 Email │ ║
║ │ Database │ │ Cache │ │ Service │ ║
║ └───────────┘ └───────────┘ └───────────┘ ║
╚═══════════════════════════════════════════════════════════════════════════════╝
- Üye Yönetimi: Üye kayıt, abonelik takibi, dondurma/iptal işlemleri
- Akıllı Rezervasyon: Ders rezervasyonu, bekleme listesi, otomatik bildirimler
- QR Kod Erişim: Dinamik QR kod ile güvenli giriş kontrolü
- Eğitmen Paneli: Ders yönetimi, katılımcı takibi
- Finans Modülü: Ödeme takibi, raporlama
- PWA Desteği: Mobil uygulama deneyimi
- Node.js + TypeScript
- Express.js
- PostgreSQL + Prisma ORM
- Redis + BullMQ (Kuyruk sistemi)
- JWT Authentication
- React 18 + TypeScript
- Vite
- TailwindCSS + Shadcn/UI
- React Query
- React Router
- Zustand (State Management)
- Node.js 18+
- Docker & Docker Compose
- PostgreSQL 15+
- Redis 7+
- Projeyi klonlayın
git clone https://github.com/knowhycodata/knowhy_gymos
cd knowhygym- Environment dosyalarını oluşturun
# Root
cp .env.example .env
# Server
cp server/.env.example server/.env
# Client
cp client/.env.example client/.env
# Gerekli değişkenleri düzenleyin (.env dosyalarındaki şifreleri değiştirin)- Docker ile başlatın
docker-compose up -d- Veritabanını hazırlayın
cd server
npm install
npx prisma generate
npx prisma migrate dev
npx prisma db seed- Frontend'i başlatın
cd client
npm install
npm run dev| Rol | E-posta | Şifre |
|---|---|---|
| Admin | admin@knowhygym.com | admin123 |
| Eğitmen | trainer1@knowhygym.com | trainer123 |
| Üye | member1@knowhygym.com | member123 |
POST /api/auth/register- KayıtPOST /api/auth/login- GirişPOST /api/auth/refresh-token- Token yenilemePOST /api/auth/logout- Çıkış
GET /api/users- Kullanıcı listesiGET /api/users/:id- Kullanıcı detayıPUT /api/users/:id- Kullanıcı güncelleme
GET /api/classes- Ders listesiPOST /api/classes- Ders oluşturmaGET /api/classes/schedule- Ders programı
POST /api/bookings- Rezervasyon oluşturmaDELETE /api/bookings/:id- Rezervasyon iptaliPOST /api/bookings/:id/check-in- Check-in
GET /api/access/qr- QR kod oluşturmaPOST /api/access/validate- QR kod doğrulama
knowhygym/
├── client/ # React Frontend
│ ├── src/
│ │ ├── components/ # UI bileşenleri
│ │ ├── pages/ # Sayfa bileşenleri
│ │ ├── layouts/ # Layout bileşenleri
│ │ ├── stores/ # Zustand stores
│ │ └── lib/ # Utility fonksiyonlar
│ └── ...
├── server/ # Node.js Backend
│ ├── src/
│ │ ├── controllers/ # Route handlers
│ │ ├── routes/ # API routes
│ │ ├── middleware/ # Express middleware
│ │ ├── services/ # Business logic
│ │ ├── queues/ # BullMQ workers
│ │ └── config/ # Configurations
│ └── prisma/ # Database schema
├── docker-compose.yml
└── README.md
┌─────────────────────────────────────────────────────────────────────────────┐
│ 🔐 Authentication Flow │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Client │ │ Server │ │ Database │ │
│ └────┬─────┘ └────┬─────┘ └────┬─────┘ │
│ │ │ │ │
│ │ POST /auth/login │ │ │
│ │ ─────────────────► │ │ │
│ │ {email, password} │ │ │
│ │ │ │ │
│ │ │ Find User │ │
│ │ │ ─────────────────► │ │
│ │ │ │ │
│ │ │ User Data │ │
│ │ │ ◄───────────────── │ │
│ │ │ │ │
│ │ │ ┌────────────────┐ │ │
│ │ │ │ Verify Password│ │ │
│ │ │ │ Generate JWT │ │ │
│ │ │ └────────────────┘ │ │
│ │ │ │ │
│ │ {accessToken, │ │ │
│ │ refreshToken, │ │ │
│ │ user} │ │ │
│ │ ◄───────────────── │ │ │
│ │ │ │ │
│ │ Store in Zustand │ │ │
│ │ & localStorage │ │ │
│ │ │ │ │
└─────────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────────────────┐
│ 👤 Membership Management Flow │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────┐ │
│ │ Yeni Üyelik │ │
│ │ Talebi │ │
│ └──────┬──────┘ │
│ │ │
│ ▼ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Üye │ │ Üyelik │ │ Ödeme │ │
│ │ Kaydı │────►│ Paketi │────►│ İşlemi │ │
│ │ │ │ Seçimi │ │ │ │
│ └─────────────┘ └─────────────┘ └──────┬──────┘ │
│ │ │
│ ▼ │
│ ┌─────────────┐ │
│ │ Üyelik │ │
│ │ Aktif │ │
│ └──────┬──────┘ │
│ │ │
│ ┌───────────────────┬──────────────────┼──────────────────┐ │
│ ▼ ▼ ▼ ▼ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌───────────┐ │
│ │ Dondurma │ │ Yenileme │ │ İptal │ │ Süre │ │
│ │ (Freeze) │ │ (Renew) │ │ (Cancel) │ │ Dolumu │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ └───────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────────────────┐
│ 📅 Class Booking Flow │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────┐ │
│ │ Üye │ │
│ └────┬─────┘ │
│ │ │
│ ▼ │
│ ┌─────────────┐ │
│ │ Ders Seçimi │ │
│ └──────┬──────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ Kapasite Kontrolü │ │
│ └─────────────────────────┬───────────────────────────┘ │
│ │ │
│ ┌──────────────┴──────────────┐ │
│ │ │ │
│ ▼ ▼ │
│ ┌─────────────────┐ ┌─────────────────┐ │
│ │ Yer Var ✅ │ │ Yer Yok ❌ │ │
│ └────────┬────────┘ └────────┬────────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌─────────────────┐ ┌─────────────────┐ │
│ │ Rezervasyon │ │ Bekleme │ │
│ │ Oluşturuldu │ │ Listesine Ekle │ │
│ └────────┬────────┘ └────────┬────────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌─────────────────┐ ┌─────────────────┐ │
│ │ 📧 Onay Email │ │ Yer açılınca │ │
│ │ 📱 Bildirim │ │ 📧 Bildirim │ │
│ └─────────────────┘ └─────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────────────────┐
│ 🔑 QR Code Access Flow │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────────────────────────────────────────────────────────┐ │
│ │ ÜYE TARAFINDA │ │
│ │ │ │
│ │ ┌──────────┐ ┌──────────┐ ┌──────────────────┐ │ │
│ │ │ Mobil │ │ QR │ │ Dinamik QR Kod │ │ │
│ │ │ App │─────►│ İste │─────►│ (5 dk geçerli) │ │ │
│ │ └──────────┘ └──────────┘ └──────────────────┘ │ │
│ │ │ │
│ └──────────────────────────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────────────────────────────────────────────────────────┐ │
│ │ SALON TARAFINDA │ │
│ │ │ │
│ │ ┌──────────┐ ┌──────────┐ ┌──────────────────┐ │ │
│ │ │ Tarayıcı│ │ QR Kod │ │ Doğrulama │ │ │
│ │ │ Cihaz │─────►│ Okuma │─────►│ Kontrolü │ │ │
│ │ └──────────┘ └──────────┘ └────────┬─────────┘ │ │
│ │ │ │ │
│ │ ┌──────────────────────┴───────────┐ │ │
│ │ │ │ │ │
│ │ ▼ ▼ │ │
│ │ ┌─────────────────┐ ┌─────────────────┐│ │
│ │ │ ✅ GİRİŞ OK │ │ ❌ GİRİŞ RED ││ │
│ │ │ Kapı Açılır │ │ Uyarı Verilir ││ │
│ │ │ Log Kaydı │ │ ││ │
│ │ └─────────────────┘ └─────────────────┘│ │
│ │ │ │
│ └──────────────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────────────────┐
│ 💰 Payroll Calculation Flow │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────────────────────────────────────────────────────────┐ │
│ │ AYLIK HESAPLAMA SÜRECİ │ │
│ └─────────────────────────────────────────────────────────────────┘ │
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Eğitmen │ │ Taban │ │ Ders │ │
│ │ Seçimi │────►│ Maaş │────►│ Sayısı │ │
│ └─────────────┘ └─────────────┘ └──────┬──────┘ │
│ │ │
│ ▼ │
│ ┌───────────────────────────────┐ │
│ │ HESAPLAMA FORMÜLÜ │ │
│ │ │ │
│ │ Toplam = Taban Maaş │ │
│ │ + (PT Seans × Oran) │ │
│ │ + (Grup Ders × Oran) │ │
│ │ + Bonus │ │
│ └───────────────┬───────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Bordro │ │ Onay │ │ Ödeme │ │
│ │ Kaydı │────►│ Bekliyor │────►│ Yapıldı │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────────────────┐
│ 🔔 Notification System Flow │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────────┐ │
│ │ Event Trigger │ │
│ └────────┬────────┘ │
│ │ │
│ ┌───────────────────────────┼───────────────────────────┐ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Üyelik │ │ Ders │ │ Ödeme │ │
│ │ Olayları │ │ Olayları │ │ Olayları │ │
│ └────┬─────┘ └────┬─────┘ └────┬─────┘ │
│ │ │ │ │
│ │ • Süre dolumu │ • Rezervasyon │ • Ödeme │
│ │ • Dondurma │ • İptal │ • Gecikme │
│ │ • Yenileme │ • Hatırlatma │ • Fatura │
│ │ │ • Bekleme listesi │ │
│ │ │ │ │
│ └─────────────────────────┼─────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌───────────────────────┐ │
│ │ Notification Queue │ │
│ │ (BullMQ) │ │
│ └───────────┬───────────┘ │
│ │ │
│ ┌─────────────────┼─────────────────┐ │
│ ▼ ▼ ▼ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ 📧 Email │ │ 📱 Push │ │ 💬 SMS │ │
│ └──────────┘ └──────────┘ └──────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────────────────┐
│ DATABASE SCHEMA │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌───────────────┐ ┌───────────────┐ ┌───────────────┐ │
│ │ User │ │ Profile │ │ Subscription │ │
│ ├───────────────┤ ├───────────────┤ ├───────────────┤ │
│ │ id │◄───────►│ userId │ │ userId │ │
│ │ email │ 1:1 │ firstName │ │ type │ │
│ │ password │ │ lastName │ │ startDate │ │
│ │ role │ │ phone │ │ endDate │ │
│ │ isActive │ │ dateOfBirth │ │ status │ │
│ └───────┬───────┘ │ baseSalary │ │ price │ │
│ │ └───────────────┘ └───────────────┘ │
│ │ │
│ │ 1:N │
│ ▼ │
│ ┌───────────────┐ ┌───────────────┐ ┌───────────────┐ │
│ │ ClassSession │◄───────►│ Booking │ │ Waitlist │ │
│ ├───────────────┤ 1:N ├───────────────┤ ├───────────────┤ │
│ │ name │ │ userId │ │ userId │ │
│ │ trainerId │ │ classId │ │ classId │ │
│ │ startTime │ │ status │ │ status │ │
│ │ duration │ │ checkedInAt │ │ position │ │
│ │ capacity │ └───────────────┘ └───────────────┘ │
│ │ status │ │
│ └───────────────┘ │
│ │
│ ┌───────────────┐ ┌───────────────┐ ┌───────────────┐ │
│ │ AccessLog │ │ Transaction │ │ TrainerPayout │ │
│ ├───────────────┤ ├───────────────┤ ├───────────────┤ │
│ │ userId │ │ userId │ │ trainerId │ │
│ │ type │ │ type │ │ month/year │ │
│ │ timestamp │ │ amount │ │ baseSalary │ │
│ │ success │ │ description │ │ totalAmount │ │
│ └───────────────┘ └───────────────┘ │ isPaid │ │
│ └───────────────┘ │
│ ┌───────────────┐ ┌───────────────┐ ┌───────────────┐ │
│ │ Product │ │ Notification │ │ Setting │ │
│ ├───────────────┤ ├───────────────┤ ├───────────────┤ │
│ │ name │ │ userId │ │ key │ │
│ │ price │ │ title │ │ value │ │
│ │ stock │ │ message │ │ description │ │
│ │ category │ │ isRead │ └───────────────┘ │
│ └───────────────┘ └───────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────────────────┐
│ ROLE-BASED ACCESS CONTROL (RBAC) │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ 👑 ADMIN │ │
│ │ ┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐ │ │
│ │ │ Üyeler │Eğitmenler│ Dersler │ Finans │ Raporlar│ Ayarlar │ │ │
│ │ │ ✅ │ ✅ │ ✅ │ ✅ │ ✅ │ ✅ │ │ │
│ │ └─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘ │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
│ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ 🏃 TRAINER │ │
│ │ ┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐ │ │
│ │ │ Üyeler │Eğitmenler│ Dersler │ Finans │ Raporlar│ Ayarlar │ │ │
│ │ │ ❌ │ ❌ │ Kendi ✅│ ❌ │ ❌ │ ❌ │ │ │
│ │ └─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘ │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
│ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ 👤 MEMBER │ │
│ │ ┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐ │ │
│ │ │ Profil │Rezervasyon│ Dersler │ Üyelik │ Ürünler │ QR Kod │ │ │
│ │ │ Kendi ✅│ Kendi ✅ │ Görüntü✅│ Kendi ✅│ Görüntü✅│ Kendi ✅│ │ │
│ │ └─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘ │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────────────────┐
│ TEST COVERAGE │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ API TESTLERI (103 Test) │ │
│ │ │ │
│ │ 👑 Admin Tests ████████████████████████████████████████ 35/35 │ │
│ │ 🏃 Trainer Tests ██████████████████ 10/10 │ │
│ │ 👤 Member Tests ██████████████████████████████ 19/19 │ │
│ │ 🔄 CRUD Tests ██████████████████████████████████████████ 39/39 │ │
│ │ │ │
│ │ Başarı Oranı: ████████████████████████████████████████ 100% │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
│ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ UI TESTLERI (25 Test) │ │
│ │ │ │
│ │ 🔐 Login Tests ████████████████ 4/4 │ │
│ │ 📊 Dashboard Tests ████████ 2/2 │ │
│ │ 👤 Member Management ████████████ 3/3 │ │
│ │ 🏃 Trainer Management ████████ 2/2 │ │
│ │ 📅 Class Management ████████ 2/2 │ │
│ │ 🛒 Product Management ████████ 2/2 │ │
│ │ ⚙️ Settings Tests ████████████ 3/3 │ │
│ │ 📈 Reports Tests ████████ 2/2 │ │
│ │ 💰 Payroll Tests ████████ 2/2 │ │
│ │ 📱 Responsive Tests ████████ 2/2 │ │
│ │ 🚪 Logout Test ████ 1/1 │ │
│ │ │ │
│ │ Başarı Oranı: ████████████████████████████████████████ 100% │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
│ │
│ Test Komutları: │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ cd tests │ │
│ │ npm run test:comprehensive # API Testleri │ │
│ │ npx playwright test # UI Testleri │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
Uretim ortami icin asagidaki degisiklikleri yapmayi unutmayin:
.envdosyalarindaki tum sifreleri guclu, rastgele degerlerle degistirinJWT_SECRETveJWT_REFRESH_SECRETicin en az 32 karakterlik rastgele string kullanin- PostgreSQL sifrelerini guclu tutun
- HTTPS kullanin
- CORS ayarlarini production domain'inize gore yapilandirin
Katkida bulunmak icin CONTRIBUTING.md dosyasina bakin.
Bu proje MIT lisansi ile lisanslanmistir. Detaylar icin LICENSE dosyasina bakin.

















