Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
29 changes: 14 additions & 15 deletions app/api/contact/route.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import nodemailer from 'nodemailer';

export default async function handler(req, res) {
if (req.method !== 'POST') {
return res.status(405).json({ message: 'Method not allowed' });
}
import nodemailer from "nodemailer";

export async function POST(req) {
try {
const { name, email, subject, message } = req.body;
const { name, email, subject, message } = await req.json();

// Create transporter
const transporter = nodemailer.createTransport({
service: 'gmail', // or your email service
service: "gmail",
auth: {
user: process.env.EMAIL_USER,
pass: process.env.EMAIL_PASSWORD,
Expand All @@ -19,8 +15,8 @@ export default async function handler(req, res) {

// Email options
const mailOptions = {
from: process.env.EMAIL_USER,
to: process.env.CONTACT_EMAIL, // Your receiving email
from: email,
to: process.env.EMAIL_USER, // Your receiving email
subject: `New Contact Form Submission: ${subject}`,
text: `
Name: ${name}
Expand All @@ -34,16 +30,19 @@ export default async function handler(req, res) {
<p><strong>Email:</strong> ${email}</p>
<p><strong>Subject:</strong> ${subject}</p>
<p><strong>Message:</strong></p>
<p>${message.replace(/\n/g, '<br>')}</p>
<p>${message.replace(/\n/g, "<br>")}</p>
`,
};

// Send email
await transporter.sendMail(mailOptions);

res.status(200).json({ message: 'Email sent successfully' });
return Response.json({ message: "Email sent successfully" });
} catch (error) {
console.error('Error sending email:', error);
res.status(500).json({ message: 'Error sending email' });
console.error("Error sending email:", error);
return new Response(JSON.stringify({ message: "Error sending email" }), {
status: 500,
headers: { "Content-Type": "application/json" },
});
}
}
}
2 changes: 2 additions & 0 deletions app/components/footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,14 @@ const legalLinks = [
Made with ♥ by <a href="https://www.linkedin.com/in/sohan-rout/" className="text-blue-400 hover:text-blue-300">Sohan Rout</a>
</span>
</div>
{/*
<div className="flex items-start">
<svg className="w-5 h-5 mt-0.5 mr-3 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth="1.5" d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" />
</svg>
<a href="mailto:[email protected]" className="hover:text-blue-400 transition">[email protected]</a>
</div>
*/}
</div>
</div>

Expand Down
12 changes: 6 additions & 6 deletions app/components/testimonial.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ const TestimonialSection = () => {
stars: 5,
},
{
name: 'Priya Sharma',
email: '@priya.s',
review: `As a visual learner, this tool has been revolutionary for me. Being able to see the algorithms in action with different speeds makes all the difference. The color coding helps distinguish between different operations clearly.`,
name: 'Vansh Saini',
email: '@Vanshsaini9311',
review: `The data structure application website is an excellent platform for both beginners and advanced learners. It offers clear, interactive demonstrations of essential data structures like stacks, queues, trees, and graphs. The real-time visualizations make complex topics easier to understand, and the practical examples enhance learning. The clean, responsive design and user-friendly navigation add to its appeal. Whether you're a student or a developer, this site is a valuable resource for strengthening your understanding of algorithms and data structures.`,
stars: 5,
},
{
name: 'Amit Patel',
email: '@amit.p',
review: `Excellent resource for interview preparation. The way it visualizes time and space complexity helps build intuition. I've recommended it to all my friends who are preparing for technical interviews.`,
name: 'Priya Sharma',
email: '@priya.s',
review: `As a visual learner, this tool has been revolutionary for me. Being able to see the algorithms in action with different speeds makes all the difference. The color coding helps distinguish between different operations clearly.`,
stars: 5,
},
{
Expand Down
Loading