KAP (Kamuyu Aydinlatma Platformu) sirket verilerini ceken, ortaklik yapilarini analiz eden ve graph olarak goruntuleyen web platformu.
- Dashboard — 1083 KAP sirketi, islem istatistikleri, son islemler
- Sirket Detay — Dropdown/arama ile sirket sec, tum KAP verilerini tablolar halinde goruntule, tek sirket guncelle
- Veri Isleme — Toplu veri cekme (curl + RSC payload parse), SSE ile canli ilerleme, hata yonetimi
- Ortaklik Grafi — vis-network ile interaktif graph gorunumu
- 6400+ dugum (sirket, ortak, kisi), 6500+ kenar
- Derinlik, sektor, holding grubu, min pay orani filtreleri
- Yol bulma (iki sirket arasi ortaklik zinciri)
- Cluster renklendirme
- Node boyutu (sermaye/baglanti sayisi)
- Dark/Light tema
- Ticker destegi — 604 BIST sirketi icin borsa kodu
| Katman |
Teknoloji |
| Frontend |
React 18, Vite, vis-network, lucide-react |
| Backend |
Express, TypeScript, tsx |
| Veritabani |
SQLite (better-sqlite3) |
| Auth |
JWT (jsonwebtoken) |
| Veri Kaynagi |
KAP (kap.org.tr) RSC payload parse |
git clone https://github.com/kenan2x/kapportal.git
cd kapportal
# Backend bagimliklar
cd backend && npm install && cd ..
# Frontend bagimlikllar
cd frontend && npm install && cd ..
# Root bagimliklar
npm install
cd backend
npx tsx src/seed.ts
Bu komut kap-scraper/companies.json dosyasindan 1083 sirketi SQLite'a yukler.
# Backend (port 3001)
cd backend && npx tsx src/index.ts
# Baska terminalde — Frontend (port 5173)
cd frontend && npx vite
Tarayicida: http://localhost:5173
Giris: admin / kap2024
- Portala giris yap
- "Veri Isle" sekmesine git
- "Bekleyen & Hatali Olanlari Isle" butonuna bas
- 1083 sirket sirayla islenir (~1.5 saniye aralikla, ~30 dakika)
docker compose up --build
Portal http://localhost:3001 adresinde calisir.
| Degisken |
Varsayilan |
Aciklama |
PORT |
3001 |
Backend port |
JWT_SECRET |
kap-portal-secret-2024 |
JWT imzalama anahtari |
ADMIN_PASS |
kap2024 |
Admin sifresi |
| Method |
Path |
Aciklama |
| POST |
/api/auth/login |
{username, password} → {token} |
| Method |
Path |
Aciklama |
| GET |
/api/dashboard/stats |
Toplam/islenmis/hata/bekleyen sayilari |
| GET |
/api/dashboard/activity |
Son 50 islem logu |
| Method |
Path |
Aciklama |
| GET |
/api/companies?search=X&status=done&page=1 |
Sirket listesi (sayfalamali) |
| GET |
/api/companies/all/list |
Tum sirketler (dropdown icin) |
| GET |
/api/companies/:id |
Tek sirket bilgisi |
| GET |
/api/companies/:id/data |
Sirketin tum KAP verileri |
| POST |
/api/companies/:id/scrape |
Tek sirketi yeniden cek |
| Method |
Path |
Aciklama |
| POST |
/api/processing/start |
Toplu islemeyi baslat |
| POST |
/api/processing/stop |
Durdur |
| GET |
/api/processing/state |
Mevcut durum |
| GET |
/api/processing/events |
SSE stream (canli ilerleme) |
| Method |
Path |
Aciklama |
| GET |
/api/graph/data?company_id=X&depth=2 |
Graph verisi (tam veya subgraph) |
| GET |
/api/graph/stats |
Dugum/kenar sayilari |
| GET |
/api/graph/sectors |
Sektor listesi |
| GET |
/api/graph/path?from=X&to=Y |
Iki node arasi en kisa yol |
| GET |
/api/graph/clusters |
Bagli bilesenleri (cluster) |
| POST |
/api/graph/rebuild |
Graph cache'i yeniden olustur |
kap-portal/
├── backend/
│ └── src/
│ ├── index.ts # Express sunucu
│ ├── db.ts # SQLite baglantisi ve migration
│ ├── auth.ts # JWT auth
│ ├── seed.ts # companies.json → SQLite
│ ├── routes/
│ │ ├── dashboard.ts # İstatistik API
│ │ ├── companies.ts # Sirket CRUD + tek scrape
│ │ ├── processing.ts # Toplu isleme + SSE
│ │ └── graph.ts # Graph API
│ └── services/
│ ├── scraper.ts # KAP RSC payload parser
│ ├── processor.ts # Batch orchestrator
│ └── graph-builder.ts # Graph olusturucu
├── frontend/
│ └── src/
│ ├── App.tsx # Router + providers
│ ├── api.ts # Backend API client
│ ├── components/
│ │ ├── Layout.tsx # Sidebar + tema toggle
│ │ └── LoginForm.tsx # Giris formu
│ ├── context/
│ │ ├── AuthContext.tsx # JWT auth state
│ │ └── ThemeContext.tsx # Dark/light tema
│ ├── hooks/
│ │ └── useSSE.ts # EventSource hook
│ └── pages/
│ ├── Dashboard.tsx # Istatistik kartlari
│ ├── CompanyDetail.tsx # Sirket detay + filtreler
│ ├── DataProcessing.tsx # Toplu isleme UI
│ └── GraphPlaceholder.tsx # Ortaklik grafi
├── docs/
│ └── graph-design.md # Graph tasarim dokumani
├── docker-compose.yml
├── Dockerfile
└── README.md
MIT