Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
7ec7118
Merge pull request #71 from Krishna-Das20/feature/chatbot
fed-tech Dec 27, 2025
bab07b6
Merge pull request #73 from MdMobid/feature/chatbot
fed-tech Jan 2, 2026
6074d45
Update CORS configuration to include new allowed origin and restrict …
Ritam-Vaskar Jan 12, 2026
77747c4
Update CORS configuration to allow all origins
Ritam-Vaskar Jan 12, 2026
ad9e4c5
Update CORS configuration to allow all origins with credentials
Ritam-Vaskar Jan 12, 2026
d8bdb3d
Update CORS configuration to restrict allowed origins
Ritam-Vaskar Jan 12, 2026
6713982
Refactor CORS middleware to use shared options for normal and preflig…
Ritam-Vaskar Jan 12, 2026
5ff99df
Refactor Dockerfile for efficiency and Puppeteer config
Ritam-Vaskar Jan 14, 2026
b65fa00
feat: Migrate email from Nodemailer to Resend API with fallback support
Krishna-Das20 Jan 14, 2026
ce59708
feat: Migrate email from Nodemailer to Resend API
Krishna-Das20 Jan 14, 2026
4ddb866
Merge pull request #74 from Krishna-Das20/feature/chatbot
Ritam-Vaskar Jan 14, 2026
f1bb7fe
Team event members backend with Unstop Features
Krishna-Das20 Feb 25, 2026
45ddf8e
Added removeTeamMember
MdMobid Feb 26, 2026
46a868a
Sending Mail after removal
MdMobid Feb 26, 2026
55be99e
v2: Fix respondJoinRequest redirect URL, fix joinTeam relatedEvent nu…
Krishna-Das20 Feb 26, 2026
8706eb0
User can request 3 teams at a time
Krishna-Das20 Feb 28, 2026
5cc500e
Merge pull request #1 from Krishna-Das20/feature/teameventmembers
hardikguptaofficialgit Feb 28, 2026
5b269ff
upd
hardikguptaofficialgit Feb 28, 2026
66d524c
updated with some fixes
hardikguptaofficialgit Mar 1, 2026
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
14 changes: 8 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ RUN apt-get update && apt-get install -y \
xdg-utils \
wget \
--no-install-recommends && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
apt-get clean && rm -rf /var/lib/apt/lists/*

# Set working directory
WORKDIR /app
Expand All @@ -43,17 +42,20 @@ WORKDIR /app
ARG DATABASE_URL
ENV DATABASE_URL=${DATABASE_URL}

# Copy package files and install deps
# Skip Puppeteer Chromium download
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true

# Copy package files and install dependencies
COPY package*.json ./
RUN npm install --omit=dev
RUN npm ci --omit=dev

# Copy source
# Copy source code
COPY . .

# Make build.sh executable
RUN chmod +x ./build.sh

# Expose app port
# Expose port
EXPOSE 5000

# Start
Expand Down
65 changes: 0 additions & 65 deletions Services/team.js

This file was deleted.

19 changes: 19 additions & 0 deletions config/nodeMailer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
// config/nodeMailer.js
// DEPRECATED: This file has been replaced by Resend API
// See: config/resend.js and utils/email/nodeMailer.js for new implementation
// Date: January 2026

/* ============================================================
ORIGINAL NODEMAILER CONFIGURATION (COMMENTED OUT)
============================================================

const nodemailer = require("nodemailer");

// Primary transporter (e.g., Gmail)
Expand Down Expand Up @@ -43,3 +51,14 @@ module.exports = {
tertiary: mailTransporterTertiary,
mailerSend: mailTransporterMailerSend,
};

============================================================ */

// Export empty object to prevent import errors during transition
// This file is no longer used - Resend API is used instead
module.exports = {
primary: null,
secondary: null,
tertiary: null,
mailerSend: null,
};
12 changes: 12 additions & 0 deletions config/resend.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* RESEND EMAIL CONFIGURATION
* This file is kept for backward compatibility but is no longer used.
* Email sending is now handled directly in utils/email/nodeMailer.js
*
* The Resend clients are initialized directly in nodeMailer.js using:
* - RESEND_API_KEY + EMAIL_FROM (primary)
* - RESEND_API_KEY_2 + EMAIL_FROM_2 (fallback)
*/

// This file is deprecated - Resend clients are created in nodeMailer.js
module.exports = {};
10 changes: 5 additions & 5 deletions controllers/blog/gemini.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ const getSummary = async (req, res) => {
const model = genAI.getGenerativeModel({ model: 'gemini-2.0-flash' });
const result = await model.generateContent(prompt);
const text = await result.response.text();
console.log(" Gemini /summary response:", text);
console.log(" Gemini /summary response:", text);
res.json({ summary: text.trim() });
} catch (err) {
console.error(" Error in /summary:", err);
console.error(" Error in /summary:", err);
res.status(500).json({ error: "Something went wrong with Gemini Summary API." });
}
};
Expand Down Expand Up @@ -76,7 +76,7 @@ const getAutofill = async (req, res) => {
);

if (bannerImage) {
console.log(" Picked banner image:", bannerImage);
console.log(" Picked banner image:", bannerImage);
} else {
console.warn("⚠️ No suitable banner image found.");
}
Expand Down Expand Up @@ -136,7 +136,7 @@ ${blogText}
const model = genAI.getGenerativeModel({ model: 'gemini-2.0-flash' });
const result = await model.generateContent(prompt);
const responseText = await result.response.text();
console.log(" Gemini /autofill response:", responseText);
console.log(" Gemini /autofill response:", responseText);

// 🧠 Parse Gemini response
let parsed;
Expand All @@ -162,7 +162,7 @@ ${blogText}
});

} catch (err) {
console.error(" Error in /autofill:", err);
console.error(" Error in /autofill:", err);
if (browser) await browser.close();
res.status(500).json({ error: "Something went wrong with Gemini Autofill." });
}
Expand Down
37 changes: 27 additions & 10 deletions controllers/forms/deleteForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,43 @@ const deleteImage = require('../../utils/image/deleteImage');
//@route DELETE /api/form/deleteForm/:id
//@access Admins
const deleteForm = async (req, res, next) => {
console.log("deleteForm");
console.log("deleteForm: start");
try {
const formId = req.params.id;
console.log("deleteForm: formId", formId);
console.log("deleteForm: user", {
id: req.user?.id,
email: req.user?.email,
access: req.user?.access,
});

if (!formId) {
return next(new ApiError(400, "Form id is required"));
}

const deletedForm = await prisma.form.delete({
const existingForm = await prisma.form.findUnique({
where: { id: formId },
});

if (!existingForm) {
console.log("deleteForm: form not found", formId);
return next(new ApiError(404, "Form not found"));
}

const [registrationsDeleted, trackersDeleted, deletedForm] = await prisma.$transaction([
prisma.formRegistration.deleteMany({ where: { formId } }),
prisma.registrationTracker.deleteMany({ where: { formId } }),
prisma.form.delete({ where: { id: formId } }),
]);

console.log("deleteForm: registrationsDeleted", registrationsDeleted?.count);
console.log("deleteForm: trackersDeleted", trackersDeleted?.count);

// Delete image from cloudinary using promise
const imageDeletePromise = deletedForm && deletedForm.info && deletedForm.info.eventImg
? deleteImage(deletedForm.info.eventImg, 'FormImages')
: Promise.resolve();

// Delete all registrations
if (req.body.deleteRegistrations) {
await prisma.formRegistration.deleteMany({
where: { formId: formId }
});
}

// Handle the image deletion promise
imageDeletePromise
.then((result) => {
Expand All @@ -47,4 +64,4 @@ const deleteForm = async (req, res, next) => {
return next(new ApiError(500, 'Error in deleting form', error));
}
};
module.exports = { deleteForm };
module.exports = { deleteForm };
Loading