first commit
This commit is contained in:
+47
@@ -0,0 +1,47 @@
|
||||
import NextAuth from "next-auth"
|
||||
import CredentialsProvider from "next-auth/providers/credentials"
|
||||
|
||||
export const { handlers, auth, signIn, signOut } = NextAuth({
|
||||
providers: [
|
||||
CredentialsProvider({
|
||||
name: "Credentials",
|
||||
credentials: {
|
||||
email: { label: "Email", type: "email" },
|
||||
password: { label: "Password", type: "password" }
|
||||
},
|
||||
async authorize(credentials) {
|
||||
// Boilerplate mock logic
|
||||
// TODO: In production, lookup user in Prisma and verify password using bcrypt
|
||||
// const user = await db.user.findUnique({ where: { email: credentials.email } })
|
||||
|
||||
if (credentials?.email === "admin@ayris.tech" && credentials?.password === "admin") {
|
||||
return {
|
||||
id: "1",
|
||||
name: "Admin User",
|
||||
email: "admin@ayris.tech",
|
||||
role: "ADMIN"
|
||||
}
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
})
|
||||
],
|
||||
callbacks: {
|
||||
async jwt({ token, user }) {
|
||||
if (user) {
|
||||
token.role = (user as any).role
|
||||
}
|
||||
return token
|
||||
},
|
||||
async session({ session, token }) {
|
||||
if (session.user && token.role) {
|
||||
(session.user as any).role = token.role
|
||||
}
|
||||
return session
|
||||
}
|
||||
},
|
||||
pages: {
|
||||
signIn: '/login'
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,20 @@
|
||||
import { v2 as cloudinary } from 'cloudinary'
|
||||
|
||||
cloudinary.config({
|
||||
cloud_name: process.env.CLOUDINARY_CLOUD_NAME!,
|
||||
api_key: process.env.CLOUDINARY_API_KEY!,
|
||||
api_secret: process.env.CLOUDINARY_API_SECRET!,
|
||||
})
|
||||
|
||||
export async function uploadImage(file: string, folder: string) {
|
||||
const result = await cloudinary.uploader.upload(file, {
|
||||
folder, transformation: [{ quality: 'auto', fetch_format: 'auto' }],
|
||||
})
|
||||
return { url: result.secure_url, publicId: result.public_id }
|
||||
}
|
||||
|
||||
export async function deleteImage(publicId: string) {
|
||||
await cloudinary.uploader.destroy(publicId)
|
||||
}
|
||||
|
||||
export { cloudinary }
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
export const siteInfo = {
|
||||
name: "ÖLÜDENİZ TOUR TRAVELS",
|
||||
nameAlt: "Ölüdeniz Tur Rezervasyon",
|
||||
slogan: "Mavi Yolculuk - Günübirlik Turlar - Aktiviteler - Özel Turlar - Araç Kiralama - Villa Kiralama",
|
||||
phone: "+90 535 317 19 12",
|
||||
phoneLink: "tel:+905353171912",
|
||||
whatsappLink: "https://api.whatsapp.com/send?phone=905353171912",
|
||||
email: "info@oludeniztourtravels.com",
|
||||
address: "Ölüdeniz Cad. No: 57/A Ölüdeniz 48300 Fethiye MUĞLA",
|
||||
socials: {
|
||||
tripadvisor: "https://www.tripadvisor.com.tr/Attraction_Review-g312737-d4881157-Reviews-Pegas_Paragliding-Oludeniz_Mugla_Province_Turkish_Aegean_Coast.html",
|
||||
instagram: "https://www.instagram.com/pegasturfethiye/",
|
||||
facebook: "https://www.facebook.com/pages/PEGASTUR/444290662644119/"
|
||||
}
|
||||
};
|
||||
|
||||
export const heroSlides = [
|
||||
"http://www.oludeniztourtravels.com/image/catalog/slayt/1.jpg",
|
||||
"http://www.oludeniztourtravels.com/image/catalog/slayt/2.jpg",
|
||||
"http://www.oludeniztourtravels.com/image/catalog/slayt/3.jpg",
|
||||
"http://www.oludeniztourtravels.com/image/catalog/slayt/4.jpg",
|
||||
"http://www.oludeniztourtravels.com/image/catalog/slayt/5.jpg"
|
||||
];
|
||||
|
||||
export const turlar = [
|
||||
{ id: 122, slug: "mehtap-turu", title: "Mehtap Turu", image: "http://www.oludeniztourtravels.com/image/cache/catalog/turlar/mehtapturu/hjhkhg-400x259.jpg", price: "0,00TL" },
|
||||
{ id: 123, slug: "dalyan-turu", title: "Dalyan Turu", image: "http://www.oludeniztourtravels.com/image/cache/catalog/turlar/dalyanturu/fgnmhgf-400x259.jpg", price: "0,00TL" },
|
||||
{ id: 121, slug: "pamukkale-turu", title: "Pamukkale Turu", image: "http://www.oludeniztourtravels.com/image/cache/catalog/turlar/pamukkaleturu/dfgfh-400x259.jpg", price: "0,00TL" },
|
||||
{ id: 999, slug: "ozel-turlar", title: "Özel Turlar", image: "http://www.oludeniztourtravels.com/image/cache/catalog/turlar/villakiralama/jkjhgfds-400x259.jpg", price: "0,00TL" }
|
||||
];
|
||||
|
||||
export const aktiviteler = [
|
||||
{ id: 124, slug: "saklikent-tlos-safari-turu", title: "Saklıkent Tlos Safari Turu", image: "http://www.oludeniztourtravels.com/image/cache/catalog/turlar/saklikenttlossafarituru/jhhgfd-400x259.JPG", price: "0,00TL" },
|
||||
{ id: 125, slug: "yamac-parasutu", title: "Yamaç Paraşütü", image: "http://www.oludeniztourtravels.com/image/cache/catalog/turlar/yamacparasutu/3456544-400x259.jpg", price: "0,00TL" },
|
||||
{ id: 126, slug: "dalis-turu", title: "Dalış Turu", image: "http://www.oludeniztourtravels.com/image/cache/catalog/turlar/dalisturu/snorkelingneeleylva-400x259.jpg", price: "0,00TL" },
|
||||
{ id: 127, slug: "atv-safari", title: "Atv Safari Turu", image: "http://www.oludeniztourtravels.com/image/cache/catalog/turlar/atvsafarituru/tykjk%C3%A7kjuy-400x259.jpg", price: "0,00TL" },
|
||||
{ id: 128, slug: "rafting-turu", title: "Rafting Tur", image: "http://www.oludeniztourtravels.com/image/cache/catalog/turlar/raftingturu/erhhkkj-400x259.jpg", price: "0,00TL" },
|
||||
{ id: 129, slug: "aquapark", title: "Aquapark", image: "http://www.oludeniztourtravels.com/image/cache/catalog/turlar/aquapark/fgnbbv-400x259.jpg", price: "0,00TL" },
|
||||
{ id: 130, slug: "at-turu", title: "At Turu", image: "http://www.oludeniztourtravels.com/image/cache/catalog/turlar/atturu/fghkjhjghg-400x259.jpg", price: "0,00TL" },
|
||||
{ id: 131, slug: "turk-hamami", title: "Türk Hamamı", image: "http://www.oludeniztourtravels.com/image/cache/catalog/turlar/turkhamami/dfghhghf-400x259.jpg", price: "0,00TL" }
|
||||
];
|
||||
|
||||
export const tekneTurlari = [
|
||||
{ id: 137, slug: "kara-inci-gunluk-tur-teknesi", title: "Kara İnci Günlük Tur Teknesi", image: "http://www.oludeniztourtravels.com/image/cache/catalog/turlar/karainci/sdsdf-400x259.jpeg", price: "0,00TL" },
|
||||
{ id: 133, slug: "pegas-gunluk-tur-teknesi", title: "Pegas Günlük Tur Teknesi", image: "http://www.oludeniztourtravels.com/image/cache/catalog/turlar/pegas/gfhgb-400x259.jpeg", price: "0,00TL" },
|
||||
{ id: 132, slug: "medusa-gunluk-tur-teknesi", title: "Medusa Günlük Tur Teknesi", image: "http://www.oludeniztourtravels.com/image/cache/catalog/turlar/medusa/fdgfghjhjhgfd-400x259.jpg", price: "0,00TL" },
|
||||
{ id: 136, slug: "surat-teknesi", title: "Sürat Teknesi", image: "http://www.oludeniztourtravels.com/image/cache/catalog/turlar/suratteknesi/vbnbvbcvcc-400x259.jpg", price: "0,00TL" },
|
||||
{ id: 801, slug: "oludeniz-kelebekler-vadisi-tekne-turu", title: "Ölüdeniz Kelebekler Vadisi Tekne Turu", image: "http://www.oludeniztourtravels.com/image/cache/catalog/turlar/medusa/fdgfghjhjhgfd-400x259.jpg", price: "0,00TL" },
|
||||
{ id: 802, slug: "12-adalar-tekne-turu", title: "12 Adalar Tekne Turu", image: "http://www.oludeniztourtravels.com/image/cache/catalog/turlar/pegas/gfhgb-400x259.jpeg", price: "0,00TL" }
|
||||
];
|
||||
|
||||
export const digerHizmetler = [
|
||||
{ id: 135, slug: "arac-kiralama", title: "Araç Kiralama", image: "http://www.oludeniztourtravels.com/image/cache/catalog/turlar/arackiralama/dffgmnnm-400x259.jpg", price: "0,00TL" },
|
||||
{ id: 134, slug: "villa-kiralama", title: "Villa Kiralama", image: "http://www.oludeniztourtravels.com/image/cache/catalog/turlar/villakiralama/jkjhgfds-400x259.jpg", price: "0,00TL" }
|
||||
];
|
||||
@@ -0,0 +1,9 @@
|
||||
import { PrismaClient } from '@prisma/client'
|
||||
|
||||
const globalForPrisma = globalThis as unknown as {
|
||||
prisma: PrismaClient | undefined
|
||||
}
|
||||
|
||||
export const db = globalForPrisma.prisma ?? new PrismaClient()
|
||||
|
||||
if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = db
|
||||
@@ -0,0 +1,6 @@
|
||||
import { clsx, type ClassValue } from "clsx"
|
||||
import { twMerge } from "tailwind-merge"
|
||||
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs))
|
||||
}
|
||||
Reference in New Issue
Block a user