Bu sayfa heyirona'nın çalışan iskeletini özetler: stack, /build ve /toplanti mimarisi, state machine'leri, tüm API endpoint'leri, Postgres şeması, RLS deseni, env değişkenleri, anonimlik kuralı ve katkı süreci. Inora'yı çalıştırırken referans olarak açık tut.
Üretimde olan kütüphane sürümleri ve rolleri. package.json tek doğru kaynak; aşağıdakiler hızlı referans.
| Paket | Sürüm | Rol |
|---|---|---|
| Next.js | 16.x (Turbopack) | App Router, RSC, server actions, SSE stream'ler. |
| React | 19.x | Suspense, useTransition, ref-as-prop, async server component. |
| Tailwind CSS | v4 | Token-bazlı utility; CSS-first config (@theme). |
| Anthropic SDK | @anthropic-ai/sdk ^0.96 | Claude tabanlı ajan ürünü; iterate ve toplantı motoru. |
| Supabase | @supabase/ssr ^0.10 | Auth (telefon OTP + Google), Postgres, RLS, server-side cookie session. |
| Stripe | Checkout + webhook | Pro / Team abonelik; stripe_events ile idempotency. |
| DeepSeek | REST TTS | Toplantı sahnesinde ajan başına ses; /api/tts proxy üzerinden. |
| Vercel | Deploy API | /api/deploy üretilen projeyi Vercel'e push eder. |
İki ana akış: /build (kod üretim) ve /toplanti (council toplantısı). İkisi de SSE üzerinden ajan stream'i tüketir.
BuildClientV2 tek bir React state'i tutar. Kullanıcı brief'ini POST /api/iterate'e gönderir; sunucu Claude'dan gelen XML benzeri akışı FileStreamParser ile parse eder ve <file path=...> blokları SSE event olarak akıtılır. V2 leaf component'ler (BuildCenter, BuildChat, BuildSidebar...) salt sunum yapar; state mutasyonu yalnızca BuildClientV2 içinden geçer.
MeetingRoomV2 council toplantısını yönetir. POST /api/toplanti SSE üzerinden ajan turlarını yayınlar; istemci SAX-tarzı bir parser ile speaker/note callback'lerini chunk chunk işler. Konuşma bitince ilgili ajan için /api/tts çağrılır ve per-agent ses dosyası AgentTile altında oynatılır.
Hem /build hem /toplanti faz tabanlı (discriminated union). Phase değişimi her zaman tek bir reducer noktasından geçer.
src/components/build/types.ts
src/components/toplanti/types.ts
Tüm rotalar src/app/api altında. auth kolonu: public = anon, auth = Supabase session, webhook = imza doğrulamalı.
| Method | Path | Auth | Not |
|---|---|---|---|
| POST | /api/iterate | auth | Multi-variant, image input ve priorTurns destekli ana akış endpoint'i. |
| POST | /api/iterate/variants | auth | Aynı brief için paralel varyant üretimi (BuildVariantStrip). |
| POST | /api/iterate/inline-edit | auth | Editor içinden seçili bloğa noktasal düzenleme. |
| POST | /api/iterate/explain | auth | Üretilen kodu doğal dilde açıklar (BuildExplainCode). |
| GET / POST | /api/projects | auth | Kullanıcının projelerini listele veya yeni proje aç. |
| GET / PATCH / DELETE | /api/projects/[id] | auth | Tek proje oku, başlık/dosya güncelle, sil. |
| GET / POST | /api/projects/[id]/iterations | auth | Proje için iteration listesi ve yeni snapshot. |
| GET | /api/projects/[id]/export | auth | Projeyi JSZip ile paketler; tarayıcıya ZIP olarak akıtır. |
| GET / POST / DELETE | /api/cloud-data | auth | Bundled Cloud KV. Iframe içindeki window.cloud SDK postMessage bridge ile bu endpoint'i çağırır. 256 KB değer/limit. |
| POST | /api/projects/import | auth | Daha önce dışa aktarılan ZIP'i geri yükler. |
| GET | /api/projects/search | auth | Başlık / prompt üzerinde tam-metin arama. |
| POST | /api/projects/fork | auth | Başka bir projeyi (kendi veya paylaşılan) çatallar. |
| POST | /api/toplanti | auth | SSE; council turlarını chunked olarak akıtır. |
| POST | /api/toplanti/save | auth | Toplantı transcript'ini iteration olarak kalıcılaştırır. |
| POST | /api/tts | auth | ElevenLabs proxy; per-agent ses üretir. |
| POST | /api/deploy | auth | Vercel Deploy API'sine push; deployment id döner. |
| GET | /api/deploy/status/[id] | auth | Deployment progress polling. |
| GET / POST / DELETE | /api/share | auth | Sahibin oluşturduğu paylaşım slug'larını yönetir. |
| GET | /api/share/[slug] | public | Anonim ziyaretçi paylaşılan projeye read-only erişir. |
| POST | /api/billing/checkout | auth | Stripe Checkout session açar (Pro / Team price). |
| POST | /api/billing/webhook | webhook | Stripe imza doğrular; stripe_events tablosu ile idempotent işler. |
| POST | /api/github/sync | auth | Üretilen projeyi GitHub repo'suna senkron eder. |
| POST / GET | /api/whatsapp/webhook | webhook | GET verify_token, POST imza doğrulamalı mesaj alımı. |
| GET | /api/whatsapp/status | auth | Bağlı WhatsApp numarası ve son aktivite durumu. |
| POST | /api/auth/phone-otp/request | public | Telefon numarasına OTP gönderir (rate-limit + IP_SALT_SECRET). |
| POST | /api/auth/phone-otp/verify | public | OTP'yi doğrular ve Supabase session cookie kurar. |
| GET / PATCH | /api/me | auth | Mevcut kullanıcı profili (plan, email, tercihler). |
| POST | /api/contact | public | İletişim formu; CONTACT_EMAIL_WEBHOOK'a iletir. |
| GET | /api/health | public | Liveness ucu; HEALTH_TOKEN varsa header zorunlu. |
5 tablo, hepsi RLS açık. Migration dosyaları supabase/migrations/ altında, sırayla 0001 → 0003.
| Tablo | Kolonlar | Not |
|---|---|---|
| profiles | id (auth.users), email, plan (free|pro|team), created_at | Her auth user için 1 satır; trigger ile otomatik açılır. |
| projects | id, owner_id, title, prompt, files (jsonb), created_at, updated_at | Tüm üretilen dosya ağacı files kolonunda saklanır. |
| iterations | id, project_id, prompt, files (jsonb), created_at | Proje başına tarihçe; her iterate turu yeni satır. |
| shares | slug (pk), project_id, created_by, created_at, revoked_at, view_count | Anonim okuma için public read-only policy. |
| stripe_events | id (pk = event.id), type, received_at, processed_at, processing_error | Webhook idempotency ledger; sadece service role yazar. |
| cloud_data | id, owner_id, project_id, collection, key, value (jsonb), created_at, updated_at | Bundled Cloud KV — üretilen uygulamalar window.cloud ile yazıp okur. unique (owner, project, collection, key). |
supabase/migrations/0001_init.sql · 0002_shares.sql · 0003_stripe_events.sql · 0004_share_grants.sql · 0005_project_metadata.sql · 0006_agent_metrics.sql · 0007_cloud_data.sql
Tüm kullanıcı verisi sahibine kilitli. Service-role anahtarı sadece webhook'larda kullanılır; RLS'i bypass edebildiği için hiçbir route handler'a sızdırılmaz.
Desen tüm tablolarda aynı: enable row level security + her CRUD action için ayrı policy. projects tablosunun policy seti tipik bir örnektir:
-- select using (auth.uid() = owner_id) -- insert with check (auth.uid() = owner_id) -- update using (auth.uid() = owner_id) with check (auth.uid() = owner_id) -- delete using (auth.uid() = owner_id)
.env.local içinde tutulur; Vercel'de Project Settings → Environment Variables üzerinden yansıtılır. Zorunlu olanlar olmadan üretim build'i ayağa kalkmaz.
| Anahtar | Zorunlu | Not |
|---|---|---|
| ANTHROPIC_API_KEY | zorunlu | Claude ajan motoru. |
| NEXT_PUBLIC_SUPABASE_URL | zorunlu | Browser + server tarafı Supabase URL. |
| NEXT_PUBLIC_SUPABASE_ANON_KEY | zorunlu | Anon istemci anahtarı. |
| SUPABASE_SERVICE_ROLE_KEY | zorunlu | Webhook + bypass RLS gerektiren server işleri. |
| NEXT_PUBLIC_BASE_URL | zorunlu | Canonical site URL (canonical, OG, redirect). |
| STRIPE_SECRET_KEY | opsiyonel | Billing açık değilse boş bırakılabilir. |
| STRIPE_WEBHOOK_SECRET | opsiyonel | /api/billing/webhook imzası. |
| STRIPE_PRICE_ID_PRO | opsiyonel | Pro plan price id. |
| STRIPE_PRICE_ID_TEAM | opsiyonel | Team plan price id. |
| ELEVENLABS_API_KEY | opsiyonel | Toplantı sesi; yoksa toplantı sessiz çalışır. |
| VERCEL_TOKEN | opsiyonel | /api/deploy için gerekli. |
| VERCEL_TEAM_ID | opsiyonel | Team scope deploy ediliyorsa. |
| VERCEL_PROJECT_PREFIX | opsiyonel | Üretilen proje adlarına prefix. |
| GITHUB_APP_ID | opsiyonel | GitHub App entegrasyonu. |
| GITHUB_APP_TOKEN | opsiyonel | App seviyesi token. |
| GITHUB_CLIENT_ID | opsiyonel | OAuth akışı. |
| GITHUB_CLIENT_SECRET | opsiyonel | OAuth secret. |
| GITHUB_TOKEN | opsiyonel | PAT yedeği (CI / debug). |
| WHATSAPP_ACCESS_TOKEN | opsiyonel | Cloud API token. |
| WHATSAPP_APP_SECRET | opsiyonel | Webhook imza doğrulama. |
| WHATSAPP_PHONE_NUMBER_ID | opsiyonel | Gönderim numarası id. |
| WHATSAPP_VERIFY_TOKEN | opsiyonel | Webhook verify handshake. |
| IP_SALT_SECRET | opsiyonel | Telefon OTP rate-limit hash salt. |
| SHARE_SLUG_SECRET | opsiyonel | Share slug üretiminde HMAC tohumu. |
| ADMIN_EMAIL | opsiyonel | Yönetim bildirimleri. |
| CONTACT_EMAIL_WEBHOOK | opsiyonel | /api/contact gönderim hedefi. |
| HEALTH_TOKEN | opsiyonel | /api/health için header doğrulaması. |
| SENTRY_DSN | opsiyonel | Server-side error reporting. |
| NEXT_PUBLIC_ERROR_WEBHOOK | opsiyonel | Client error reporting. |
| NEXT_PUBLIC_PLAUSIBLE_DOMAIN | opsiyonel | Plausible domain (analytics). |
| NEXT_PUBLIC_PLAUSIBLE_HOST | opsiyonel | Self-host Plausible varsa. |
Bu kural pazarlama veya stilistik değil; mimari bir invaryant. heyirona kod tabanında, commit author'da ve deploy izinde gerçek isim geçmez.
local <local@heyirona> author ile düşer. Ortam değişkenleri GIT_AUTHOR_NAME=local, GIT_AUTHOR_EMAIL=local@heyirona shell'de export edilir.Küçük, odaklanmış PR'lar. Tek bir lane, tek bir sorun, yeşil tsc.
any yasak.feat/<scope>-<kisa-ad>fix/<scope>-<kisa-ad>chore/<scope>-<kisa-ad>docs/<scope>-<kisa-ad>feat/build-variant-stripfeat(build): add variant stripfix(api): guard iterate authlocal.Bu sayfa kontrat; gerçek davranış kodda. AGENTS.md ve PROGRESS.md kök dizinde, migration'lar supabase/ altında, ajan prompt'ları ise route handler'ların yanı başında.