Skip to content

Commit 35d9f65

Browse files
committed
😃
Scraper 😃📺
0 parents  commit 35d9f65

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+346725
-0
lines changed

.gitignore

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.*
7+
.yarn/*
8+
!.yarn/patches
9+
!.yarn/plugins
10+
!.yarn/releases
11+
!.yarn/versions
12+
13+
# testing
14+
/coverage
15+
16+
# next.js
17+
/.next/
18+
/out/
19+
20+
# production
21+
/build
22+
23+
# misc
24+
.DS_Store
25+
*.pem
26+
27+
# debug
28+
npm-debug.log*
29+
yarn-debug.log*
30+
yarn-error.log*
31+
.pnpm-debug.log*
32+
33+
# env files (can opt-in for committing if needed)
34+
.env*
35+
36+
# vercel
37+
.vercel
38+
39+
# typescript
40+
*.tsbuildinfo
41+
next-env.d.ts

README.md

+160
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
# 🚀 SetScript.com Scraper & Analitik
2+
3+
<div align="center">
4+
<img src="https://img.shields.io/badge/Next.js-14-black?style=for-the-badge&logo=next.js" alt="Next.js" />
5+
<img src="https://img.shields.io/badge/TypeScript-5-blue?style=for-the-badge&logo=typescript" alt="TypeScript" />
6+
<img src="https://img.shields.io/badge/TailwindCSS-3-38B2AC?style=for-the-badge&logo=tailwind-css" alt="TailwindCSS" />
7+
<img src="https://img.shields.io/badge/Dark%20Mode-✓-8A2BE2?style=for-the-badge" alt="Dark Mode" />
8+
</div>
9+
10+
<div align="center">
11+
<h3>SetScript.com web sitesinden veri çeken, analiz eden ve görselleştiren modern bir web uygulaması</h3>
12+
<p>Geliştirici: <a href="https://github.com/oktayyavuz">@oktayyavuz</a></p>
13+
</div>
14+
15+
## 📋 İçindekiler
16+
17+
- [🌟 Özellikler](#-özellikler)
18+
- [🖼️ Ekran Görüntüleri](#️-ekran-görüntüleri)
19+
- [🛠️ Teknolojiler](#️-teknolojiler)
20+
- [⚙️ Kurulum](#️-kurulum)
21+
- [🚀 Kullanım](#-kullanım)
22+
- [📊 API Endpoints](#-api-endpoints)
23+
- [🧩 Proje Yapısı](#-proje-yapısı)
24+
- [📝 Lisans](#-lisans)
25+
26+
## 🌟 Özellikler
27+
28+
- **Otomatik Veri Çekme**: SetScript.com'dan her 10 dakikada bir otomatik veri çekme
29+
- **Manuel Veri Çekme**: İstediğiniz SetScript.com sayfasından manuel veri çekme
30+
- **Detaylı Analitikler**: Ekip üyeleri ve projeler hakkında kapsamlı analitikler
31+
- **Görsel Grafikler**: Zaman içindeki değişimleri gösteren interaktif grafikler
32+
- **Arama ve Filtreleme**: Ekip üyeleri ve projeleri arama ve filtreleme
33+
- **Koyu Tema**: Göz yorgunluğunu azaltan şık koyu tema tasarımı
34+
- **Responsive Tasarım**: Tüm cihazlarda mükemmel görüntüleme deneyimi
35+
- **JSON API**: Tüm verilere programatik erişim için JSON API
36+
37+
## 🖼️ Ekran Görüntüleri
38+
39+
<div align="center">
40+
<p><i>Ekran görüntüleri buraya eklenecek</i></p>
41+
</div>
42+
43+
## 🛠️ Teknolojiler
44+
45+
- **Frontend**: Next.js 14, React, TypeScript, TailwindCSS
46+
- **Backend**: Next.js API Routes
47+
- **Veri Çekme**: Cheerio (Web Scraping)
48+
- **Veri Depolama**: Dosya tabanlı JSON depolama
49+
- **Grafikler**: Chart.js, React-Chartjs-2
50+
- **UI Bileşenleri**: Shadcn UI
51+
52+
## ⚙️ Kurulum
53+
54+
1. Repoyu klonlayın:
55+
```bash
56+
git clone https://github.com/oktayyavuz/setscript-scraper.git
57+
cd setscript-scraper
58+
```
59+
60+
2. Bağımlılıkları yükleyin:
61+
```bash
62+
npm install
63+
```
64+
65+
3. Geliştirme sunucusunu başlatın:
66+
```bash
67+
npm run dev
68+
```
69+
70+
4. Tarayıcınızda açın:
71+
```
72+
http://localhost:3000
73+
```
74+
75+
## 🚀 Kullanım
76+
77+
### Ana Sayfa
78+
79+
Ana sayfada, uygulamanın temel özelliklerine erişebilirsiniz:
80+
81+
- **Veri Çekme**: Manuel olarak belirli bir SetScript.com sayfasından veri çekme
82+
- **Otomatik İzleme**: Otomatik veri çekme durumunu görüntüleme
83+
- **Analitikler**: Detaylı analitiklere erişim
84+
85+
### Analitikler Sayfası
86+
87+
Analitikler sayfasında şunları bulabilirsiniz:
88+
89+
- **Özet Kartları**: Toplam ekip üyesi ve proje sayısı
90+
- **Grafikler**: Zaman içindeki değişimleri gösteren grafikler
91+
- **Ekip Üyeleri Tablosu**: Tüm ekip üyelerinin listesi ve detayları
92+
- **Projeler Tablosu**: Tüm projelerin listesi ve detayları
93+
94+
## 📊 API Endpoints
95+
96+
Uygulama, verilere programatik erişim için aşağıdaki API endpoint'lerini sunar:
97+
98+
- **GET /api/scrape**: Belirli bir URL'den veri çeker
99+
```
100+
/api/scrape?url=https://setscript.com/developers
101+
```
102+
103+
- **GET /api/cron**: Tüm sayfaları tarar ve verileri günceller
104+
```
105+
/api/cron
106+
```
107+
108+
- **GET /api/analytics**: Analitik verilerini döndürür
109+
```
110+
/api/analytics
111+
```
112+
113+
- **GET /api/json**: Tüm ham verileri JSON formatında döndürür
114+
```
115+
/api/json
116+
```
117+
118+
## 🧩 Proje Yapısı
119+
120+
```
121+
setscript-scraper/
122+
├── app/ # Next.js uygulama dizini
123+
│ ├── api/ # API route'ları
124+
│ │ ├── analytics/ # Analitik API'si
125+
│ │ ├── cron/ # Otomatik veri çekme API'si
126+
│ │ ├── json/ # JSON veri API'si
127+
│ │ └── scrape/ # Web scraping API'si
128+
│ ├── analytics/ # Analitikler sayfası
129+
│ ├── components/ # Uygulama bileşenleri
130+
│ │ ├── analytics/ # Analitik bileşenleri
131+
│ │ └── ui/ # UI bileşenleri
132+
│ ├── globals.css # Global CSS
133+
│ ├── layout.tsx # Ana layout
134+
│ ├── not-found.tsx # 404 sayfası
135+
│ └── page.tsx # Ana sayfa
136+
├── components/ # Paylaşılan bileşenler
137+
│ └── ui/ # UI bileşenleri
138+
├── lib/ # Yardımcı fonksiyonlar
139+
├── public/ # Statik dosyalar
140+
├── .gitignore
141+
├── next.config.js
142+
├── package.json
143+
├── README.md
144+
└── tsconfig.json
145+
```
146+
147+
## 📝 Lisans
148+
149+
Bu proje [MIT Lisansı](LICENSE) altında lisanslanmıştır.
150+
151+
---
152+
153+
<div align="center">
154+
<p>
155+
<a href="https://github.com/oktayyavuz">
156+
<img src="https://img.shields.io/github/followers/oktayyavuz?label=Follow&style=social" alt="GitHub Takip Et" />
157+
</a>
158+
</p>
159+
<p>© 2025 Oktay Yavuz. Tüm hakları saklıdır.</p>
160+
</div>

app/analytics/page.tsx

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
import dynamic from 'next/dynamic';
2+
3+
const SummaryCards = dynamic(() => import('../components/analytics/SummaryCards'), {
4+
loading: () => <p className="text-center p-8">Yükleniyor...</p>
5+
});
6+
7+
const TeamMembersChart = dynamic(() => import('../components/analytics/TeamMembersChart'), {
8+
loading: () => <p className="text-center p-8">Yükleniyor...</p>
9+
});
10+
11+
const ProjectsChart = dynamic(() => import('../components/analytics/ProjectsChart'), {
12+
loading: () => <p className="text-center p-8">Yükleniyor...</p>
13+
});
14+
15+
const TeamMembersTable = dynamic(() => import('../components/analytics/TeamMembersTable'), {
16+
loading: () => <p className="text-center p-8">Yükleniyor...</p>
17+
});
18+
19+
const ProjectsTable = dynamic(() => import('../components/analytics/ProjectsTable'), {
20+
loading: () => <p className="text-center p-8">Yükleniyor...</p>
21+
});
22+
23+
const DataFetcher = dynamic(() => import('../components/DataFetcher'));
24+
25+
export default function AnalyticsPage() {
26+
return (
27+
<main className="flex min-h-screen flex-col py-8 px-4 md:px-8">
28+
<div className="w-full max-w-6xl mx-auto">
29+
<div className="flex flex-col gap-8">
30+
<div className="text-center mb-4">
31+
<h1 className="text-4xl font-bold bg-gradient-to-r from-primary to-primary/70 bg-clip-text text-transparent">
32+
SetScript.com Analitikleri
33+
</h1>
34+
<p className="text-muted-foreground mt-2">
35+
Tüm veriler her 10 dakikada bir otomatik olarak güncellenir
36+
</p>
37+
</div>
38+
39+
<div className="space-y-8">
40+
{/* Arka planda veri çekme bileşeni */}
41+
<section className="bg-card/30 backdrop-blur-sm rounded-lg p-1 border border-border/50">
42+
<DataFetcher />
43+
</section>
44+
45+
{/* Özet kartlar */}
46+
<section className="bg-card/30 backdrop-blur-sm rounded-lg p-1 border border-border/50">
47+
<SummaryCards />
48+
</section>
49+
50+
{/* Grafikler */}
51+
<section className="grid gap-6 md:grid-cols-2">
52+
<div className="bg-card/30 backdrop-blur-sm rounded-lg p-1 border border-border/50">
53+
<TeamMembersChart />
54+
</div>
55+
<div className="bg-card/30 backdrop-blur-sm rounded-lg p-1 border border-border/50">
56+
<ProjectsChart />
57+
</div>
58+
</section>
59+
60+
{/* Ekip üyeleri tablosu */}
61+
<section className="bg-card/30 backdrop-blur-sm rounded-lg p-1 border border-border/50">
62+
<TeamMembersTable />
63+
</section>
64+
65+
{/* Projeler tablosu */}
66+
<section className="bg-card/30 backdrop-blur-sm rounded-lg p-1 border border-border/50">
67+
<ProjectsTable />
68+
</section>
69+
</div>
70+
</div>
71+
</div>
72+
</main>
73+
);
74+
}

app/api/analytics/route.ts

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import { NextResponse } from 'next/server';
2+
import { readStoredData } from '../cron/route';
3+
4+
export async function GET() {
5+
try {
6+
const data = readStoredData();
7+
8+
if (!data || data.length === 0) {
9+
return NextResponse.json({
10+
success: false,
11+
message: 'Henüz depolanmış veri bulunmuyor.',
12+
data: []
13+
}, { status: 404 });
14+
}
15+
16+
const latestData = data[data.length - 1];
17+
const teamMemberCount = latestData.summary.teamMemberCount;
18+
const totalProjectCount = latestData.summary.totalProjectCount;
19+
20+
const timeSeriesData = data.map(item => ({
21+
timestamp: item.timestamp,
22+
teamMemberCount: item.summary.teamMemberCount,
23+
totalProjectCount: item.summary.totalProjectCount
24+
}));
25+
26+
return NextResponse.json({
27+
success: true,
28+
latestTimestamp: latestData.timestamp,
29+
summary: {
30+
teamMemberCount,
31+
totalProjectCount,
32+
dataPointCount: data.length
33+
},
34+
timeSeriesData,
35+
projectsData: latestData.summary.allProjects,
36+
teamMembersData: latestData.summary.teamMembers,
37+
rawData: data
38+
});
39+
} catch (error) {
40+
console.error('Analytics API hatası:', error);
41+
return NextResponse.json(
42+
{
43+
success: false,
44+
error: 'Analitik verileri işlenirken bir hata oluştu.',
45+
timestamp: new Date().toISOString()
46+
},
47+
{ status: 500 }
48+
);
49+
}
50+
}

0 commit comments

Comments
 (0)