feat(faz3): implement file upload with Cloudflare R2

- Add AWS SDK for S3-compatible R2 storage
- Create R2 client with presigned URL support
- Add attachment upload/download/delete API routes
- Create FileUpload and AttachmentList components
- Integrate file upload in message form (new & edit)
- Add .env.example with R2 configuration
This commit is contained in:
Yusuf İpek
2025-12-24 15:26:55 +03:00
parent 1626106a8b
commit 70d246bc17
10 changed files with 2078 additions and 14 deletions
+15 -6
View File
@@ -1,16 +1,25 @@
# Active Context - Dead Man Switch 2.0
## Şu Anki Durum
Proje planlaması tamamlandı, teknoloji stack'i belirlendi.
Faz 1 ve Faz 2 tamamlandı. Mesaj CRUD sistemi çalışıyor, dark mode aktif.
## Son Yapılan Değişiklikler
- Message, Recipient modelleri ve Prisma migration eklendi
- Mesaj API route'ları (GET, POST, PATCH, DELETE)
- IDOR güvenlik açığı düzeltildi (PATCH'te ownership doğrulaması)
- Dashboard ve mesaj sayfaları (liste, yeni, detay)
- UI bileşenleri (card, input, label, textarea)
- Dark mode aktifleştirildi
- NextAuth session'a user id typing eklendi
## Aktif Kararlar
- Next.js 16 + App Router kullanılacak
- Client-side encryption zorunlu değil, opsiyonel
- İlk fazda temel MVP hedefleniyor
- Next.js 15 + App Router kullanılıyor
- shadcn/ui + Tailwind dark mode
- Client-side encryption opsiyonel
## Sonraki Adım
Faz 1: Proje kurulumu ve Auth sistemi
Faz 3: Cloudflare R2 ile dosya yükleme
## Notlar
- IDOR fix: recipient silme işleminden önce mesaj sahipliği doğrulanıyor
- Şifreleme UX'i kritik - kullanıcı şifreyi kaybederse veri kurtarılamaz
- Check-in reminder email'leri düşünülmeli
+13 -8
View File
@@ -9,17 +9,19 @@
- [x] NextAuth.js entegrasyonu
- [x] User tablosu ve auth akışı
- [x] Temel layout ve routing
- [x] Dark mode aktifleştirildi
### Faz 2: Mesaj CRUD 🔲
- [ ] Message, Recipient, Attachment şemaları
- [ ] Mesaj oluşturma formu
- [ ] Mesaj listeleme/detay sayfaları
- [ ] Mesaj düzenleme/silme
### Faz 2: Mesaj CRUD
- [x] Message, Recipient, Attachment şemaları
- [x] Mesaj oluşturma formu
- [x] Mesaj listeleme/detay sayfaları
- [x] Mesaj düzenleme/silme
- [x] IDOR güvenlik açığı düzeltildi
### Faz 3: Dosya Yükleme (R2) 🔲
- [ ] Cloudflare R2 entegrasyonu
- [ ] Dosya upload/download API
- [ ] Dosya listeleme UI
- [x] Cloudflare R2 entegrasyonu
- [x] Dosya upload/download API
- [x] Dosya listeleme UI
### Faz 4: Client-side Encryption 🔲
- [ ] Web Crypto API wrapper
@@ -56,6 +58,9 @@
- ✅ Teknoloji stack seçimi
- ✅ Memory bank oluşturma
- ✅ Faz planlaması
- ✅ Faz 1: Auth sistemi
- ✅ Faz 2: Mesaj CRUD
- ✅ Faz 3: Dosya Yükleme (R2)
## Bilinen Sorunlar
(henüz yok)