Compare commits
7 Commits
d7874ef9de
...
v0.1.0
Author | SHA1 | Date | |
---|---|---|---|
3b67c26216 | |||
f2fed22ea1 | |||
ab5e5e67a6 | |||
78a379546c | |||
953a970220 | |||
c7d9fc689e | |||
f4593cd706 |
@@ -10,7 +10,9 @@ RESEND_API_KEY=your_resend_api_key_here
|
||||
EMAIL_FROM=noreply@yourdomain.com
|
||||
ADMIN_EMAIL=admin@yourdomain.com
|
||||
|
||||
# Frontend URL (for E-Mail Links)
|
||||
# Social media profiles
|
||||
TIKTOK_PROFILE=https://www.tiktok.com/@<dein Tiktok Profil>
|
||||
INSTAGRAM_PROFILE=https://www.instagram.com/<dein Instragram Profil>
|
||||
|
||||
# Cancellation Policy (in hours)
|
||||
MIN_STORNO_TIMESPAN=24
|
||||
|
10
Caddyfile
10
Caddyfile
@@ -8,6 +8,16 @@ stargirlnails.de {
|
||||
health_uri /health
|
||||
health_interval 30s
|
||||
health_timeout 5s
|
||||
|
||||
# Timeouts für lange laufende Verbindungen (Live-Queries)
|
||||
transport http {
|
||||
read_timeout 0
|
||||
write_timeout 0
|
||||
dial_timeout 30s
|
||||
}
|
||||
|
||||
# Buffer-Flush für Server-Sent Events (SSE) aktivieren
|
||||
flush_interval -1
|
||||
}
|
||||
|
||||
# Sicherheits-Header
|
||||
|
@@ -1,4 +1,6 @@
|
||||
import { useState, useEffect } from "react";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { queryClient } from "@/client/rpc-client";
|
||||
import { useAuth } from "@/client/components/auth-provider";
|
||||
import { LoginForm } from "@/client/components/login-form";
|
||||
import { UserProfile } from "@/client/components/user-profile";
|
||||
@@ -19,6 +21,12 @@ function App() {
|
||||
const { user, isLoading, isOwner } = useAuth();
|
||||
const [activeTab, setActiveTab] = useState<"profile-landing" | "booking" | "admin-treatments" | "admin-bookings" | "admin-calendar" | "admin-availability" | "admin-gallery" | "admin-reviews" | "profile" | "legal">("profile-landing");
|
||||
const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);
|
||||
|
||||
const { data: socialMedia } = useQuery(
|
||||
queryClient.social.getSocialMedia.queryOptions()
|
||||
);
|
||||
|
||||
const hasSocialMedia = (socialMedia as any)?.tiktokProfile || (socialMedia as any)?.instagramProfile;
|
||||
|
||||
// Prevent background scroll when menu is open
|
||||
useEffect(() => {
|
||||
@@ -377,7 +385,37 @@ function App() {
|
||||
<footer className="bg-white border-t border-pink-100 mt-16">
|
||||
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
|
||||
<div className="text-center text-gray-600">
|
||||
<p>© 2025 Stargirlnails Kiel. Professional nail design & care with 🩷 and passion in Kiel 🌇.</p>
|
||||
<p className="mb-4">© 2025 Stargirlnails Kiel. Professional nail design & care with 🩷 and passion in Kiel 🌇.</p>
|
||||
{hasSocialMedia && (
|
||||
<div className="flex justify-center items-center gap-3 mt-4">
|
||||
{(socialMedia as any)?.instagramProfile && (
|
||||
<a
|
||||
href={(socialMedia as any).instagramProfile}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-pink-600 hover:text-pink-700 transition-colors"
|
||||
aria-label="Instagram"
|
||||
>
|
||||
<svg className="w-6 h-6" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z"/>
|
||||
</svg>
|
||||
</a>
|
||||
)}
|
||||
{(socialMedia as any)?.tiktokProfile && (
|
||||
<a
|
||||
href={(socialMedia as any).tiktokProfile}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-gray-800 hover:text-gray-900 transition-colors"
|
||||
aria-label="TikTok"
|
||||
>
|
||||
<svg className="w-6 h-6" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M19.59 6.69a4.83 4.83 0 0 1-3.77-4.25V2h-3.45v13.67a2.89 2.89 0 0 1-5.2 1.74 2.89 2.89 0 0 1 2.31-4.64 2.93 2.93 0 0 1 .88.13V9.4a6.84 6.84 0 0 0-1-.05A6.33 6.33 0 0 0 5 20.1a6.34 6.34 0 0 0 10.86-4.43v-7a8.16 8.16 0 0 0 4.77 1.52v-3.4a4.85 4.85 0 0 1-1-.1z"/>
|
||||
</svg>
|
||||
</a>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
@@ -11,9 +11,52 @@ export function BookingForm() {
|
||||
const [selectedTime, setSelectedTime] = useState("");
|
||||
const [notes, setNotes] = useState("");
|
||||
const [agbAccepted, setAgbAccepted] = useState(false);
|
||||
const [ageConfirmed, setAgeConfirmed] = useState(false);
|
||||
const [inspirationPhoto, setInspirationPhoto] = useState<string>("");
|
||||
const [photoPreview, setPhotoPreview] = useState<string>("");
|
||||
const [errorMessage, setErrorMessage] = useState<string>("");
|
||||
const [isInitialized, setIsInitialized] = useState(false);
|
||||
|
||||
// Load saved customer data from localStorage on mount
|
||||
useEffect(() => {
|
||||
const savedName = localStorage.getItem("bookingForm_customerName");
|
||||
const savedEmail = localStorage.getItem("bookingForm_customerEmail");
|
||||
const savedPhone = localStorage.getItem("bookingForm_customerPhone");
|
||||
|
||||
if (savedName) setCustomerName(savedName);
|
||||
if (savedEmail) setCustomerEmail(savedEmail);
|
||||
if (savedPhone) setCustomerPhone(savedPhone);
|
||||
|
||||
setIsInitialized(true);
|
||||
}, []);
|
||||
|
||||
// Save customer data to localStorage when it changes (after initial load)
|
||||
useEffect(() => {
|
||||
if (!isInitialized) return;
|
||||
if (customerName) {
|
||||
localStorage.setItem("bookingForm_customerName", customerName);
|
||||
} else {
|
||||
localStorage.removeItem("bookingForm_customerName");
|
||||
}
|
||||
}, [customerName, isInitialized]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isInitialized) return;
|
||||
if (customerEmail) {
|
||||
localStorage.setItem("bookingForm_customerEmail", customerEmail);
|
||||
} else {
|
||||
localStorage.removeItem("bookingForm_customerEmail");
|
||||
}
|
||||
}, [customerEmail, isInitialized]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isInitialized) return;
|
||||
if (customerPhone) {
|
||||
localStorage.setItem("bookingForm_customerPhone", customerPhone);
|
||||
} else {
|
||||
localStorage.removeItem("bookingForm_customerPhone");
|
||||
}
|
||||
}, [customerPhone, isInitialized]);
|
||||
|
||||
const { data: treatments } = useQuery(
|
||||
queryClient.treatments.live.list.experimental_liveOptions()
|
||||
@@ -147,6 +190,10 @@ export function BookingForm() {
|
||||
setErrorMessage("Bitte bestätige die Kenntnisnahme der Allgemeinen Geschäftsbedingungen.");
|
||||
return;
|
||||
}
|
||||
if (!ageConfirmed) {
|
||||
setErrorMessage("Bitte bestätige, dass du mindestens 16 Jahre alt bist.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Email validation now handled in backend before booking creation
|
||||
const appointmentTime = selectedTime;
|
||||
@@ -181,6 +228,7 @@ export function BookingForm() {
|
||||
setSelectedTime("");
|
||||
setNotes("");
|
||||
setAgbAccepted(false);
|
||||
setAgeConfirmed(false);
|
||||
setInspirationPhoto("");
|
||||
setPhotoPreview("");
|
||||
setErrorMessage("");
|
||||
@@ -383,7 +431,7 @@ export function BookingForm() {
|
||||
</div>
|
||||
|
||||
{/* AGB Acceptance */}
|
||||
<div className="bg-gray-50 border border-gray-200 rounded-lg p-4">
|
||||
<div className="bg-gray-50 border border-gray-200 rounded-lg p-4 space-y-4">
|
||||
<div className="flex items-start space-x-3">
|
||||
<input
|
||||
type="checkbox"
|
||||
@@ -409,6 +457,22 @@ export function BookingForm() {
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex items-start space-x-3">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="age-confirmation"
|
||||
checked={ageConfirmed}
|
||||
onChange={(e) => setAgeConfirmed(e.target.checked)}
|
||||
className="mt-1 h-4 w-4 text-pink-600 focus:ring-pink-500 border-gray-300 rounded"
|
||||
required
|
||||
/>
|
||||
<div className="flex-1">
|
||||
<label htmlFor="age-confirmation" className="text-sm font-medium text-gray-700 cursor-pointer">
|
||||
Ich bestätige, dass ich mindestens 16 Jahre alt bin *
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Error Message */}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { useState } from "react";
|
||||
import { useState, useEffect } from "react";
|
||||
import { useAuth } from "@/client/components/auth-provider";
|
||||
|
||||
export function LoginForm() {
|
||||
@@ -6,9 +6,27 @@ export function LoginForm() {
|
||||
const [password, setPassword] = useState("");
|
||||
const [error, setError] = useState("");
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const [isInitialized, setIsInitialized] = useState(false);
|
||||
|
||||
const { login } = useAuth();
|
||||
|
||||
// Load saved username from localStorage on mount
|
||||
useEffect(() => {
|
||||
const savedUsername = localStorage.getItem("loginForm_username");
|
||||
if (savedUsername) setUsername(savedUsername);
|
||||
setIsInitialized(true);
|
||||
}, []);
|
||||
|
||||
// Save username to localStorage when it changes (after initial load)
|
||||
useEffect(() => {
|
||||
if (!isInitialized) return;
|
||||
if (username) {
|
||||
localStorage.setItem("loginForm_username", username);
|
||||
} else {
|
||||
localStorage.removeItem("loginForm_username");
|
||||
}
|
||||
}, [username, isInitialized]);
|
||||
|
||||
const handleSubmit = async (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
setError("");
|
||||
|
@@ -57,6 +57,10 @@ export function ProfileLanding({ onNavigateToBooking }: ProfileLandingProps) {
|
||||
queryClient.recurringAvailability.live.listRules.experimental_liveOptions()
|
||||
);
|
||||
|
||||
const { data: socialMedia } = useQuery(
|
||||
queryClient.social.getSocialMedia.queryOptions()
|
||||
);
|
||||
|
||||
// Calculate next 7 days for opening hours
|
||||
const getNext7Days = () => {
|
||||
const days: Date[] = [];
|
||||
@@ -84,12 +88,44 @@ export function ProfileLanding({ onNavigateToBooking }: ProfileLandingProps) {
|
||||
</p>
|
||||
<button
|
||||
onClick={onNavigateToBooking}
|
||||
className="bg-pink-600 text-white py-4 px-8 rounded-lg hover:bg-pink-700 text-lg font-semibold shadow-lg transition-colors w-full md:w-auto"
|
||||
className="bg-[#790dc6] text-white py-4 px-8 rounded-lg hover:bg-[#6609ad] text-lg font-semibold shadow-lg transition-colors w-full md:w-auto"
|
||||
>
|
||||
Termin buchen
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* Social Media Badges */}
|
||||
{((socialMedia as any)?.tiktokProfile || (socialMedia as any)?.instagramProfile) && (
|
||||
<div className="flex justify-center items-center gap-4">
|
||||
{(socialMedia as any)?.instagramProfile && (
|
||||
<a
|
||||
href={(socialMedia as any).instagramProfile}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="flex items-center gap-2 bg-gradient-to-r from-purple-500 via-pink-500 to-orange-500 text-white px-6 py-3 rounded-full hover:shadow-lg transition-all hover:scale-105 font-semibold"
|
||||
>
|
||||
<svg className="w-6 h-6" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z"/>
|
||||
</svg>
|
||||
Instagram
|
||||
</a>
|
||||
)}
|
||||
{(socialMedia as any)?.tiktokProfile && (
|
||||
<a
|
||||
href={(socialMedia as any).tiktokProfile}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="flex items-center gap-2 bg-black text-white px-6 py-3 rounded-full hover:shadow-lg transition-all hover:scale-105 font-semibold"
|
||||
>
|
||||
<svg className="w-6 h-6" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M19.59 6.69a4.83 4.83 0 0 1-3.77-4.25V2h-3.45v13.67a2.89 2.89 0 0 1-5.2 1.74 2.89 2.89 0 0 1 2.31-4.64 2.93 2.93 0 0 1 .88.13V9.4a6.84 6.84 0 0 0-1-.05A6.33 6.33 0 0 0 5 20.1a6.34 6.34 0 0 0 10.86-4.43v-7a8.16 8.16 0 0 0 4.77 1.52v-3.4a4.85 4.85 0 0 1-1-.1z"/>
|
||||
</svg>
|
||||
TikTok
|
||||
</a>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Featured Section: Erstes Foto (Reihenfolge 0) */}
|
||||
{featuredPhoto && (
|
||||
<div className="bg-white rounded-lg shadow-lg p-0 overflow-hidden">
|
||||
|
@@ -62,6 +62,7 @@ if (process.env.NODE_ENV === 'production') {
|
||||
app.use('/assets/*', serveStatic({ root: './dist' }));
|
||||
}
|
||||
app.use('/favicon.png', serveStatic({ path: './public/favicon.png' }));
|
||||
app.use('/AGB.pdf', serveStatic({ path: './public/AGB.pdf' }));
|
||||
|
||||
app.route("/rpc", rpcApp);
|
||||
app.route("/caldav", caldavApp);
|
||||
|
@@ -31,6 +31,9 @@ async function renderBrandedEmail(title: string, bodyHtml: string): Promise<stri
|
||||
const protocol = domain.includes('localhost') ? 'http' : 'https';
|
||||
const homepageUrl = `${protocol}://${domain}`;
|
||||
|
||||
const instagramProfile = process.env.INSTAGRAM_PROFILE;
|
||||
const tiktokProfile = process.env.TIKTOK_PROFILE;
|
||||
|
||||
return `
|
||||
<div style="font-family: Arial, sans-serif; color: #0f172a; background:#fdf2f8; padding:24px;">
|
||||
<table role="presentation" width="100%" cellspacing="0" cellpadding="0" style="max-width:640px; margin:0 auto; background:#ffffff; border-radius:12px; overflow:hidden; box-shadow:0 1px 3px rgba(0,0,0,0.06)">
|
||||
@@ -49,6 +52,23 @@ async function renderBrandedEmail(title: string, bodyHtml: string): Promise<stri
|
||||
<div style="text-align:center; margin-bottom:16px;">
|
||||
<a href="${homepageUrl}" style="display: inline-block; background-color: #db2777; color: white; padding: 12px 24px; text-decoration: none; border-radius: 6px; font-weight: 600; font-size: 14px;">Zur Website</a>
|
||||
</div>
|
||||
${(instagramProfile || tiktokProfile) ? `
|
||||
<div style="text-align:center; margin-bottom:16px;">
|
||||
<p style="font-size:14px; color:#64748b; margin:0 0 8px 0;">Folge uns auf Social Media:</p>
|
||||
<div style="display:inline-block;">
|
||||
${instagramProfile ? `
|
||||
<a href="${instagramProfile}" target="_blank" rel="noopener noreferrer" style="display:inline-block; margin:0 6px; background:linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%); color:white; padding:10px 20px; text-decoration:none; border-radius:20px; font-size:14px; font-weight:600;">
|
||||
📷 Instagram
|
||||
</a>
|
||||
` : ''}
|
||||
${tiktokProfile ? `
|
||||
<a href="${tiktokProfile}" target="_blank" rel="noopener noreferrer" style="display:inline-block; margin:0 6px; background:#000000; color:white; padding:10px 20px; text-decoration:none; border-radius:20px; font-size:14px; font-weight:600;">
|
||||
🎵 TikTok
|
||||
</a>
|
||||
` : ''}
|
||||
</div>
|
||||
</div>
|
||||
` : ''}
|
||||
<div style="font-size:12px; color:#64748b; text-align:center;">
|
||||
© ${new Date().getFullYear()} Stargirlnails Kiel • Professional Nail Care
|
||||
</div>
|
||||
|
@@ -7,6 +7,7 @@ import { router as cancellation } from "./cancellation.js";
|
||||
import { router as legal } from "./legal.js";
|
||||
import { router as gallery } from "./gallery.js";
|
||||
import { router as reviews } from "./reviews.js";
|
||||
import { router as social } from "./social.js";
|
||||
|
||||
export const router = {
|
||||
demo,
|
||||
@@ -18,4 +19,5 @@ export const router = {
|
||||
legal,
|
||||
gallery,
|
||||
reviews,
|
||||
social,
|
||||
};
|
||||
|
13
src/server/rpc/social.ts
Normal file
13
src/server/rpc/social.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { os } from "@orpc/server";
|
||||
|
||||
const getSocialMedia = os.handler(async () => {
|
||||
return {
|
||||
tiktokProfile: process.env.TIKTOK_PROFILE,
|
||||
instagramProfile: process.env.INSTAGRAM_PROFILE,
|
||||
};
|
||||
});
|
||||
|
||||
export const router = os.router({
|
||||
getSocialMedia,
|
||||
});
|
||||
|
Reference in New Issue
Block a user