-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdoctr.html
More file actions
273 lines (245 loc) · 8.72 KB
/
doctr.html
File metadata and controls
273 lines (245 loc) · 8.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
<!DOCTYPE html>
<html lang="tr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Flutter MySQL Connect - Dokümantasyon</title>
<style>
body {
font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
line-height: 1.6;
max-width: 1000px;
margin: 0 auto;
padding: 20px;
color: #333;
}
pre {
background: #f5f5f5;
padding: 15px;
border-radius: 5px;
overflow-x: auto;
}
code {
background: #f5f5f5;
padding: 2px 5px;
border-radius: 3px;
}
h1, h2, h3 {
color: #2196F3;
}
.warning {
background: #fff3cd;
padding: 15px;
border-left: 4px solid #ffc107;
margin: 15px 0;
}
.info {
background: #cce5ff;
padding: 15px;
border-left: 4px solid #2196F3;
margin: 15px 0;
}
</style>
</head>
<body>
<h1>Flutter MySQL Connect</h1>
<p>Flutter ile MySQL veritabanı bağlantısı kullanan güvenli bir kimlik doğrulama uygulaması.</p>
<h2>📑 İçindekiler</h2>
<ul>
<li><a href="#ozellikler">Özellikler</a></li>
<li><a href="#kurulum">Kurulum</a></li>
<li><a href="#veritabani">Veritabanı Yapılandırması</a></li>
<li><a href="#auth">Kimlik Doğrulama Yapısı</a></li>
<li><a href="#tema">Tema Yapısı</a></li>
<li><a href="#dil">Dil Yönetimi</a></li>
<li><a href="#hata">Hata Yönetimi</a></li>
<li><a href="#guvenlik">Güvenlik</a></li>
<li><a href="#mimari">Mimari Yapı</a></li>
<li><a href="#klasor">Klasör Yapısı</a></li>
</ul>
<h2 id="ozellikler">✨ Özellikler</h2>
<ul>
<li>🔐 Güvenli MySQL bağlantısı</li>
<li>🔒 BCrypt ile şifre şifreleme</li>
<li>🌍 TR/EN dil desteği</li>
<li>🎨 Özelleştirilebilir tema</li>
<li>📱 Responsive tasarım</li>
<li>⚡ Performans optimizasyonu</li>
</ul>
<h2 id="kurulum">⚙️ Kurulum</h2>
<h3>Gereksinimler</h3>
<pre>
• Flutter SDK (>=3.2.3)
• MySQL Server
• MySQL Workbench (önerilen)</pre>
<h3>Adımlar</h3>
<ol>
<li>Projeyi klonlayın:
<pre>git clone https://github.com/RecLast/FlutterMysqlConnect.git</pre>
</li>
<li>Bağımlılıkları yükleyin:
<pre>flutter pub get</pre>
</li>
</ol>
<h2 id="veritabani">💾 Veritabanı Yapılandırması</h2>
<h3>1. Veritabanı Oluşturma</h3>
<pre>CREATE DATABASE flutter_mysql_connect;</pre>
<h3>2. Tablo Yapısı</h3>
<pre>
CREATE TABLE users (
id INT PRIMARY KEY AUTO_INCREMENT,
username VARCHAR(50) UNIQUE NOT NULL,
email VARCHAR(100) UNIQUE NOT NULL,
password VARCHAR(255) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);</pre>
<h3>3. Güvenli Bağlantı Yapılandırması</h3>
<p>MySQL bağlantı bilgilerini güvenli bir şekilde yapılandırmak için:</p>
<ol>
<li><code>lib/core/utils/config_generator.dart</code> dosyasını düzenleyin:
<pre>
final config = {
'host': 'localhost',
'port': '3306',
'user': 'your_username',
'password': 'your_password',
'db': 'your_database'
};</pre>
</li>
<li>Config generator'ı çalıştırın:
<pre>dart run lib/core/utils/config_generator.dart</pre>
</li>
<li>Oluşturulan şifreli config dosyası: <code>assets/config/db_config.enc</code></li>
</ol>
<div class="info">
<strong>🔐 Güvenlik:</strong> Bağlantı bilgileri XOR şifreleme ve SHA-256 ile korunmaktadır.
</div>
<h2 id="auth">🔑 Kimlik Doğrulama Yapısı</h2>
<p>Kimlik doğrulama sistemi <code>features/auth</code> altında MVVM mimarisi ile yapılandırılmıştır:</p>
<pre>
features/auth/
├── model/
│ └── user_model.dart # Kullanıcı veri modeli
├── view/
│ ├── sign_view.dart # Giriş/Kayıt ekranı
│ └── splash_view.dart # Başlangıç ekranı
└── viewmodel/
└── auth_view_model.dart # Kimlik doğrulama iş mantığı</pre>
<h3>Kimlik Doğrulama Akışı</h3>
<ol>
<li>Splash ekranında oturum kontrolü</li>
<li>Giriş/Kayıt formu validasyonu</li>
<li>BCrypt ile şifre hashleme</li>
<li>JWT token yönetimi</li>
</ol>
<h2 id="tema">🎨 Tema Yapısı</h2>
<p>Tema yönetimi <code>core/theme</code> altında merkezi olarak yapılandırılmıştır:</p>
<pre>
core/theme/
├── app_colors.dart # Renk paletleri
├── app_text_styles.dart # Tipografi stilleri
└── app_theme.dart # Tema yapılandırması</pre>
<div class="info">
<strong>💡 Özelleştirme:</strong> Tüm renkler ve stiller tek bir noktadan yönetilebilir.
</div>
<h3>Tema Kullanımı</h3>
<pre>
// Renk kullanımı
color: AppColors.darkBlue['primary']
// Metin stili kullanımı
style: AppTextStyles.ubuntuBold.copyWith(
fontSize: 24,
color: Colors.white,
)</pre>
<h2 id="dil">🌍 Dil Yönetimi</h2>
<p>Çoklu dil desteği <code>core/init/lang</code> altında yapılandırılmıştır:</p>
<pre>
core/init/lang/
├── locale_keys.dart # Dil anahtarları
├── locale_manager.dart # Dil yöneticisi
└── translations/ # Dil dosyaları
├── tr.json
└── en.json</pre>
<h3>Dil Kullanımı</h3>
<pre>
// Dil değiştirme
LocaleManager.instance.setLocale(const Locale('tr', 'TR'));
// Metin çevirisi
Text(LocaleKeys.welcome.tr())</pre>
<h2 id="hata">⚠️ Hata Yönetimi</h2>
<p>Merkezi hata yönetimi <code>core/base</code> altında yapılandırılmıştır:</p>
<pre>
core/base/
├── error/
│ ├── base_error.dart # Temel hata sınıfı
│ ├── network_error.dart # Ağ hataları
│ └── database_error.dart # Veritabanı hataları
└── result/
└── result_model.dart # Sonuç modeli</pre>
<h3>Hata Yönetimi Kullanımı</h3>
<pre>
try {
await operation();
} on NetworkError catch (e) {
showErrorDialog(e.message);
} on DatabaseError catch (e) {
logError(e);
showErrorSnackbar(e.message);
}</pre>
<div class="warning">
<strong>🔍 Hata Takibi:</strong> Tüm hatalar merkezi olarak loglanır ve kullanıcıya uygun mesajlar gösterilir.
</div>
<h2 id="guvenlik">🔒 Güvenlik</h2>
<h3>Şifreleme</h3>
<ul>
<li>BCrypt ile güvenli şifre hashleme</li>
<li>AES-256 ile hassas verilerin şifrelenmesi</li>
<li>SSL/TLS ile güvenli bağlantı</li>
</ul>
<h3>SQL Injection Koruması</h3>
<pre>
// Güvensiz Kullanım ❌
"SELECT * FROM users WHERE username = '$username'"
// Güvenli Kullanım ✅
"SELECT * FROM users WHERE username = ?"</pre>
<h2 id="mimari">🏗️ Mimari Yapı</h2>
<p>Proje MVVM (Model-View-ViewModel) mimarisi kullanılarak geliştirilmiştir:</p>
<ul>
<li><strong>Model:</strong> Veri yapıları ve veritabanı işlemleri</li>
<li><strong>View:</strong> UI bileşenleri</li>
<li><strong>ViewModel:</strong> İş mantığı ve durum yönetimi</li>
</ul>
<h2 id="klasor">📁 Klasör Yapısı</h2>
<pre>
lib/
├── core/
│ ├── init/
│ │ ├── database/ # MySQL bağlantı yönetimi
│ │ ├── encryption/ # Şifreleme servisleri
│ │ └── lang/ # Dil yönetimi
│ ├── services/ # Genel servisler
│ ├── theme/ # Tema yapılandırması
│ └── utils/ # Yardımcı araçlar
└── features/
├── auth/ # Kimlik doğrulama
│ ├── model/
│ ├── view/
│ └── viewmodel/
└── home/ # Ana sayfa
├── model/
├── view/
└── viewmodel/</pre>
<div class="info">
<strong>💡 İpucu:</strong> Detaylı kod örnekleri ve API dokümantasyonu için
<a href="https://github.com/RecLast/FlutterMysqlConnect/wiki">Wiki sayfamızı</a> ziyaret edin.
</div>
<h2>📞 İletişim</h2>
<p>
Sorularınız ve önerileriniz için:
<a href="mailto:by_reclast@hotmail.com">by_reclast@hotmail.com</a>
</p>
<footer style="margin-top: 50px; padding-top: 20px; border-top: 1px solid #eee; text-align: center;">
<p>© 2025 Flutter MySQL Connect <a href="www.umiteski.com.tr">Ümit Eski</a> Tarafından Geliştirilmiştir. MIT Lisansı altında lisanslanmıştır.</p>
</footer>
</body>
</html>