From 8e3c30bc6a399ba1e8c07c88f6ed0e5b84a6d083 Mon Sep 17 00:00:00 2001 From: Charan Sai Date: Sat, 6 Jun 2026 19:00:59 +0530 Subject: [PATCH 1/3] ci: fix workflow branch trigger and include package-lock.json --- .github/workflows/build-check.yml | 2 +- package-lock.json | 27 +++++++++++++++++++++------ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-check.yml b/.github/workflows/build-check.yml index c407763..9356a16 100644 --- a/.github/workflows/build-check.yml +++ b/.github/workflows/build-check.yml @@ -4,7 +4,7 @@ on: pull_request: branches: [ main ] push: - branches: [ main ] + branches: [ "**" ] jobs: validate-and-build: diff --git a/package-lock.json b/package-lock.json index 0f04196..82ef747 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1363,14 +1363,14 @@ "version": "5.22.0", "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-5.22.0.tgz", "integrity": "sha512-AUt44v3YJeggO2ZU5BkXI7M4hu9BF2zzH2iF2V5pyXT/lRTyWiElZ7It+bRH1EshoMRxHgpYg4VB6rCM+mG5jQ==", - "dev": true, + "devOptional": true, "license": "Apache-2.0" }, "node_modules/@prisma/engines": { "version": "5.22.0", "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.22.0.tgz", "integrity": "sha512-UNjfslWhAt06kVL3CjkuYpHAWSO6L4kDCVPegV6itt7nD1kSJavd3vhgAEhjglLJJKEdJ7oIqDJ+yHk6qO8gPA==", - "dev": true, + "devOptional": true, "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { @@ -1384,14 +1384,14 @@ "version": "5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2", "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2.tgz", "integrity": "sha512-2PTmxFR2yHW/eB3uqWtcgRcgAbG1rwG9ZriSvQw+nnb7c4uCr3RAcGMb6/zfE88SKlC1Nj2ziUvc96Z379mHgQ==", - "dev": true, + "devOptional": true, "license": "Apache-2.0" }, "node_modules/@prisma/fetch-engine": { "version": "5.22.0", "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-5.22.0.tgz", "integrity": "sha512-bkrD/Mc2fSvkQBV5EpoFcZ87AvOgDxbG99488a5cexp5Ccny+UM6MAe/UFkUC0wLYD9+9befNOqGiIJhhq+HbA==", - "dev": true, + "devOptional": true, "license": "Apache-2.0", "dependencies": { "@prisma/debug": "5.22.0", @@ -1403,7 +1403,7 @@ "version": "5.22.0", "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-5.22.0.tgz", "integrity": "sha512-pHhpQdr1UPFpt+zFfnPazhulaZYCUqeIcPpJViYoq9R+D/yw4fjE+CtnsnKzPYm0ddUbeXUzjGVGIRVgPDCk4Q==", - "dev": true, + "devOptional": true, "license": "Apache-2.0", "dependencies": { "@prisma/debug": "5.22.0" @@ -6456,7 +6456,7 @@ "version": "5.22.0", "resolved": "https://registry.npmjs.org/prisma/-/prisma-5.22.0.tgz", "integrity": "sha512-vtpjW3XuYCSnMsNVBjLMNkTj6OZbudcPPTPYHqX0CJfpcdWciI1dM8uHETwmDxxiqEwCIE6WvXucWUetJgfu/A==", - "dev": true, + "devOptional": true, "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { @@ -7788,6 +7788,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/typescript": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", + "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/unbox-primitive": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz", From 03a6a492ff47190c4532e979e27dfcecb9913a26 Mon Sep 17 00:00:00 2001 From: Charan Sai Date: Sat, 6 Jun 2026 19:35:12 +0530 Subject: [PATCH 2/3] style: auto-format codebase to pass CI prettier checks --- backend/src/app.js | 10 ++++++---- backend/src/modules/auth/auth.routes.js | 4 +--- backend/src/modules/matches/matches.service.js | 13 ++++++++----- backend/src/modules/rides/rides.routes.js | 9 ++++++++- frontend/src/main.jsx | 2 +- frontend/src/pages/Login.jsx | 17 ++++++++--------- frontend/src/pages/PostIntent.jsx | 3 +-- frontend/src/pages/PostRide.jsx | 5 +---- 8 files changed, 34 insertions(+), 29 deletions(-) diff --git a/backend/src/app.js b/backend/src/app.js index d5f42bf..a5149f5 100644 --- a/backend/src/app.js +++ b/backend/src/app.js @@ -17,10 +17,12 @@ const eventsRoutes = require('./modules/events/events.routes'); function createApp() { const app = express(); - app.use(cors({ - origin: process.env.FRONTEND_URL || 'http://localhost:5173', - credentials: true, - })); + app.use( + cors({ + origin: process.env.FRONTEND_URL || 'http://localhost:5173', + credentials: true, + }), + ); app.use(express.json()); app.use(cookieParser()); app.use(attachUser); diff --git a/backend/src/modules/auth/auth.routes.js b/backend/src/modules/auth/auth.routes.js index 2138cf6..ce94e23 100644 --- a/backend/src/modules/auth/auth.routes.js +++ b/backend/src/modules/auth/auth.routes.js @@ -46,9 +46,7 @@ router.post('/google/token', async (req, res, next) => { return res.status(400).json({ error: 'Missing credential' }); } - const infoRes = await fetch( - `https://oauth2.googleapis.com/tokeninfo?id_token=${credential}`, - ); + const infoRes = await fetch(`https://oauth2.googleapis.com/tokeninfo?id_token=${credential}`); const info = await infoRes.json(); if (!infoRes.ok || info.error_description) { diff --git a/backend/src/modules/matches/matches.service.js b/backend/src/modules/matches/matches.service.js index bff9c60..0ca7a7f 100644 --- a/backend/src/modules/matches/matches.service.js +++ b/backend/src/modules/matches/matches.service.js @@ -54,10 +54,7 @@ async function findMatchesForIntent(intent) { async function getMatchesForUser(userId) { const matches = await prisma.match.findMany({ where: { - OR: [ - { ride: { posterId: userId } }, - { intent: { userId: userId } }, - ], + OR: [{ ride: { posterId: userId } }, { intent: { userId: userId } }], }, include: { ride: { @@ -238,4 +235,10 @@ async function rejectMatch(matchId, userId) { return { ok: true }; } -module.exports = { findMatchesForRide, findMatchesForIntent, getMatchesForUser, confirmMatch, rejectMatch }; +module.exports = { + findMatchesForRide, + findMatchesForIntent, + getMatchesForUser, + confirmMatch, + rejectMatch, +}; diff --git a/backend/src/modules/rides/rides.routes.js b/backend/src/modules/rides/rides.routes.js index f6ca78f..aa3bb98 100644 --- a/backend/src/modules/rides/rides.routes.js +++ b/backend/src/modules/rides/rides.routes.js @@ -2,7 +2,14 @@ const express = require('express'); const { requireAuth } = require('../../middleware/auth'); const { rideCreateLimiter } = require('../../middleware/rate-limit'); const { createRideSchema } = require('./rides.schema'); -const { createRide, getRideById, cancelRide, joinRide, leaveRide, getMyActiveRides } = require('./rides.service'); +const { + createRide, + getRideById, + cancelRide, + joinRide, + leaveRide, + getMyActiveRides, +} = require('./rides.service'); const router = express.Router(); diff --git a/frontend/src/main.jsx b/frontend/src/main.jsx index 7497ae8..f8df67d 100644 --- a/frontend/src/main.jsx +++ b/frontend/src/main.jsx @@ -6,5 +6,5 @@ import './index.css'; ReactDOM.createRoot(document.getElementById('root')).render( - + , ); diff --git a/frontend/src/pages/Login.jsx b/frontend/src/pages/Login.jsx index 05f810d..627978d 100644 --- a/frontend/src/pages/Login.jsx +++ b/frontend/src/pages/Login.jsx @@ -37,10 +37,11 @@ export default function Login() { } }, }); - window.google.accounts.id.renderButton( - document.getElementById('google-signin-btn'), - { theme: 'outline', size: 'large', width: 280 }, - ); + window.google.accounts.id.renderButton(document.getElementById('google-signin-btn'), { + theme: 'outline', + size: 'large', + width: 280, + }); } if (window.google?.accounts?.id) { @@ -60,9 +61,7 @@ export default function Login() {

A better way to share autos out of campus.

{googleError && ( -

- {googleError} -

+

{googleError}

)} {GOOGLE_CLIENT_ID ? ( @@ -71,8 +70,8 @@ export default function Login() { ) : (

- Google sign-in not configured.{' '} - VITE_GOOGLE_CLIENT_ID is missing. + Google sign-in not configured. VITE_GOOGLE_CLIENT_ID{' '} + is missing.

)} diff --git a/frontend/src/pages/PostIntent.jsx b/frontend/src/pages/PostIntent.jsx index 0956a6f..0b51ac1 100644 --- a/frontend/src/pages/PostIntent.jsx +++ b/frontend/src/pages/PostIntent.jsx @@ -139,8 +139,7 @@ export default function PostIntent() {