first commit
This commit is contained in:
62
admin-panel/README.md
Normal file
62
admin-panel/README.md
Normal file
@@ -0,0 +1,62 @@
|
||||
# Web Admin Panel (MVP)
|
||||
|
||||
Bu klasor, mevcut Rust backend icin baslangic seviyesinde admin panel iskeletini icerir.
|
||||
|
||||
## Teknoloji
|
||||
|
||||
- React + TypeScript + Vite
|
||||
- React Router
|
||||
- TanStack Query
|
||||
- Zustand
|
||||
|
||||
## Klasorler
|
||||
|
||||
- `src/api` -> merkezi HTTP client ve endpoint wrapper
|
||||
- `src/components` -> layout, guard ve ortak state componentleri
|
||||
- `src/pages` -> login, dashboard, images, detail, health, settings
|
||||
- `src/stores` -> auth state
|
||||
- `src/types` -> API tipleri
|
||||
- `src/utils` -> token storage gibi yardimci fonksiyonlar
|
||||
|
||||
## Cevresel Degisken
|
||||
|
||||
`.env` dosyaniza su degeri ekleyin:
|
||||
|
||||
```bash
|
||||
VITE_API_BASE_URL=http://127.0.0.1:3000
|
||||
VITE_ENABLE_LOGS_POLLING=false
|
||||
VITE_LOGS_ENDPOINT=/api/v1/logs
|
||||
VITE_IMAGE_UPLOAD_TIMEOUT_MS=180000
|
||||
```
|
||||
|
||||
## Calistirma
|
||||
|
||||
```bash
|
||||
cd /home/beyhan/Projeler/Rust/Web/admin-panel
|
||||
npm install
|
||||
npm run dev
|
||||
```
|
||||
|
||||
## Mevcut Akis
|
||||
|
||||
- `/login` -> `/api/v1/auth/login` ile giris
|
||||
- 401 response -> otomatik refresh denemesi (`/api/v1/auth/refresh`)
|
||||
- refresh basarisiz -> session temizlenir, login'e yonlendirme
|
||||
- `/dashboard` -> `me` + image summary
|
||||
- `/images` -> backend destekli arama/format filtresi/pagination
|
||||
- `/images/:id` -> variant stream preview
|
||||
- `/logs` -> endpoint hazirsa polling ile log akisi (admin)
|
||||
|
||||
## Teknik Notlar
|
||||
|
||||
- Tum API cagrilari merkezi `src/api/http.ts` uzerinden gider.
|
||||
- Varsayilan request timeout degeri 12 saniyedir.
|
||||
- Image upload icin ayri timeout kullanilir (varsayilan 180 saniye).
|
||||
- 401 durumunda tekil refresh akisi calisir, basarisiz olursa session temizlenir.
|
||||
- `/logs` ve `/settings` admin role guard ile korunur.
|
||||
|
||||
## Notlar
|
||||
|
||||
- Bu ilk iterasyon MVP'dir; `/users` gibi ek admin ekranlari sonraki asamada eklenecek.
|
||||
- Token saklama su an localStorage uzerinden yapiliyor; production ortaminda backend cookie tabanli yaklasimla sertlestirilebilir.
|
||||
|
||||
Reference in New Issue
Block a user