Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xis3.0 draft #5

Open
wants to merge 51 commits into
base: MiscChanges
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
1a4dd62
New Frontend
Hasham268 Feb 17, 2024
c8a3663
New Design
Hasham268 Feb 17, 2024
896c311
All designs done
Hasham268 Feb 18, 2024
37c2f65
Added Blobs at various sections of the site.
shuja-shah Feb 18, 2024
2e9973e
responsive fixed, blobs done on all pages
Hasham268 Feb 18, 2024
dba15c4
done
Hasham268 Feb 19, 2024
70dc7d1
fonts (done, nexa, inter, poppins), hardware tab, responsive fix, but…
Hasham268 Feb 19, 2024
73611ed
industry images and robotics model try
Hasham268 Feb 19, 2024
6fe12c6
rm rfed poppins
shuja-shah Feb 19, 2024
c04ec21
Finalize
shuja-shah Feb 19, 2024
2ab9f19
Adding Content 1
shuja-shah Feb 19, 2024
10e83e3
Finalize
shuja-shah Feb 19, 2024
06a957b
Finalize
shuja-shah Feb 19, 2024
60119dc
Finalize
shuja-shah Feb 19, 2024
7e667d9
Fix Bugs
shuja-shah Feb 19, 2024
5c9d6cb
finalize
shuja-shah Feb 19, 2024
b78ceee
Responsive fixed, images fixes, contact and founder backend done, sea…
Hasham268 Feb 20, 2024
fa64895
truncate removed
Hasham268 Feb 21, 2024
ef37b11
footer fixed, symmetry done, videos for ios and safari tried
Hasham268 Feb 21, 2024
9efad26
final
Hasham268 Feb 21, 2024
8837738
site fixes + hero section animation
Hasham268 Feb 21, 2024
ce4a59f
videos converted to gifs, hero section fixed
Hasham268 Feb 22, 2024
a14f879
finalize
Hasham268 Feb 22, 2024
139c1b1
image fix, crisp chat fix, videos fix try
Hasham268 Feb 23, 2024
12c81a9
final
Hasham268 Feb 24, 2024
2a1a3e7
video converted AVC level 3.1
Hasham268 Feb 24, 2024
1dc3025
final
Hasham268 Feb 26, 2024
6c6130c
blogs page fix
Hasham268 Mar 1, 2024
60a8852
final
Hasham268 Mar 1, 2024
252b121
name fix
Hasham268 Mar 5, 2024
c419e55
name fixed xis
Hasham268 Mar 5, 2024
415f0f7
video option added and headings fixed
Hasham268 Mar 19, 2024
bdac79b
caching
Hasham268 Mar 20, 2024
cc27eb4
logo added
Hasham268 Mar 20, 2024
48d8731
fixes
Hasham268 Mar 21, 2024
9cb2045
caching fixed
Hasham268 Mar 21, 2024
ab4236f
contact form fixed
Hasham268 Mar 27, 2024
cbd3e93
cookiebot
Hasham268 Mar 27, 2024
5659e25
cookie bot responsive
Hasham268 Mar 27, 2024
237f048
cookie fix
Hasham268 Mar 27, 2024
6e1dd01
finalize
Hasham268 Mar 27, 2024
7ca7f5f
final
Hasham268 Mar 27, 2024
a9156cc
try
Hasham268 Mar 28, 2024
3e55652
cookie try
Hasham268 Mar 28, 2024
785913e
services page
Hasham268 Mar 29, 2024
f3fc2b0
services page revised
Hasham268 Mar 29, 2024
7dcee92
final
Hasham268 Mar 29, 2024
9ef0d0c
contact fixed
Hasham268 Apr 3, 2024
9db1496
final
Hasham268 Apr 3, 2024
8ff0b03
final
Hasham268 Apr 3, 2024
d27afcc
final
Hasham268 Apr 3, 2024
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
7 changes: 5 additions & 2 deletions be/.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
[email protected]
GMAIL_PASS=qyzdbnqzcuqbjsqa
# [email protected]
# GMAIL_PASS=qyzdbnqzcuqbjsqa

[email protected]
GMAIL_PASS=jkzgziidbxdwapwu

[email protected]
GMAIL_PASS_2=your_password_2
Expand Down
10 changes: 5 additions & 5 deletions be/config/db.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

const MONGO_URI = 'mongodb+srv://shuja:[email protected]/?retryWrites=true&w=majority';
const MONGO_URI =
"mongodb+srv://shuja:[email protected]/?retryWrites=true&w=majority";

// config.js
module.exports = {
mongodb: {
uri: MONGO_URI,
},
mongodb: {
uri: MONGO_URI,
},
};
35 changes: 22 additions & 13 deletions be/models/contact.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,48 @@
const mongoose = require("mongoose");

const contactSchema = new mongoose.Schema({

name: {
fname: {
type: String,
required: [true, "First Name is required."],
trim: true,
minLength: [2, "Name must be larger than 2 characters"],
maxLength: [50, "Name must be lesser than 50 characters"],
},
lname: {
type: String,
required: [true, "Name is required."],
required: [true, "Last Name is required."],
trim: true,
minLength: [2, "Name must be larger than 2 characters"],
maxLength: [50, "Name must be lesser than 50 characters"],
},
jobTitle: {
type: String,
required: [true, "Job Title is required."],
},
company: {
type: String,
required: [true, "Company is required."],
},
topic: {
type: String,
required: [true, "Topic is required."],
},
email: {
type: String,
required: [true, "Email is required."],
trim: true,
unique: true,
match: [/^[\w.%+-]+@[\w.-]+\.[A-Za-z]{2,}$/i, "Invalid email address"],
},
phone: {
type: String,
required: [true, "Phone number is required."],
},
desc: {
type: String,
required: [true, "Message is required."],
},
subject: {
type: String,
required: [true, "Subject is required."],
},
date: {
type: Date,
default: Date.now,
},
});

const Contact = mongoose.model("Contact", contactSchema)
const Contact = mongoose.model("Contact", contactSchema);

module.exports = Contact;
40 changes: 40 additions & 0 deletions be/models/founder.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
const mongoose = require("mongoose");

const FounderSchema = new mongoose.Schema({
fname: {
type: String,
required: [true, "First Name is required."],
trim: true,
minLength: [2, "Name must be larger than 2 characters"],
maxLength: [50, "Name must be lesser than 50 characters"],
},
lname: {
type: String,
required: [true, "Last Name is required."],
trim: true,
minLength: [2, "Name must be larger than 2 characters"],
maxLength: [50, "Name must be lesser than 50 characters"],
},
jobTitle: {
type: String,
required: [true, "Job Title is required."],
},
org: {
type: String,
required: [true, "Organization is required."],
},
email: {
type: String,
required: [true, "Email is required."],
trim: true,
match: [/^[\w.%+-]+@[\w.-]+\.[A-Za-z]{2,}$/i, "Invalid email address"],
},
date: {
type: Date,
default: Date.now,
},
});

const Founder = mongoose.model("Founder", FounderSchema);

module.exports = Founder;
70 changes: 70 additions & 0 deletions be/routes/founderRoutes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
require("dotenv").config(); // Add this line at the top of your file
const express = require("express");
const router = express.Router();
const nodemailer = require("nodemailer");
const Founder = require("../models/founder");

const emailaddress = process.env.GMAIL_USER;
const pass = process.env.GMAIL_PASS;

router.post("/founder", async (req, res) => {
try {
const { fname, lname, jobTitle, org, email} = req.body;
if (
!fname ||
!email ||
!lname ||
!org ||
!jobTitle

) {
return res.status(400).json({ error: "Bad request" });
}
// Save contact details to the database
const founder = new Founder({
fname,
lname,
jobTitle,
org,
email,
});
await founder.save();

// Send email using Nodemailer
const transporter = nodemailer.createTransport({
service: "gmail",
auth: {
user: emailaddress,
pass,
},
tls: {
rejectUnauthorized: false,
},
});
const mailOptions = {
from: req.body.email,
to: "[email protected]", // Replace with the recipient's email address
cc: req.body.email,
subject: `Xis.ai Talk With Founder Form Submission`,
html: `<p>First Name: ${fname}</p><p>Last Name: ${lname}</p><p>Organization: ${org}</p><p>Job Title: ${jobTitle}</p><p>Email: ${email}</p>`,
};

transporter.sendMail(mailOptions, (error, info) => {
if (error) {
console.error("Error sending email:", error.message);
// Don't send response here to avoid 'ERR_HTTP_HEADERS_SENT'
} else {
console.log("Email sent: " + info.response);
// Send the success response here
res
.status(201)
.json({ message: "Instance created successfully", founder });
}
});
} catch (error) {
console.error(error);
res.status(500).json({ error: "Internal Server Error" });
}
});

module.exports = router;
98 changes: 58 additions & 40 deletions be/routes/postcontact.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,50 +8,68 @@ const emailaddress = process.env.GMAIL_USER;
const pass = process.env.GMAIL_PASS;

router.post("/contact", async (req, res) => {
try {
const { name, phone, email, subject, desc } = req.body;
if (!name || !email || !phone || !subject || !desc) {
return res.status(400).json({ error: "Bad request" });
}
try {
const { fname, lname, jobTitle, company, topic, email, desc } = req.body;
if (
!fname ||
!email ||
!lname ||
!topic ||
!company ||
!jobTitle ||
!desc
) {
return res.status(400).json({ error: "Bad request" });
}

// Save contact details to the database
const contact = new Contact({ name, phone, email, subject, desc });
await contact.save();
// Save contact details to the database
const contact = new Contact({
fname,
lname,
jobTitle,
company,
topic,
email,
desc,
});
await contact.save();

// Send email using Nodemailer
const transporter = nodemailer.createTransport({
service: "gmail",
auth: {
user: emailaddress,
pass,
},
tls: {
rejectUnauthorized: false,
},

});
// Send email using Nodemailer
const transporter = nodemailer.createTransport({
service: "gmail",
auth: {
user: emailaddress,
pass,
},
tls: {
rejectUnauthorized: false,
},
});

const mailOptions = {
from: emailaddress,
to: req.body.email, // Replace with the recipient's email address
subject: `Xis.ai Contact Form Submission - ${subject}`,
html: `<p>Name: ${name}</p><p>Phone: ${phone}</p><p>Email: ${email}</p><p>Message: ${desc}</p>`,
};
const mailOptions = {
from: req.body.email,
to: "[email protected]", // Replace with the recipient's email address
cc: req.body.email,
subject: `Xis.ai Contact Form Submission`,
html: `<p>First Name: ${fname}</p><p>Last Name: ${lname}</p><p>Topic: ${topic}</p><p>Company: ${company}</p><p>Job Title: ${jobTitle}</p><p>Email: ${email}</p><p>Message: ${desc}</p>`,
};

transporter.sendMail(mailOptions, (error, info) => {
if (error) {
console.error("Error sending email:", error.message);
// Don't send response here to avoid 'ERR_HTTP_HEADERS_SENT'
} else {
console.log("Email sent: " + info.response);
// Send the success response here
res.status(201).json({ message: "Contact created successfully", contact });
}
});
} catch (error) {
console.error(error);
res.status(500).json({ error: "Internal Server Error" });
}
transporter.sendMail(mailOptions, (error, info) => {
if (error) {
console.error("Error sending email:", error.message);
// Don't send response here to avoid 'ERR_HTTP_HEADERS_SENT'
} else {
console.log("Email sent: " + info.response);
// Send the success response here
res
.status(201)
.json({ message: "Contact created successfully", contact });
}
});
} catch (error) {
console.error(error);
res.status(500).json({ error: "Internal Server Error" });
}
});

module.exports = router;
10 changes: 9 additions & 1 deletion be/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@ const path = require("path");

const authRoutes = require("./routes/authRoutes");
const postcontact = require("./routes/postcontact");
const founderRoute = require("./routes/founderRoutes");
const blogRoutes = require("./routes/blogRoutes")

app.use(cors());
const corsOptions ={
origin:'*',
credentials:true, //access-control-allow-credentials:true
optionSuccessStatus:200,
}

app.use(cors(corsOptions))

app.use("/media", express.static(path.join(__dirname, "media")));
app.use(bodyParser.urlencoded({ extended: true }));
Expand All @@ -19,6 +26,7 @@ app.use(express.json());

app.use("/api/auth", authRoutes);
app.post("/contact", postcontact);
app.post("/founder", founderRoute);
app.use("/", blogRoutes);


Expand Down
Loading