From 130732d1faac7a97733f954f8379d8d2214c288c Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 21:33:55 +0000 Subject: [PATCH 01/14] Add public/site.webmanifest --- public/site.webmanifest | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 public/site.webmanifest diff --git a/public/site.webmanifest b/public/site.webmanifest new file mode 100644 index 0000000..db2aa24 --- /dev/null +++ b/public/site.webmanifest @@ -0,0 +1,30 @@ +{ + "name": "Öğretmen Platformu", "short_name": "Öğretmen", "description": "Kişiselleştirilmiş online eğitim platformu", "start_url": "/", "scope": "/", "display": "standalone", "background_color": "#ffffff", "theme_color": "#000000", "orientation": "portrait-primary", "icons": [ + { + "src": "/android-chrome-192x192.png", "sizes": "192x192", "type": "image/png", "purpose": "any" + }, + { + "src": "/android-chrome-512x512.png", "sizes": "512x512", "type": "image/png", "purpose": "any" + }, + { + "src": "/android-chrome-192x192-maskable.png", "sizes": "192x192", "type": "image/png", "purpose": "maskable" + }, + { + "src": "/android-chrome-512x512-maskable.png", "sizes": "512x512", "type": "image/png", "purpose": "maskable" + } + ], + "screenshots": [ + { + "src": "/screenshot-1.png", "sizes": "540x720", "type": "image/png", "form_factor": "narrow" + }, + { + "src": "/screenshot-2.png", "sizes": "1280x720", "type": "image/png", "form_factor": "wide" + } + ], + "categories": ["education", "productivity"], + "screenshots": [ + { + "src": "/screenshot-1.png", "sizes": "540x720", "type": "image/png" + } + ] +} \ No newline at end of file -- 2.49.1 From 68b1764c1e641b4f08e099b1e206f6ea9ca8a7a2 Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 21:33:55 +0000 Subject: [PATCH 02/14] Add src/app/api/auth/login/route.ts --- src/app/api/auth/login/route.ts | 95 +++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 src/app/api/auth/login/route.ts diff --git a/src/app/api/auth/login/route.ts b/src/app/api/auth/login/route.ts new file mode 100644 index 0000000..d7e9291 --- /dev/null +++ b/src/app/api/auth/login/route.ts @@ -0,0 +1,95 @@ +import { NextRequest, NextResponse } from "next/server"; + +interface LoginRequest { + email: string; + password: string; + rememberMe: boolean; +} + +// Mock user storage for demonstration +const mockUsers: { + [key: string]: { + id: string; + firstName: string; + lastName: string; + email: string; + password: string; + userType: "student" | "teacher"; + }; +} = { + "demo@example.com": { + id: "user_1", firstName: "Demo", lastName: "User", email: "demo@example.com", password: "DemoPassword123", // Demo password + userType: "student"}, + "teacher@example.com": { + id: "user_2", firstName: "Demo", lastName: "Teacher", email: "teacher@example.com", password: "TeacherPassword123", userType: "teacher"}, +}; + +export async function POST(request: NextRequest) { + try { + const body: LoginRequest = await request.json(); + + // Validate input + if (!body.email || !body.password) { + return NextResponse.json( + { message: "E-posta ve şifre gereklidir" }, + { status: 400 } + ); + } + + // Find user + const user = mockUsers[body.email]; + + if (!user) { + return NextResponse.json( + { message: "E-posta veya şifre hatalı" }, + { status: 401 } + ); + } + + // In production, use bcrypt.compare() + // const passwordMatch = await bcrypt.compare(body.password, user.password); + + if (user.password !== body.password) { + return NextResponse.json( + { message: "E-posta veya şifre hatalı" }, + { status: 401 } + ); + } + + // Create response with user data + const response = NextResponse.json( + { + message: "Giriş başarıyla gerçekleştirildi", user: { + id: user.id, + firstName: user.firstName, + lastName: user.lastName, + email: user.email, + userType: user.userType, + }, + }, + { status: 200 } + ); + + // In production, set secure HTTP-only cookies + if (body.rememberMe) { + // Set longer expiration for "remember me" + response.cookies.set("authToken", `token_${user.id}`, { + maxAge: 30 * 24 * 60 * 60, // 30 days + httpOnly: true, + secure: process.env.NODE_ENV === "production", sameSite: "lax"}); + } else { + response.cookies.set("authToken", `token_${user.id}`, { + maxAge: 24 * 60 * 60, // 24 hours + httpOnly: true, + secure: process.env.NODE_ENV === "production", sameSite: "lax"}); + } + + return response; + } catch (error) { + console.error("Login error:", error); + return NextResponse.json( + { message: "Sunucu hatası oluştu" }, + { status: 500 } + ); + } +} -- 2.49.1 From f378001c0259b3eb2e5b2ffbe423cd668367cb82 Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 21:33:55 +0000 Subject: [PATCH 03/14] Add src/app/api/auth/register/route.ts --- src/app/api/auth/register/route.ts | 84 ++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 src/app/api/auth/register/route.ts diff --git a/src/app/api/auth/register/route.ts b/src/app/api/auth/register/route.ts new file mode 100644 index 0000000..5699469 --- /dev/null +++ b/src/app/api/auth/register/route.ts @@ -0,0 +1,84 @@ +import { NextRequest, NextResponse } from "next/server"; + +interface RegisterRequest { + firstName: string; + lastName: string; + email: string; + password: string; + userType: "student" | "teacher"; +} + +// This is a mock implementation. In production, you would: +// 1. Hash the password using bcrypt or similar +// 2. Store the user in a database +// 3. Send verification email +// 4. Create JWT tokens + +const mockUsers: { [key: string]: RegisterRequest & { id: string } } = {}; + +export async function POST(request: NextRequest) { + try { + const body: RegisterRequest = await request.json(); + + // Validate input + if ( + !body.firstName || + !body.lastName || + !body.email || + !body.password || + !body.userType + ) { + return NextResponse.json( + { message: "Tüm alanlar zorunludur" }, + { status: 400 } + ); + } + + // Check if user already exists + if (mockUsers[body.email]) { + return NextResponse.json( + { message: "Bu e-posta adresi zaten kullanımda" }, + { status: 409 } + ); + } + + // In production, hash the password + // const hashedPassword = await bcrypt.hash(body.password, 10); + + // Create new user + const newUser = { + id: `user_${Date.now()}`, + firstName: body.firstName, + lastName: body.lastName, + email: body.email, + password: body.password, // Never store plaintext in production! + userType: body.userType, + }; + + mockUsers[body.email] = newUser; + + // In production, you would: + // 1. Create a JWT token + // 2. Set secure HTTP-only cookie + // 3. Send verification email + + return NextResponse.json( + { + message: "Kayıt başarıyla tamamlandı", user: { + id: newUser.id, + firstName: newUser.firstName, + lastName: newUser.lastName, + email: newUser.email, + userType: newUser.userType, + }, + }, + { status: 201 } + ); + } catch (error) { + console.error("Registration error:", error); + return NextResponse.json( + { message: "Sunucu hatası oluştu" }, + { status: 500 } + ); + } +} -- 2.49.1 From 18088de45c15166a3c470e96c5217a540cf70d18 Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 21:33:56 +0000 Subject: [PATCH 04/14] Add src/app/contact/page.tsx --- src/app/contact/page.tsx | 164 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 164 insertions(+) create mode 100644 src/app/contact/page.tsx diff --git a/src/app/contact/page.tsx b/src/app/contact/page.tsx new file mode 100644 index 0000000..dbab3ba --- /dev/null +++ b/src/app/contact/page.tsx @@ -0,0 +1,164 @@ +"use client"; + +import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; +import NavbarStyleFullscreen from "@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen"; +import FooterLogoReveal from "@/components/sections/footer/FooterLogoReveal"; +import { Mail, Phone, MapPin, Send } from "lucide-react"; +import { useState } from "react"; + +export default function ContactPage() { + const [formData, setFormData] = useState({ + name: "", email: "", subject: "", message: ""}); + const [submitted, setSubmitted] = useState(false); + + const navItems = [ + { name: "Ana Sayfa", id: "/" }, + { name: "Öğretmenler", id: "/teachers" }, + { name: "Etkinlikler", id: "events" }, + { name: "Çalışma Programı", id: "schedule" }, + ]; + + const handleSubmit = (e: React.FormEvent) => { + e.preventDefault(); + // Simulate form submission + setSubmitted(true); + setTimeout(() => { + setFormData({ name: "", email: "", subject: "", message: "" }); + setSubmitted(false); + }, 2000); + }; + + return ( + + + +
+
+
+

Bize Ulaşın

+

+ Sorularınız mı var? Bize mesaj gönderin, en kısa sürede sizinle iletişime geçeceğiz. +

+
+ +
+ {/* Contact Info Cards */} + {[ + { icon: Mail, label: "Email", value: "info@platform.com" }, + { icon: Phone, label: "Telefon", value: "+90 (212) 555-0123" }, + { icon: MapPin, label: "Adres", value: "İstanbul, Türkiye" }, + ].map((item, idx) => { + const IconComponent = item.icon; + return ( +
+ +

{item.label}

+

{item.value}

+
+ ); + })} +
+ + {/* Contact Form */} +
+
+
+
+ + setFormData({ ...formData, name: e.target.value })} + className="w-full px-4 py-3 rounded-lg border border-accent bg-background text-foreground placeholder-foreground/50 focus:outline-none focus:ring-2 focus:ring-primary-cta min-h-11" + placeholder="Adınızı giriniz" + /> +
+
+ + setFormData({ ...formData, email: e.target.value })} + className="w-full px-4 py-3 rounded-lg border border-accent bg-background text-foreground placeholder-foreground/50 focus:outline-none focus:ring-2 focus:ring-primary-cta min-h-11" + placeholder="E-posta adresiniz" + /> +
+
+ +
+ + setFormData({ ...formData, subject: e.target.value })} + className="w-full px-4 py-3 rounded-lg border border-accent bg-background text-foreground placeholder-foreground/50 focus:outline-none focus:ring-2 focus:ring-primary-cta min-h-11" + placeholder="Konuyu yazınız" + /> +
+ +
+ +