Sayfa şablonları
Hazır, çalışan Next.js (App Router) sayfaları. Yeni bir sayfa yazarken önce uygun şablonu kopyala ve uyarla; kütüphanenin doğru kullanımını (sunucu/istemci ayrımı, Form + sunucu eylemi, *Field, iskelet yükleme, mobil düzen) gösterirler. npx @yasinsensoy/web template <ad> dosyaları projede yerlerine kopyalar (src/app varsa oraya). Şablonlardaki ikon adlarını UIProvider icons ile kaydet ya da kendi adlarınla değiştir; adresleri (/panel, /giris) projene göre düzelt.
app-shell
App skeleton: the Sidebar main menu on the left, page content next to it. On desktop it collapses into an icon rail (⌘B / Ctrl+B) and remembers its state; on phones it becomes a bottom navigation bar. The user menu is at the bottom of the sidebar.
- It is a server component: menu items are written on the server and icons are given by name. The active page is marked automatically from the URL (the
@yasinsensoy/web/nextprovider wiresusePathname). - The
dashboardandsettingstemplates are written to sit inside this skeleton (/panel,/panel/settings). - Icon names used:
ev,grafik,sepet,kullanici,klasor,ayarlar,cikis,diger. Register them withUIProvider iconsor replace them with your own names.
Dosyalar
app/panel/layout.tsx
dashboard
Gösterge paneli (dashboard): özet kartları (KPI) ve küçük eğilim çizgileri, aylık gelir/gider grafiği, trafik kanalları halka grafiği, son siparişler tablosu ve etkinlik akışı.
- Sunucu bileşenidir: veri
data.ts'teki işlevlerden sunucuda okunur, tarayıcıya yalnızca etkileşimli parçalar (grafik, menü) gider. - Yüklenirken
loading.tsxaynı düzende iskelet gösterir; sayfa kaymaz. - Telefonda kartlar alt alta dizilir, tablo satırları karta dönüşür.
app-shellşablonunun içinde/paneladresinde çalışır; tek başına da kullanılabilir.- Kullanılan ikon adları:
indir,ekle,diger.
Dosyalar
app/panel/page.tsxapp/panel/data.tsapp/panel/loading.tsx
login
Sign-in page: a centered card, email + password, "Forgot password", social sign-in buttons and a two-step verification code (OTP).
- Works with a single server action (
actions.ts); the two steps change in the same card, the page does not reload. - Correct
autoCompletevalues are set for the browser's password manager and one-tap code filling; on Android the SMS code fills automatically via WebOTP, and the form submits itself when the code is complete. - Pressing and holding the eye at the end of the password field shows the password.
- Errors appear below the field and the first invalid field is focused.
- On phones the card is full width, and when the keyboard opens the field does not stay under it.
- Runs outside the panel layout, with its own layout (
app/login).
Dosyalar
app/login/page.tsxapp/login/actions.tsapp/login/login-form.tsx
settings
Settings page: Profile, Account, Notifications and Appearance tabs and a "Delete account" section.
- Each tab is a separate
Formand server action (actions.ts): validation happens in the browser (required,type,mask) and on the server, server errors are spread below the fields viaForm state, and success is announced withtoast. - The profile photo is picked with
FileFieldand cropped round withedit(MediaEditor). - Phone uses
mask="phone"; password fields reveal on press and hold. - The theme is changed with
useTheme+ThemeView; no flicker on first paint. - Deletion is confirmed with
await confirm(...); while deleting, the dialog's confirm button shows loading. - A tab can be linked to:
/panel/settings?tab=account. - Icon names used:
kullanici,kilit,zil,ayarlar.
Dosyalar
app/panel/settings/page.tsxapp/panel/settings/actions.tsapp/panel/settings/forms.tsx