Proje: Okul B2B App · Hub: Okul B2B App — Conventions

Naming ve Klasör Yapısı Konvansiyonları

Dosya ve Klasör Naming

TürKonvansiyonÖrnek
Ekranlar (app/)kebab-case.tsxleads.tsx, gallery.tsx
BileşenlerPascalCase.tsxLeadDetailModal.tsx
ServislerPascalCaseService.tsLeadsService.ts, AuthService.ts
Util fonksiyonlarPascalCase.tsApiClient.ts, Logger.ts
Context’lerPascalCaseContext.tsxCompanyContext.tsx
Hook’laruseCamelCase.tsuseForceUpdate.ts
ConstantsPascalCase.tsConfig.ts, ServiceConfig.ts
TypescamelCase.ts / kebabapi.ts, schoolContent.ts

Import Alias

@/ alias her yerde kullanılır:

import { apiClient } from '@/utils/ApiClient';
import { useCompany } from '@/contexts/CompanyContext';
import LeadsService from '@/services/LeadsService';

tsconfig.json’da baseUrl: "." ve paths: { "@/*": ["./*"] } tanımlı.

Platform-Specific Dosyalar

.ios.tsx ve .android.tsx uzantıları ile platform farkı:

  • PhotoViewModal.tsx (shared)
  • PhotoViewModal.android.tsx (Android-specific override)
  • IconSymbol.tsx (shared)
  • IconSymbol.ios.tsx (iOS-specific)
  • TabBarBackground.tsx / TabBarBackground.ios.tsx

Servis Export Pattern

Servisler static class olarak export edilir:

class LeadsService {
  static async getLeads(...): Promise<LeadsResponse> { ... }
  static async getLeadById(id: number): Promise<Lead | null> { ... }
}
export default LeadsService;

Singleton class:

class ApiClient {
  public static getInstance(): ApiClient { ... }
}
export const apiClient = ApiClient.getInstance();

Type Tanımları

  • Domain tipleri types/ klasöründe
  • Her domain’e özgü tip dosyası: types/api.ts, types/schoolContent.ts
  • Shared tiplere types/index.ts üzerinden erişilir

Türkçe Karakter Kuralı

Tüm kullanıcıya gösterilen metinler Türkçe karakterlerle yazılmalı: ı, ş, ö, ü, ç, ğ, İ. Kod içinde identifier’lar İngilizce kalır.