Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
58c7163
fix(homepage):changed the data in landing page
shadil-rayyan Sep 2, 2025
fcda7b6
fix(studymaterial):redirected to ktu notes for now
shadil-rayyan Sep 2, 2025
394ac82
fix(topnavbar&studymaterial):fixed the study material issue and the t…
shadil-rayyan Sep 2, 2025
79e0d73
intergrating the api to the events
shadil-rayyan Sep 3, 2025
b8851a5
temperoildy remove teh slug route.ts file to fix npm run build issue
shadil-rayyan Sep 16, 2025
fdd537c
added hamburg in navbar changed the order of quickaction added a new …
shadil-rayyan Sep 16, 2025
a1432b2
fix(build):solved the build issue due to removing profile photo
shadil-rayyan Sep 16, 2025
509a833
fixed now the event adn event/id both are working
shadil-rayyan Sep 24, 2025
6dbace4
somehow build by disbale typescript
shadil-rayyan Sep 24, 2025
5bd7186
fix(events):made events ui more beatifull
shadil-rayyan Sep 24, 2025
59fd3a8
fix(attendence):add the subject fixed the all absent feature as well
shadil-rayyan Sep 24, 2025
eea8af5
made sure the timetable matcht it length as well
shadil-rayyan Sep 24, 2025
76baa52
feat(fixed the entire sidebar of home page)
shadil-rayyan Dec 2, 2025
648617e
bus is fixed but private bus data still need to be added
shadil-rayyan Dec 2, 2025
feed8fb
fix(bus.ts data):removed the private bus button option
shadil-rayyan Dec 2, 2025
b0d89e1
fix (terms and userguide) both are fixed and updated in terms also ad…
shadil-rayyan Dec 3, 2025
0ad6e0a
fix(expense):fixed the responsive issue
shadil-rayyan Dec 4, 2025
86fd726
fix(bus):add the route short name to the buttons
shadil-rayyan Dec 4, 2025
d735ec3
fix(club):updated the club description
shadil-rayyan Dec 12, 2025
7626b1b
fix(bus) added back button
shadil-rayyan Dec 12, 2025
1877a07
fix(install app):removed the image generate paragarph and added back …
shadil-rayyan Dec 12, 2025
203a109
fix(terms & userguide): added the back button to it
shadil-rayyan Dec 12, 2025
f542c98
feat(google analytics) added to track the number of visites to eh web…
shadil-rayyan Dec 12, 2025
45ff4da
trying to fix the enxtjs vuln issue of 15
shadil-rayyan Dec 12, 2025
ecbae3e
fix(build): the usesearchparams error was due to trackpageview code
shadil-rayyan Dec 12, 2025
e9732d0
fix(google analytics): trying to fix google analtytics
shadil-rayyan Dec 13, 2025
bf146a1
[200~fix(analytics): correct Google Analytics component export and u…
shadil-rayyan Dec 13, 2025
8ed6693
fix(club):added more clubs and also fixed the filter option
shadil-rayyan Dec 13, 2025
3534ddb
feat(bus):added more data to the bus
shadil-rayyan Dec 14, 2025
c1f4adb
fix(bus details):fixed no back button issue
shadil-rayyan Dec 14, 2025
8e65cc0
added bug and feature page and fixed the bus back button issue of goi…
shadil-rayyan Dec 15, 2025
3df2faa
Fix bottom navbar sync, improve mobile responsiveness, and UI polish
Abhijiths-s Dec 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
// next.config.js
const isDev = process.env.NODE_ENV === 'development';
const withPWA = require('next-pwa')({
dest: 'public',
const withPWA = require("next-pwa")({
dest: "public",
// By default, disable in dev. Set PWA_DEV=1 to test PWA locally.
disable: isDev && !process.env.PWA_DEV,
disable: process.env.NODE_ENV === "development", // ✅ disable in dev
register: true,
skipWaiting: true,
});

const nextConfig = {
eslint: {
ignoreDuringBuilds: true,
},
typescript: {

ignoreBuildErrors: true,
},
// App Router is enabled by default in Next 13+, nothing special needed here.
// You can add any other Next config as required.
};

module.exports = withPWA(nextConfig);
module.exports = withPWA(nextConfig);
3 changes: 0 additions & 3 deletions open-next.config.ts

This file was deleted.

15,192 changes: 8,492 additions & 6,700 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,23 @@
"cf-typegen": "wrangler types --env-interface CloudflareEnv cloudflare-env.d.ts"
},
"dependencies": {
"@headlessui/react": "^2.2.8",
"@heroicons/react": "^2.2.0",
"@opennextjs/cloudflare": "^1.6.5",
"@types/papaparse": "^5.3.16",
"chart.js": "^4.5.0",
"date-fns": "^4.1.0",
"firebase": "^11.9.1",
"firebase-admin": "^13.4.0",
"framer-motion": "^12.23.13",
"iconsax-react": "^0.0.8",
"idb": "^8.0.3",
"lucide-react": "^0.475.0",
"next": "^15.3.3",
"next-pwa": "^5.6.0",
"nextjs-google-analytics": "^2.3.7",
"papaparse": "^5.5.3",
"pg": "^8.16.3",
"react": "^19.1.0",
"react-chartjs-2": "^5.3.0",
"react-dom": "^19.0.0",
Expand All @@ -40,6 +45,7 @@
"@testing-library/react": "^16.3.0",
"@types/jest": "^29.5.14",
"@types/node": "^20",
"@types/pg": "^8.15.5",
"@types/react": "^19.0.8",
"@types/react-dom": "^19",
"@types/react-fontawesome": "^1.6.8",
Expand Down
Binary file added public/club_image/blockchain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/club_image/cybersecurity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/club_image/foss.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/club_image/gdg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/club_image/iedc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/club_image/ml.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/club_image/sae.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/club_image/tinerhub.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/club_image/void minds.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/sw.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/workbox-4754cb34.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/app/admin/Lost/add/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export default function AddItemPage() {
JSON.stringify([...existingItems, newItem])
);



// Redirect back to the LostFound page
router.push("/lost-found");
Expand Down
108 changes: 108 additions & 0 deletions src/app/api/events/[id]/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
// src/app/events/[id]/route.ts

import { NextResponse } from "next/server";
import { Pool } from "pg";

// Create a new pool instance (best practice: one instance per route file/serverless invocation)
const pool = new Pool({
connectionString: process.env.EVENT_DATABASE_URL,
ssl: {
rejectUnauthorized: false,
},
});

// Helper: convert binary image to base64 Data URL
function processEventImage(event: any) {
if (!event.image_data) return { ...event, imageData: null };

try {
const buffer = Buffer.isBuffer(event.image_data)
? event.image_data
: Buffer.from(event.image_data as unknown as ArrayBuffer);

const base64Image = buffer.toString("base64");
const mimeType = event.image_mime_type || "image/jpeg";

return {
...event,
imageData: `data:${mimeType};base64,${base64Image}`,
imageMimeType: mimeType,
};
} catch (error) {
console.error("Error processing image:", error);
return { ...event, imageData: null, imageMimeType: null };
}
}

// Main GET route handler for /events/[id]
export async function GET(
_request: Request,
{ params }: { params: { id: string } }
) {
const { id } = params;

const client = await pool.connect();

try {
console.log("Fetching event with ID:", id);

// Detect UUID (canonical format)
const uuidRegex =
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
const isUuid = uuidRegex.test(id);

let result;

if (isUuid) {
// Direct query by UUID
result = await client.query("SELECT * FROM events WHERE id = $1", [id]);
if (result.rows.length === 0) {
return NextResponse.json({ error: "Event not found" }, { status: 404 });
}
} else {
// If not a UUID, lookup by slug or slugified title
const slug = id.toLowerCase();
result = await client.query(
`SELECT * FROM events
WHERE LOWER(slug) = $1
OR LOWER(REGEXP_REPLACE(REPLACE(title, ' ', '-'), '[^\\w-]', '', 'g')) = $1
LIMIT 1`,
[slug]
);
if (result.rows.length === 0) {
return NextResponse.json({ error: "Event not found" }, { status: 404 });
}
}

const event = result.rows[0];
const processedEvent = processEventImage(event);

// Format the response for frontend consumption
const formattedEvent = {
id: processedEvent.id,
slug:
processedEvent.slug ||
processedEvent.title
.toLowerCase()
.replace(/\s+/g, "-")
.replace(/[^\w-]+/g, ""),
title: processedEvent.title,
description: processedEvent.description,
venue: processedEvent.venue,
date: processedEvent.date,
time: processedEvent.time,
image: processedEvent.imageData,
imageMimeType: processedEvent.imageMimeType,
};

return NextResponse.json(formattedEvent);
} catch (error) {
console.error("Error in API route:", error);
return NextResponse.json(
{ error: "Internal server error" },
{ status: 500 }
);
} finally {
client.release();
}
}
59 changes: 59 additions & 0 deletions src/app/api/events/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { NextResponse } from "next/server";
import db from "@/lib/db";

// Helper function to convert binary image to base64 data URL
function processEventImage(event: any) {
if (!event.image_data) return { ...event, imageData: null };

try {
const buffer = Buffer.isBuffer(event.image_data)
? event.image_data
: Buffer.from(event.image_data as unknown as ArrayBuffer);

const base64Image = buffer.toString('base64');
const mimeType = event.image_mime_type || 'image/jpeg';

return {
...event,
imageData: `data:${mimeType};base64,${base64Image}`,
imageMimeType: mimeType
};
} catch (error) {
console.error('Error processing image:', error);
return { ...event, imageData: null, imageMimeType: null };
}
}

export async function GET() {
try {
const client = await db.connect();
try {
const result = await client.query('SELECT * FROM events ORDER BY created_at DESC');

const events = result.rows.map(event => {
const processedEvent = processEventImage(event);
return {
id: processedEvent.id,
slug: processedEvent.slug || processedEvent.title.toLowerCase().replace(/\s+/g, '-').replace(/[^\w-]+/g, ''),
title: processedEvent.title,
description: processedEvent.description,
venue: processedEvent.venue,
date: processedEvent.date,
time: processedEvent.time,
image: processedEvent.imageData,
imageMimeType: processedEvent.imageMimeType
};
});

return NextResponse.json(events);
} finally {
client.release();
}
} catch (err: any) {
console.error("Error fetching events:", err);
return NextResponse.json(
{ error: "Failed to fetch events: " + (err.message || 'Unknown error') },
{ status: 500 }
);
}
}
Loading