14 Commits

Author SHA1 Message Date
faea94b580 Merge version_4 into main
Merge version_4 into main
2026-06-07 12:09:05 +00:00
2d4586f3a8 Update theme fonts 2026-06-07 12:08:59 +00:00
bf573d36d2 Update theme fonts 2026-06-07 12:08:58 +00:00
8b308cd90d Merge version_4 into main
Merge version_4 into main
2026-06-07 12:08:50 +00:00
77cb568062 Update theme fonts 2026-06-07 12:08:47 +00:00
2e79c71394 Update theme fonts 2026-06-07 12:08:46 +00:00
ccb4dfaa5b Merge version_4 into main
Merge version_4 into main
2026-06-07 12:08:17 +00:00
2bcac58959 Update theme colors 2026-06-07 12:08:14 +00:00
e232df9470 Merge version_3 into main
Merge version_3 into main
2026-06-07 12:08:01 +00:00
ebea3ed11d Update theme colors 2026-06-07 12:07:58 +00:00
edbface48b Switch to version 2: added simulate_user_activity.js 2026-06-07 12:05:53 +00:00
827f463f01 Switch to version 1: remove simulate_user_activity.js 2026-06-07 12:05:50 +00:00
74674d4b37 Merge version_2 into main
Merge version_2 into main
2026-06-07 12:04:44 +00:00
a6e5ecc1d9 Add simulate_user_activity.js 2026-06-07 12:04:41 +00:00
4 changed files with 168 additions and 16 deletions

154
simulate_user_activity.js Normal file
View File

@@ -0,0 +1,154 @@
const BASE_URL = 'http://localhost:3000/api/track-search';
const casualSearchTerms = [
'travel ideas',
'vacation spots',
'cheap flights',
'hotels',
'trip planner',
'how to plan a trip',
'holiday packages'
];
const highIntentSearchTerms = [
'ItineraryGenie pricing',
'ItineraryGenie features',
'ItineraryGenie vs competitors',
'book luxury hotels Paris August 2024',
'AI trip planner reviews',
'best itinerary generator',
'ItineraryGenie demo request'
];
const casualPageViews = [
'/',
'/about',
'/blog',
'/contact'
];
const highIntentPageViews = [
'/',
'/#features',
'/#how-it-works',
'/#use-cases',
'/#project-insights',
'/#contact',
'/pricing'
];
const getRandomItem = (arr) => arr[Math.floor(Math.random() * arr.length)];
const getRandomDelay = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min;
async function sendData(endpoint, payload) {
try {
const response = await fetch(endpoint, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(payload)
});
if (response.ok) {
console.log(`Successfully sent data to ${endpoint}:`, payload);
} else {
console.error(`Failed to send data to ${endpoint}. Status: ${response.status}`, payload);
const errorText = await response.text();
console.error('Error response:', errorText);
}
} catch (error) {
console.error(`Error sending data to ${endpoint}:`, error, payload);
}
}
async function simulateCasualUser(userId) {
console.log(`[Casual User ${userId}] Starting casual browsing session.`);
const sessionDuration = getRandomDelay(60000, 180000); // 1-3 minutes
const startTime = Date.now();
while (Date.now() - startTime < sessionDuration) {
const actionType = Math.random();
if (actionType < 0.6) { // 60% chance of a page view
const pagePath = getRandomItem(casualPageViews);
const payload = {
userId,
timestamp: new Date().toISOString(),
eventType: 'pageView',
pagePath: pagePath
};
await sendData(BASE_URL.replace('/track-search', '/track-pageview'), payload); // Assuming a separate pageview endpoint
console.log(`[Casual User ${userId}] Viewed page: ${pagePath}`);
} else { // 40% chance of a search
const searchTerm = getRandomItem(casualSearchTerms);
const payload = {
userId,
timestamp: new Date().toISOString(),
query: searchTerm,
intent: 'casual'
};
await sendData(BASE_URL, payload);
console.log(`[Casual User ${userId}] Searched for: "${searchTerm}"`);
}
await new Promise(resolve => setTimeout(resolve, getRandomDelay(5000, 15000))); // 5-15 second delay between actions
}
console.log(`[Casual User ${userId}] Casual browsing session ended.`);
}
async function simulateHighIntentUser(userId) {
console.log(`[High-Intent User ${userId}] Starting high-intent browsing session.`);
const sessionDuration = getRandomDelay(180000, 300000); // 3-5 minutes
const startTime = Date.now();
while (Date.now() - startTime < sessionDuration) {
const actionType = Math.random();
if (actionType < 0.4) { // 40% chance of a page view
const pagePath = getRandomItem(highIntentPageViews);
const payload = {
userId,
timestamp: new Date().toISOString(),
eventType: 'pageView',
pagePath: pagePath
};
await sendData(BASE_URL.replace('/track-search', '/track-pageview'), payload); // Assuming a separate pageview endpoint
console.log(`[High-Intent User ${userId}] Viewed page: ${pagePath}`);
} else { // 60% chance of a search
const searchTerm = getRandomItem(highIntentSearchTerms);
const payload = {
userId,
timestamp: new Date().toISOString(),
query: searchTerm,
intent: 'high-intent'
};
await sendData(BASE_URL, payload);
console.log(`[High-Intent User ${userId}] Searched for: "${searchTerm}"`);
}
await new Promise(resolve => setTimeout(resolve, getRandomDelay(3000, 8000))); // 3-8 second delay between actions
}
console.log(`[High-Intent User ${userId}] High-intent browsing session ended.`);
}
async function startSimulation(numCasualUsers = 2, numHighIntentUsers = 1) {
console.log(`Starting simulation with ${numCasualUsers} casual users and ${numHighIntentUsers} high-intent users.`);
const userPromises = [];
for (let i = 0; i < numCasualUsers; i++) {
const userId = `casual-${Math.random().toString(36).substring(2, 9)}`;
userPromises.push(simulateCasualUser(userId));
await new Promise(resolve => setTimeout(resolve, getRandomDelay(1000, 5000))); // Stagger user starts
}
for (let i = 0; i < numHighIntentUsers; i++) {
const userId = `high-intent-${Math.random().toString(36).substring(2, 9)}`;
userPromises.push(simulateHighIntentUser(userId));
await new Promise(resolve => setTimeout(resolve, getRandomDelay(1000, 5000))); // Stagger user starts
}
await Promise.all(userPromises);
console.log('All user simulations completed.');
}
// Run the simulation
startSimulation(3, 2); // Simulate 3 casual users and 2 high-intent users

View File

@@ -6,23 +6,23 @@ import "@/lib/gsap-setup";
import { ServiceWrapper } from "@/components/ServiceWrapper";
import Tag from "@/tag/Tag";
import { getVisualEditScript } from "@/utils/visual-edit-script";
import { Public_Sans } from "next/font/google";
import { Poppins } from "next/font/google";
const halant = Halant({
variable: "--font-halant",
subsets: ["latin"],
weight: ["300", "400", "500", "600", "700"],
});
const inter = Inter({
variable: "--font-inter",
subsets: ["latin"],
});
export const metadata: Metadata = {
title: 'ItineraryGenie: AI-Powered Spreadsheet Planner & Reservation System',
description: 'An intelligent spreadsheet planner and reservation system leveraging custom algorithms (QuickSort, Binary Search, Hash Maps) and Gemini 2.5 Flash API for efficient itinerary and budget management, designed for academic and personal projects.',
};
const poppins = Poppins({
variable: "--font-poppins",
subsets: ["latin"],
weight: ["100", "200", "300", "400", "500", "600", "700", "800", "900"],
});
export default function RootLayout({
children,
}: Readonly<{
@@ -31,9 +31,7 @@ export default function RootLayout({
return (
<html lang="en" suppressHydrationWarning>
<ServiceWrapper>
<body
className={`${halant.variable} ${inter.variable} antialiased`}
>
<body className={`${poppins.variable} antialiased`}>
<Tag />
{children}
<script

View File

@@ -11,7 +11,7 @@ html {
body {
background-color: var(--background);
color: var(--foreground);
font-family: var(--font-inter-tight), sans-serif;
font-family: var(--font-poppins), sans-serif;
position: relative;
min-height: 100vh;
overscroll-behavior: none;
@@ -24,5 +24,5 @@ h3,
h4,
h5,
h6 {
font-family: var(--font-inter-tight), sans-serif;
font-family: var(--font-poppins), sans-serif;
}

View File

@@ -13,12 +13,12 @@
--background: #f6f0e9;
--card: #efe7dd;
--foreground: #2b180a;
--primary-cta: #2b180a;
--primary-cta: #0a162b;
--primary-cta-text: #f6f0e9;
--secondary-cta: #efe7dd;
--secondary-cta-text: #2b180a;
--accent: #94877c;
--background-accent: #afa094;
--background-accent: #969db0;
/* text sizing - set by ThemeProvider */
/* --text-2xs: clamp(0.465rem, 0.62vw, 0.62rem);